瀏覽代碼

deleted .idea from src

Khalil Malik Saboor 6 年之前
父節點
當前提交
619e4f0c60

+ 3
- 0
ZipCoinRedJavaServer/.gitignore 查看文件

@@ -0,0 +1,3 @@
1
+*.iml
2
+target/
3
+.idea/

+ 0
- 0
ZipCoinRedJavaServer/src/main/.gitignore 查看文件


+ 1
- 1
ZipCoinRedJavaServer/src/main/java/com/zipcoin/model/Transaction.java 查看文件

@@ -66,7 +66,7 @@ public class Transaction {
66 66
 
67 67
     public void setCoins(List<Integer> coins) { this.coins = coins; }*/
68 68
 
69
-    private String calulateHash() {
69
+    private String calculateHash() {
70 70
 
71 71
         return DigestUtils.sha256Hex(
72 72
                 sender +

+ 9
- 1
ZipCoinRedJavaServer/src/main/java/com/zipcoin/repository/TransactionRepository.java 查看文件

@@ -2,12 +2,20 @@ package com.zipcoin.repository;
2 2
 
3 3
 import com.zipcoin.model.Transaction;
4 4
 import org.springframework.data.jpa.repository.JpaRepository;
5
+//simport org.springframework.data.rest.core.annotation.RepositoryRestResource;
6
+
5 7
 import org.springframework.data.jpa.repository.Query;
8
+import org.springframework.data.repository.CrudRepository;
6 9
 import org.springframework.data.repository.query.Param;
10
+import org.springframework.stereotype.Repository;
7 11
 
8 12
 import java.util.List;
9 13
 
10
-public interface TransactionRepository extends JpaRepository<Transaction, Long> {
14
+
15
+
16
+@Repository
17
+//@RepositoryRestResource(collectionResourceRel = "transactions", path = "transactions")
18
+public interface TransactionRepository extends CrudRepository<Transaction, Long> {
11 19
 
12 20
 //    @Query("SELECT t FROM transaction t WHERE t.sender = :publicKey OR t.recipient = :publicKey")
13 21
 //    List<Transaction> findAllTransactionsWithPubKey(@Param("publicKey") String publicKey);

+ 0
- 0
ZipCoinRedJavaServer/src/test/.gitignore 查看文件


+ 63
- 0
ZipCoinRedJavaServer/src/test/java/com/zipcoin/model/TransactionTest.java 查看文件

@@ -0,0 +1,63 @@
1
+package com.zipcoin.model;
2
+
3
+import com.zipcoin.repository.TransactionRepository;
4
+import com.zipcoin.utilities.MerkelTreeRoot;
5
+import org.junit.Test;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.context.annotation.Bean;
8
+import org.springframework.data.domain.Page;
9
+import org.springframework.data.domain.Pageable;
10
+import org.springframework.data.domain.Sort;
11
+
12
+import javax.annotation.Resource;
13
+import java.util.Iterator;
14
+import java.util.List;
15
+
16
+import static org.junit.Assert.*;
17
+
18
+public class TransactionTest {
19
+
20
+    @Resource
21
+    TransactionRepository repo;
22
+
23
+    @Test
24
+    public void getTransactionId() {
25
+    }
26
+
27
+    @Test
28
+    public void setTransactionId() {
29
+    }
30
+
31
+    @Test
32
+    public void getSender() {
33
+    }
34
+
35
+    @Test
36
+    public void setSender() {
37
+    }
38
+
39
+    @Test
40
+    public void getRecipient() {
41
+    }
42
+
43
+    @Test
44
+    public void setRecipient() {
45
+    }
46
+
47
+    @Test
48
+    public void getAmount() {
49
+    }
50
+
51
+    @Test
52
+    public void setAmount() {
53
+    }
54
+
55
+    @Test
56
+    public void testHashing() {
57
+
58
+        Iterable<Transaction> listOfTs = repo.findAll();
59
+        for (Transaction t : listOfTs) {
60
+            System.out.println(t.toString());
61
+        }
62
+    }
63
+}