|
@@ -5,13 +5,17 @@ import com.abi.platform.Base.BaseResponse;
|
|
|
import com.abi.qms.platform.annotation.PassToken;
|
|
|
import com.abi.qms.platform.dao.entity.QrPackage;
|
|
|
import com.abi.qms.platform.dao.mapper.QrPackageMapper;
|
|
|
+import com.abi.qms.platform.dto.req.DecodeForTestReq;
|
|
|
import com.abi.qms.platform.dto.req.GetQrPackageForTestReq;
|
|
|
+import com.abi.qms.platform.dto.res.DecodeForTestRes;
|
|
|
import com.abi.qms.platform.dto.res.GetQrPackageForTestRes;
|
|
|
+import com.abi.qms.platform.infrastructure.util.AesEncodeUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -38,6 +42,9 @@ public class QrPackageTestController {
|
|
|
@Autowired
|
|
|
private RedisClient redisClient;
|
|
|
|
|
|
+ @Value("${spring.profiles.active}")
|
|
|
+ private String active;
|
|
|
+
|
|
|
@ApiOperation("测试获取码包信息")
|
|
|
@GetMapping("getQrPackageForTest")
|
|
|
@PassToken
|
|
@@ -62,6 +69,22 @@ public class QrPackageTestController {
|
|
|
return BaseResponse.create(res);
|
|
|
}
|
|
|
|
|
|
+ @Value("${qms.encode.key}")
|
|
|
+ private String encodeKey;
|
|
|
+
|
|
|
+ @ApiOperation("解密")
|
|
|
+ @GetMapping("decodeForTest")
|
|
|
+ @PassToken
|
|
|
+ public BaseResponse<DecodeForTestRes> decodeForTest(@Validated DecodeForTestReq req) throws Exception{
|
|
|
+ //解密
|
|
|
+ String decodeContent = AesEncodeUtil.aesDecode(req.getContent(), encodeKey);
|
|
|
+
|
|
|
+ //包装出参
|
|
|
+ DecodeForTestRes result = new DecodeForTestRes();
|
|
|
+ result.setDecodeContent(decodeContent);
|
|
|
+
|
|
|
+ return BaseResponse.create(result);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|