Navya Sanal před 6 roky
rodič
revize
c81e1f6a79

+ 150
- 52
ZipCoinRedJavaServer/.idea/workspace.xml Zobrazit soubor

@@ -12,16 +12,39 @@
12 12
   </component>
13 13
   <component name="FileEditorManager">
14 14
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
15
+      <file leaf-file-name="Wallet.java" pinned="false" current-in-tab="false">
16
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/model/Wallet.java">
17
+          <provider selected="true" editor-type-id="text-editor">
18
+            <state relative-caret-position="476">
19
+              <caret line="67" column="1" selection-start-line="67" selection-start-column="1" selection-end-line="67" selection-end-column="1" />
20
+              <folding>
21
+                <element signature="e#486#487#0" expanded="true" />
22
+                <element signature="e#513#514#0" expanded="true" />
23
+                <element signature="e#553#554#0" expanded="true" />
24
+                <element signature="e#585#586#0" expanded="true" />
25
+                <element signature="e#621#622#0" expanded="true" />
26
+                <element signature="e#653#654#0" expanded="true" />
27
+                <element signature="e#703#704#0" expanded="true" />
28
+                <element signature="e#745#746#0" expanded="true" />
29
+                <element signature="e#782#783#0" expanded="true" />
30
+                <element signature="e#811#812#0" expanded="true" />
31
+                <element signature="e#859#860#0" expanded="true" />
32
+                <element signature="e#895#896#0" expanded="true" />
33
+              </folding>
34
+            </state>
35
+          </provider>
36
+        </entry>
37
+      </file>
15 38
       <file leaf-file-name="application.properties" pinned="false" current-in-tab="false">
16 39
         <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
17 40
           <provider selected="true" editor-type-id="text-editor" />
18 41
         </entry>
19 42
       </file>
20
-      <file leaf-file-name="pom.xml" pinned="false" current-in-tab="true">
43
+      <file leaf-file-name="pom.xml" pinned="false" current-in-tab="false">
21 44
         <entry file="file://$PROJECT_DIR$/pom.xml">
22 45
           <provider selected="true" editor-type-id="text-editor">
23 46
             <state relative-caret-position="315">
24
-              <caret line="21" column="17" lean-forward="true" selection-start-line="21" selection-start-column="17" selection-end-line="21" selection-end-column="17" />
47
+              <caret line="21" column="17" selection-start-line="21" selection-start-column="17" selection-end-line="21" selection-end-column="17" />
25 48
             </state>
26 49
           </provider>
27 50
         </entry>
@@ -47,8 +70,14 @@
47 70
       <file leaf-file-name="WalletController.java" pinned="false" current-in-tab="false">
48 71
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/controller/WalletController.java">
49 72
           <provider selected="true" editor-type-id="text-editor">
50
-            <state relative-caret-position="105">
51
-              <caret line="14" column="13" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
73
+            <state relative-caret-position="430">
74
+              <caret line="50" column="1" selection-start-line="50" selection-start-column="1" selection-end-line="50" selection-end-column="1" />
75
+              <folding>
76
+                <element signature="e#1112#1113#0" expanded="true" />
77
+                <element signature="e#1173#1174#0" expanded="true" />
78
+                <element signature="e#1324#1325#0" expanded="true" />
79
+                <element signature="e#1383#1384#0" expanded="true" />
80
+              </folding>
52 81
             </state>
53 82
           </provider>
54 83
         </entry>
@@ -62,11 +91,11 @@
62 91
           </provider>
63 92
         </entry>
64 93
       </file>
65
-      <file leaf-file-name="ZipCoinApp.java" pinned="false" current-in-tab="false">
66
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/ZipCoinApp.java">
94
+      <file leaf-file-name="WalletRepository.java" pinned="false" current-in-tab="false">
95
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/repository/WalletRepository.java">
67 96
           <provider selected="true" editor-type-id="text-editor">
68
-            <state relative-caret-position="75">
69
-              <caret line="6" column="13" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
97
+            <state relative-caret-position="390">
98
+              <caret line="31" lean-forward="true" selection-start-line="31" selection-end-line="31" />
70 99
             </state>
71 100
           </provider>
72 101
         </entry>
@@ -74,7 +103,7 @@
74 103
       <file leaf-file-name="TransactionLoader.java" pinned="false" current-in-tab="false">
75 104
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/config/TransactionLoader.java">
76 105
           <provider selected="true" editor-type-id="text-editor">
77
-            <state relative-caret-position="75">
106
+            <state relative-caret-position="150">
78 107
               <caret line="10" column="13" selection-start-line="10" selection-start-column="13" selection-end-line="10" selection-end-column="13" />
79 108
               <folding>
80 109
                 <element signature="imports" expanded="true" />
@@ -83,10 +112,10 @@
83 112
           </provider>
84 113
         </entry>
85 114
       </file>
86
-      <file leaf-file-name="WalletLoader.java" pinned="false" current-in-tab="false">
115
+      <file leaf-file-name="WalletLoader.java" pinned="false" current-in-tab="true">
87 116
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/config/WalletLoader.java">
88 117
           <provider selected="true" editor-type-id="text-editor">
89
-            <state relative-caret-position="120">
118
+            <state relative-caret-position="75">
90 119
               <caret line="10" column="16" selection-start-line="10" selection-start-column="16" selection-end-line="10" selection-end-column="16" />
91 120
             </state>
92 121
           </provider>
@@ -102,6 +131,9 @@
102 131
       <list>
103 132
         <option value="$PROJECT_DIR$/src/main/resources/db/migration/V2__create_block.sql" />
104 133
         <option value="$PROJECT_DIR$/src/main/java/com/zipcoin/model/Transaction.java" />
134
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcoin/repository/WalletRepository.java" />
135
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcoin/model/Wallet.java" />
136
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcoin/controller/WalletController.java" />
105 137
       </list>
106 138
     </option>
107 139
   </component>
@@ -121,17 +153,19 @@
121 153
   <component name="NodePackageJsonFileManager">
122 154
     <packageJsonPaths />
123 155
   </component>
124
-  <component name="ProjectFrameBounds">
156
+  <component name="ProjectFrameBounds" fullScreen="true">
125 157
     <option name="y" value="23" />
126
-    <option name="width" value="1280" />
127
-    <option name="height" value="713" />
158
+    <option name="width" value="1426" />
159
+    <option name="height" value="804" />
128 160
   </component>
129 161
   <component name="ProjectView">
130 162
     <navigator proportions="" version="1">
131 163
       <foldersAlwaysOnTop value="true" />
132 164
     </navigator>
133 165
     <panes>
166
+      <pane id="Scope" />
134 167
       <pane id="PackagesPane" />
168
+      <pane id="AndroidView" />
135 169
       <pane id="ProjectPane">
136 170
         <subPane>
137 171
           <expand>
@@ -165,12 +199,55 @@
165 199
               <item name="java" type="462c0819:PsiDirectoryNode" />
166 200
               <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
167 201
             </path>
202
+            <path>
203
+              <item name="ZipCoin-RED" type="b2602c69:ProjectViewProjectNode" />
204
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
205
+              <item name="src" type="462c0819:PsiDirectoryNode" />
206
+              <item name="main" type="462c0819:PsiDirectoryNode" />
207
+              <item name="java" type="462c0819:PsiDirectoryNode" />
208
+              <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
209
+              <item name="config" type="462c0819:PsiDirectoryNode" />
210
+            </path>
211
+            <path>
212
+              <item name="ZipCoin-RED" type="b2602c69:ProjectViewProjectNode" />
213
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
214
+              <item name="src" type="462c0819:PsiDirectoryNode" />
215
+              <item name="main" type="462c0819:PsiDirectoryNode" />
216
+              <item name="java" type="462c0819:PsiDirectoryNode" />
217
+              <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
218
+              <item name="controller" type="462c0819:PsiDirectoryNode" />
219
+            </path>
220
+            <path>
221
+              <item name="ZipCoin-RED" type="b2602c69:ProjectViewProjectNode" />
222
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
223
+              <item name="src" type="462c0819:PsiDirectoryNode" />
224
+              <item name="main" type="462c0819:PsiDirectoryNode" />
225
+              <item name="java" type="462c0819:PsiDirectoryNode" />
226
+              <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
227
+              <item name="model" type="462c0819:PsiDirectoryNode" />
228
+            </path>
229
+            <path>
230
+              <item name="ZipCoin-RED" type="b2602c69:ProjectViewProjectNode" />
231
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
232
+              <item name="src" type="462c0819:PsiDirectoryNode" />
233
+              <item name="main" type="462c0819:PsiDirectoryNode" />
234
+              <item name="java" type="462c0819:PsiDirectoryNode" />
235
+              <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
236
+              <item name="repository" type="462c0819:PsiDirectoryNode" />
237
+            </path>
238
+            <path>
239
+              <item name="ZipCoin-RED" type="b2602c69:ProjectViewProjectNode" />
240
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
241
+              <item name="src" type="462c0819:PsiDirectoryNode" />
242
+              <item name="main" type="462c0819:PsiDirectoryNode" />
243
+              <item name="java" type="462c0819:PsiDirectoryNode" />
244
+              <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
245
+              <item name="utilities" type="462c0819:PsiDirectoryNode" />
246
+            </path>
168 247
           </expand>
169 248
           <select />
170 249
         </subPane>
171 250
       </pane>
172
-      <pane id="Scope" />
173
-      <pane id="AndroidView" />
174 251
     </panes>
175 252
   </component>
176 253
   <component name="PropertiesComponent">
@@ -286,14 +363,15 @@
286 363
       <workItem from="1533217652807" duration="13000" />
287 364
       <workItem from="1533217792171" duration="123000" />
288 365
       <workItem from="1533218101154" duration="232000" />
366
+      <workItem from="1533560541298" duration="578000" />
289 367
     </task>
290 368
     <servers />
291 369
   </component>
292 370
   <component name="TimeTrackingManager">
293
-    <option name="totallyTimeSpent" value="1023000" />
371
+    <option name="totallyTimeSpent" value="1601000" />
294 372
   </component>
295 373
   <component name="ToolWindowManager">
296
-    <frame x="0" y="23" width="1280" height="713" extended-state="0" />
374
+    <frame x="0" y="0" width="1440" height="900" extended-state="0" />
297 375
     <editor active="true" />
298 376
     <layout>
299 377
       <window_info anchor="right" id="Palette" order="3" />
@@ -308,15 +386,16 @@
308 386
       <window_info id="UI Designer" order="2" />
309 387
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
310 388
       <window_info anchor="bottom" id="TODO" order="6" />
389
+      <window_info anchor="bottom" id="Messages" order="7" weight="0.22402598" />
311 390
       <window_info anchor="right" id="Palette&#9;" order="3" />
312 391
       <window_info id="Image Layers" order="2" />
313 392
       <window_info anchor="bottom" id="Java Enterprise" order="7" />
314 393
       <window_info anchor="right" id="Capture Analysis" order="3" />
315 394
       <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
316
-      <window_info anchor="bottom" id="Run" order="2" weight="0.5241379" />
395
+      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.31030303" />
317 396
       <window_info anchor="bottom" id="Spring" order="7" />
318
-      <window_info anchor="bottom" id="Terminal" order="7" />
319
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.27382874" />
397
+      <window_info anchor="bottom" id="Terminal" order="7" weight="0.32969698" />
398
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24606581" />
320 399
       <window_info anchor="right" id="Bean Validation" order="3" />
321 400
       <window_info id="Web" order="2" side_tool="true" />
322 401
       <window_info anchor="right" id="Theme Preview" order="3" />
@@ -324,7 +403,6 @@
324 403
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
325 404
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
326 405
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
327
-      <window_info anchor="bottom" id="Messages" order="7" weight="0.22402598" />
328 406
       <window_info anchor="bottom" id="Message" order="0" />
329 407
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
330 408
       <window_info anchor="bottom" id="Find" order="1" />
@@ -337,13 +415,6 @@
337 415
     <option name="myLimit" value="2678400000" />
338 416
   </component>
339 417
   <component name="editorHistoryManager">
340
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/ZipCoinApp.java">
341
-      <provider selected="true" editor-type-id="text-editor">
342
-        <state relative-caret-position="75">
343
-          <caret line="6" column="13" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
344
-        </state>
345
-      </provider>
346
-    </entry>
347 418
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/config/TransactionLoader.java">
348 419
       <provider selected="true" editor-type-id="text-editor">
349 420
         <state relative-caret-position="75">
@@ -571,13 +642,6 @@
571 642
       <provider selected="true" editor-type-id="text-editor" />
572 643
     </entry>
573 644
     <entry file="file://$PROJECT_DIR$/src/main/resources/db/migration/V2__create_block.sql" />
574
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/model/Wallet.java">
575
-      <provider selected="true" editor-type-id="text-editor">
576
-        <state relative-caret-position="75">
577
-          <caret line="12" column="13" selection-start-line="12" selection-start-column="13" selection-end-line="12" selection-end-column="13" />
578
-        </state>
579
-      </provider>
580
-    </entry>
581 645
     <entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
582 646
       <provider selected="true" editor-type-id="text-editor">
583 647
         <state relative-caret-position="330">
@@ -627,23 +691,9 @@
627 691
         </state>
628 692
       </provider>
629 693
     </entry>
630
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/controller/WalletController.java">
631
-      <provider selected="true" editor-type-id="text-editor">
632
-        <state relative-caret-position="105">
633
-          <caret line="14" column="13" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
634
-        </state>
635
-      </provider>
636
-    </entry>
637
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/config/WalletLoader.java">
638
-      <provider selected="true" editor-type-id="text-editor">
639
-        <state relative-caret-position="120">
640
-          <caret line="10" column="16" selection-start-line="10" selection-start-column="16" selection-end-line="10" selection-end-column="16" />
641
-        </state>
642
-      </provider>
643
-    </entry>
644 694
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/config/TransactionLoader.java">
645 695
       <provider selected="true" editor-type-id="text-editor">
646
-        <state relative-caret-position="75">
696
+        <state relative-caret-position="150">
647 697
           <caret line="10" column="13" selection-start-line="10" selection-start-column="13" selection-end-line="10" selection-end-column="13" />
648 698
           <folding>
649 699
             <element signature="imports" expanded="true" />
@@ -667,7 +717,55 @@
667 717
     <entry file="file://$PROJECT_DIR$/pom.xml">
668 718
       <provider selected="true" editor-type-id="text-editor">
669 719
         <state relative-caret-position="315">
670
-          <caret line="21" column="17" lean-forward="true" selection-start-line="21" selection-start-column="17" selection-end-line="21" selection-end-column="17" />
720
+          <caret line="21" column="17" selection-start-line="21" selection-start-column="17" selection-end-line="21" selection-end-column="17" />
721
+        </state>
722
+      </provider>
723
+    </entry>
724
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/repository/WalletRepository.java">
725
+      <provider selected="true" editor-type-id="text-editor">
726
+        <state relative-caret-position="390">
727
+          <caret line="31" lean-forward="true" selection-start-line="31" selection-end-line="31" />
728
+        </state>
729
+      </provider>
730
+    </entry>
731
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/model/Wallet.java">
732
+      <provider selected="true" editor-type-id="text-editor">
733
+        <state relative-caret-position="476">
734
+          <caret line="67" column="1" selection-start-line="67" selection-start-column="1" selection-end-line="67" selection-end-column="1" />
735
+          <folding>
736
+            <element signature="e#486#487#0" expanded="true" />
737
+            <element signature="e#513#514#0" expanded="true" />
738
+            <element signature="e#553#554#0" expanded="true" />
739
+            <element signature="e#585#586#0" expanded="true" />
740
+            <element signature="e#621#622#0" expanded="true" />
741
+            <element signature="e#653#654#0" expanded="true" />
742
+            <element signature="e#703#704#0" expanded="true" />
743
+            <element signature="e#745#746#0" expanded="true" />
744
+            <element signature="e#782#783#0" expanded="true" />
745
+            <element signature="e#811#812#0" expanded="true" />
746
+            <element signature="e#859#860#0" expanded="true" />
747
+            <element signature="e#895#896#0" expanded="true" />
748
+          </folding>
749
+        </state>
750
+      </provider>
751
+    </entry>
752
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/controller/WalletController.java">
753
+      <provider selected="true" editor-type-id="text-editor">
754
+        <state relative-caret-position="430">
755
+          <caret line="50" column="1" selection-start-line="50" selection-start-column="1" selection-end-line="50" selection-end-column="1" />
756
+          <folding>
757
+            <element signature="e#1112#1113#0" expanded="true" />
758
+            <element signature="e#1173#1174#0" expanded="true" />
759
+            <element signature="e#1324#1325#0" expanded="true" />
760
+            <element signature="e#1383#1384#0" expanded="true" />
761
+          </folding>
762
+        </state>
763
+      </provider>
764
+    </entry>
765
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/config/WalletLoader.java">
766
+      <provider selected="true" editor-type-id="text-editor">
767
+        <state relative-caret-position="75">
768
+          <caret line="10" column="16" selection-start-line="10" selection-start-column="16" selection-end-line="10" selection-end-column="16" />
671 769
         </state>
672 770
       </provider>
673 771
     </entry>

+ 7
- 4
ZipCoinRedJavaServer/src/main/java/com/zipcoin/config/WalletLoader.java Zobrazit soubor

@@ -21,8 +21,12 @@ public class WalletLoader implements ApplicationRunner {
21 21
     public void run(ApplicationArguments applicationArguments) throws Exception {
22 22
         Wallet[] wallets = new Wallet[]
23 23
                 {
24
-                        new Wallet("ANN","34",80),
25
-                        new Wallet("sen","3564",8)
24
+                        new Wallet("navya","3478",14),
25
+                        new Wallet("eric","3564",8),
26
+                        new Wallet("shivam","1234",10),
27
+                        new Wallet("aleena","4321",9),
28
+                        new Wallet("khalil","9090",12),
29
+                        new Wallet("ken","1006",15)
26 30
 
27 31
 
28 32
                 };
@@ -33,5 +37,4 @@ public class WalletLoader implements ApplicationRunner {
33 37
 
34 38
 
35 39
     }
36
-}
37
-
40
+}

+ 12
- 12
ZipCoinRedJavaServer/src/main/java/com/zipcoin/controller/WalletController.java Zobrazit soubor

@@ -28,17 +28,17 @@ public class WalletController {
28 28
         return new ResponseEntity<Iterable<Wallet>>(walletRepository.findAll(), HttpStatus.OK);
29 29
     }
30 30
 
31
-//    //READ A WALLET FROM PUBLIC KEY
32
-//    @RequestMapping(value = "wallets/{publicKey}", method = RequestMethod.GET)
33
-//    public Wallet get(@PathVariable String publicKey){
34
-//        return walletRepository.findWalletFromPubKey(publicKey);
35
-//    }
36
-//
37
-//    //READ PUBLIC KEYS FROM ALL WALLETS
38
-//    @RequestMapping(value = "wallets/publicKeys", method = RequestMethod.GET)
39
-//    public List<String> get(){
40
-//        return walletRepository.findAllPublicKeys();
41
-//    }
31
+    //READ A WALLET FROM PUBLIC KEY
32
+    @RequestMapping(value = "wallets/{name}", method = RequestMethod.GET)
33
+    public Wallet get(@PathVariable String name){
34
+        return walletRepository.findByPublicKey(name);
35
+    }
36
+
37
+    //READ PUBLIC KEYS FROM ALL WALLETS
38
+    @RequestMapping(value = "wallets/publicKeys", method = RequestMethod.GET)
39
+    public List< String> get(){
40
+        return walletRepository.findAllPublicKeys();
41
+    }
42 42
 
43 43
     //DELETE A WALLET
44 44
     @RequestMapping(value = "wallets/{id}", method = RequestMethod.DELETE)
@@ -48,4 +48,4 @@ public class WalletController {
48 48
         return walletToDelete;
49 49
     }
50 50
 
51
-}
51
+}

+ 14
- 38
ZipCoinRedJavaServer/src/main/java/com/zipcoin/model/Wallet.java Zobrazit soubor

@@ -15,6 +15,9 @@ public class Wallet {
15 15
     @Id
16 16
     @GeneratedValue(strategy = GenerationType.AUTO)
17 17
     private int id;
18
+    private String name;
19
+    private String publickey;
20
+    private Double amount;
18 21
 
19 22
     public String getName() {
20 23
         return name;
@@ -32,22 +35,6 @@ public class Wallet {
32 35
         this.publickey = publickey;
33 36
     }
34 37
 
35
-    private String name;
36
-    private String publickey;
37
-    private Double amount;
38
-
39
-    public Wallet()
40
-    {
41
-        generateKeyPair();
42
-
43
-    }
44
-    public Wallet(String name,String publickey,double amount)
45
-    {
46
-        this.name=name;
47
-        this.publickey=publickey;
48
-        this.amount=amount;
49
-    }
50
-
51 38
     public Double getAmount()
52 39
     {
53 40
         return amount;
@@ -58,35 +45,24 @@ public class Wallet {
58 45
         this.amount = amount;
59 46
     }
60 47
 
48
+    public Wallet()
49
+    {
50
+        generateKeyPair();
61 51
 
62
-    public String getPublicKey()
52
+    }
53
+    public Wallet(String name,String publickey,double amount)
63 54
     {
64
-        return publickey;
55
+        this.name=name;
56
+        this.publickey=publickey;
57
+        this.amount=amount;
65 58
     }
66 59
 
67 60
 
68
-    public void generateKeyPair() {
69
-//        try {
70
-//
71
-//            KeyPairGenerator keyGen = KeyPairGenerator.getInstance( "DSA","SUN");
72
-//
73
-//            SecureRandom random = SecureRandom.getInstance("SHA1PRNG","SUN");
74
-//
75
-//            // Initialize the key generator and generate a KeyPair
76
-//            keyGen.initialize(1024, random);   //256 bytes provides an acceptable security level
77
-//            KeyPair keyPair = keyGen.generateKeyPair();
78
-//            // Set the public and private keys from the keyPair
79
-//            privateKey = keyPair.getPrivate();
80
-//            publicKey = keyPair.getPublic();
81
-//
82
-//
83
-//
84
-//        } catch (Exception e) {
85
-//            throw new RuntimeException(e);
86
-//        }
61
+    public void generateKeyPair()
62
+    {
87 63
         Random random =new SecureRandom();
88 64
         Integer random10digit= random.nextInt(10);
89 65
         publickey=random10digit.toString();
90 66
     }
91 67
 
92
-}
68
+}

+ 13
- 0
ZipCoinRedJavaServer/src/main/java/com/zipcoin/repository/WalletRepository.java Zobrazit soubor

@@ -15,4 +15,17 @@ public interface WalletRepository extends JpaRepository<Wallet, Long> {
15 15
 //    @Query("SELECT w.publicKey FROM wallet")
16 16
 //    List<String> findAllPublicKeys();
17 17
 
18
+
19
+    @Query(value="SELECT * FROM Wallet w WHERE w.name = :name",nativeQuery = true)
20
+    Wallet findByPublicKey(@Param("name") String name);
21
+//    Wallet findWalletFromPubKey(@Param("publicKey") String publicKey);
22
+    // Wallet findWalletFromPubKey(@Param("publicKey") String publicKey);
23
+//    Wallet findByPublicKey(String publicKey);
24
+
25
+
26
+
27
+    @Query(value="SELECT w.publicKey FROM Wallet w",nativeQuery = true)
28
+    List<String> findAllPublicKeys();
29
+
30
+
18 31
 }

binární
ZipCoinRedJavaServer/target/classes/com/zipcoin/config/WalletLoader.class Zobrazit soubor


binární
ZipCoinRedJavaServer/target/classes/com/zipcoin/controller/WalletController.class Zobrazit soubor


binární
ZipCoinRedJavaServer/target/classes/com/zipcoin/model/Wallet.class Zobrazit soubor


binární
ZipCoinRedJavaServer/target/classes/com/zipcoin/repository/WalletRepository.class Zobrazit soubor