|
@@ -0,0 +1,75 @@
|
|
|
+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.GetQrPackageForTestReq;
|
|
|
+import com.abi.qms.platform.dto.res.GetQrPackageForTestRes;
|
|
|
+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.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;
|
|
|
+
|
|
|
+ @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);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|