|
23 | 23 | import com.webank.weid.protocol.base.IssuerType; |
24 | 24 | import com.webank.weid.protocol.base.PresentationPolicyE; |
25 | 25 | import com.webank.weid.protocol.base.WeIdAuthentication; |
26 | | -import com.webank.weid.protocol.base.WeIdPojo; |
27 | 26 | import com.webank.weid.protocol.base.WeIdPrivateKey; |
28 | 27 | import com.webank.weid.protocol.base.WeIdPublicKey; |
29 | 28 | import com.webank.weid.protocol.request.CptStringArgs; |
@@ -135,29 +134,26 @@ public ResponseData<DataPanel> getDataPanel() { |
135 | 134 |
|
136 | 135 | public ResponseData<PageDto<WeIdInfo>> getWeIdList( |
137 | 136 | PageDto<WeIdInfo> pageDto, |
138 | | - Integer blockNumber, |
139 | 137 | Integer pageSize, |
140 | | - Integer indexInBlock, |
141 | | - boolean direction |
| 138 | + Integer indexFirst |
142 | 139 | ) { |
143 | | - ResponseData<List<WeIdPojo>> response = getWeIdService().getWeIdList(blockNumber, pageSize, indexInBlock, direction); |
| 140 | + ResponseData<List<String>> response = getWeIdService().getWeIdList(indexFirst, indexFirst+pageSize-1); |
144 | 141 | if (response.getErrorCode() != ErrorCode.SUCCESS.getCode()) { |
145 | 142 | log.error("[getWeIdList] get weIdList has error, {} - {}", response.getErrorCode(), response.getErrorMessage()); |
146 | 143 | return new ResponseData<>(pageDto, response.getErrorCode(), response.getErrorMessage()); |
147 | 144 | } |
148 | | - List<WeIdPojo> list = response.getResult(); |
| 145 | + List<String> list = response.getResult(); |
149 | 146 | pageDto.setAllCount(getWeIdService().getWeIdCount().getResult()); |
150 | 147 | List<WeIdInfo> rList = new ArrayList<>(); |
151 | 148 | if (list.size() > 0) { |
152 | 149 | String mainHash = WeIdSdkUtils.getMainHash(); |
153 | | - for (WeIdPojo weIdPojo : list) { |
154 | | - WeIdInfo weInfo = getWeIdInfo(this.getWeIdAddress(weIdPojo.getId())); |
| 150 | + for (String weId : list) { |
| 151 | + WeIdInfo weInfo = getWeIdInfo(this.getWeIdAddress(weId)); |
155 | 152 | if(weInfo == null) { |
156 | 153 | weInfo = new WeIdInfo(); |
157 | 154 | } |
158 | | - weInfo.setWeIdPojo(weIdPojo); |
159 | | - weInfo.setWeId(weIdPojo.getId()); |
160 | | - AuthorityIssuer issuer = getAuthorityIssuerService().queryAuthorityIssuerInfo(weIdPojo.getId()).getResult(); |
| 155 | + weInfo.setWeId(weId); |
| 156 | + AuthorityIssuer issuer = getAuthorityIssuerService().queryAuthorityIssuerInfo(weId).getResult(); |
161 | 157 | weInfo.setIssuer(issuer != null); |
162 | 158 | weInfo.setHash(mainHash); |
163 | 159 | rList.add(weInfo); |
@@ -274,7 +270,7 @@ public ResponseData<String> createWeIdByPublicKey(HttpServletRequest request, Da |
274 | 270 | if (currentWeIdAuth.getWeId().equals(owner)) { |
275 | 271 | WeIdPublicKey weidPublicKey = new WeIdPublicKey(); |
276 | 272 | weidPublicKey.setPublicKey(publicKey); |
277 | | - ResponseData<String> response = getWeIdService().delegateCreateWeId(weidPublicKey, currentWeIdAuth); |
| 273 | + ResponseData<String> response = getWeIdService().createWeIdByPublicKey(weidPublicKey, currentWeIdAuth.getWeIdPrivateKey()); |
278 | 274 | if (!response.getErrorCode().equals(ErrorCode.SUCCESS.getCode())) { |
279 | 275 | log.error( |
280 | 276 | "[CreateWeId] create WeID faild. error code : {}, error msg :{}", |
@@ -489,7 +485,6 @@ private WeIdAuthentication getCurrentWeIdAuth() { |
489 | 485 | callerAuth.setWeIdPrivateKey(weIdPrivateKey); |
490 | 486 | callerAuth.setWeId(WeIdUtils.convertPublicKeyToWeId( |
491 | 487 | DataToolUtils.publicKeyFromPrivate(new BigInteger(weIdPrivateKey.getPrivateKey())).toString())); |
492 | | - callerAuth.setWeIdPublicKeyId(callerAuth.getWeId()); |
493 | 488 | return callerAuth; |
494 | 489 | } |
495 | 490 |
|
|
0 commit comments