Commit 1023341a authored by 王向伟's avatar 王向伟

加解密演示示例

parent 9b3bcdfd
...@@ -5,6 +5,8 @@ import cn.quantgroup.cashloanflowboss.utils.AesUtil; ...@@ -5,6 +5,8 @@ import cn.quantgroup.cashloanflowboss.utils.AesUtil;
import cn.quantgroup.cashloanflowboss.utils.Md5Util; import cn.quantgroup.cashloanflowboss.utils.Md5Util;
import com.google.gson.Gson; import com.google.gson.Gson;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** /**
...@@ -29,11 +31,13 @@ public class EncryptController { ...@@ -29,11 +31,13 @@ public class EncryptController {
return Result.buildSuccess(result); return Result.buildSuccess(result);
} }
@GetMapping("decrypt") @PostMapping("/decrypt")
public Result<StandardResponse> decrypt(String responseStr){ public Result<StandardResponse> decrypt(@RequestParam String responseStr){
String result = AesUtil.decryptAfterBase64Decode(responseStr, aesKey); String result = AesUtil.decryptAfterBase64Decode(responseStr, aesKey);
StandardResponse response = (new Gson()).fromJson(result, StandardResponse.class); StandardResponse response = (new Gson()).fromJson(result, StandardResponse.class);
return Result.buildSuccess(response); return Result.buildSuccess(response);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment