|
|
@@ -105,4 +105,25 @@ public class TokenController extends MyController {
|
|
|
renderJson(MyRet.ok("delete Token successful.").setData(service.deleteByHashAndChainId(token.getChainId(), token.getHash())));
|
|
|
}
|
|
|
|
|
|
+ @EmptyInterface(keyArray = {"chainId", "hash", "magicApprolval"})
|
|
|
+ public void makeMagicApprolval(){
|
|
|
+ String requestJson = (String) getRequest().getAttribute("data");
|
|
|
+ JSONObject requestJsonObj = JSONObject.parseObject(requestJson);
|
|
|
+ int chainId = requestJsonObj.getInteger("chainId");
|
|
|
+ String hash = requestJsonObj.getString("hash");
|
|
|
+ String magicApprolval = requestJsonObj.getString("magicApprolval");
|
|
|
+ int num = service.setMagicApprolval(magicApprolval, chainId, hash);
|
|
|
+ renderJson(MyRet.ok("set successful.").setData(num));
|
|
|
+ }
|
|
|
+
|
|
|
+ @EmptyInterface(keyArray = {"chainId"})
|
|
|
+ public void findApprovalTokenByChainId(){
|
|
|
+ String requestJson = (String) getRequest().getAttribute("data");
|
|
|
+ JSONObject requestJsonObj = JSONObject.parseObject(requestJson);
|
|
|
+ int chainId = requestJsonObj.getInteger("chainId");
|
|
|
+
|
|
|
+ List<Record> rstList = service.findApprovalTokenByChainId(chainId);
|
|
|
+ renderJson(MyRet.ok("ApprovalTokens is found.").setData(rstList));
|
|
|
+ }
|
|
|
+
|
|
|
}
|