|
@@ -1,98 +1,98 @@
|
|
|
-package com.abi.qms.platform.controller.special;
|
|
|
-
|
|
|
-import com.abi.base.foundation.util.RedisClient;
|
|
|
-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;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import java.util.Set;
|
|
|
-
|
|
|
-/**
|
|
|
- * <p>
|
|
|
- * 码包测试
|
|
|
- * </p>
|
|
|
- *
|
|
|
- * @author Andy.Tan
|
|
|
- */
|
|
|
-@Slf4j
|
|
|
-@RestController
|
|
|
-@Api(tags = "码包测试")
|
|
|
-@RequestMapping("test")
|
|
|
-public class QrPackageTestController {
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private QrPackageMapper qrPackageMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private RedisClient redisClient;
|
|
|
-
|
|
|
- @Value("${spring.profiles.active}")
|
|
|
- private String active;
|
|
|
-
|
|
|
- @ApiOperation("测试获取码包信息")
|
|
|
- @GetMapping("getQrPackageForTest")
|
|
|
- @PassToken
|
|
|
- public BaseResponse<GetQrPackageForTestRes> getQrPackageForTest(@Validated GetQrPackageForTestReq req) throws Exception{
|
|
|
-
|
|
|
- QrPackage qrPackage = qrPackageMapper.selectById(req.getId());
|
|
|
- GetQrPackageForTestRes res = new GetQrPackageForTestRes();
|
|
|
- res.setDownloadPath(qrPackage.getDownloadPath());
|
|
|
- res.setZipPassword(qrPackage.getZipPassword());
|
|
|
-
|
|
|
- //短信key
|
|
|
- Set<String> keys = redisClient.getRedisTemplate().keys("qms:download:package:key:" + req.getId() + ":*");
|
|
|
- if(CollectionUtils.isNotEmpty(keys)){
|
|
|
- Object[] keyArr = keys.toArray();
|
|
|
- Object keyObj = redisClient.get(String.valueOf(keyArr[0]));
|
|
|
- if(keyObj!=null){
|
|
|
- res.setSmsKey(String.valueOf(keyObj));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //包装出参
|
|
|
- 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);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+//package com.abi.qms.platform.controller.special;
|
|
|
+//
|
|
|
+//import com.abi.base.foundation.util.RedisClient;
|
|
|
+//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;
|
|
|
+//import org.springframework.web.bind.annotation.RestController;
|
|
|
+//
|
|
|
+//import java.util.Set;
|
|
|
+//
|
|
|
+///**
|
|
|
+// * <p>
|
|
|
+// * 码包测试
|
|
|
+// * </p>
|
|
|
+// *
|
|
|
+// * @author Andy.Tan
|
|
|
+// */
|
|
|
+//@Slf4j
|
|
|
+//@RestController
|
|
|
+//@Api(tags = "码包测试")
|
|
|
+//@RequestMapping("test")
|
|
|
+//public class QrPackageTestController {
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// private QrPackageMapper qrPackageMapper;
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// private RedisClient redisClient;
|
|
|
+//
|
|
|
+// @Value("${spring.profiles.active}")
|
|
|
+// private String active;
|
|
|
+//
|
|
|
+// @ApiOperation("测试获取码包信息")
|
|
|
+// @GetMapping("getQrPackageForTest")
|
|
|
+// @PassToken
|
|
|
+// public BaseResponse<GetQrPackageForTestRes> getQrPackageForTest(@Validated GetQrPackageForTestReq req) throws Exception{
|
|
|
+//
|
|
|
+// QrPackage qrPackage = qrPackageMapper.selectById(req.getId());
|
|
|
+// GetQrPackageForTestRes res = new GetQrPackageForTestRes();
|
|
|
+// res.setDownloadPath(qrPackage.getDownloadPath());
|
|
|
+// res.setZipPassword(qrPackage.getZipPassword());
|
|
|
+//
|
|
|
+// //短信key
|
|
|
+// Set<String> keys = redisClient.getRedisTemplate().keys("qms:download:package:key:" + req.getId() + ":*");
|
|
|
+// if(CollectionUtils.isNotEmpty(keys)){
|
|
|
+// Object[] keyArr = keys.toArray();
|
|
|
+// Object keyObj = redisClient.get(String.valueOf(keyArr[0]));
|
|
|
+// if(keyObj!=null){
|
|
|
+// res.setSmsKey(String.valueOf(keyObj));
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// //包装出参
|
|
|
+// 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);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+//}
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|