From 1d9f2d2ce7e780fb85a8663b7c2b0233d7045865 Mon Sep 17 00:00:00 2001
From: 梁剑锋 <1822213252@qq.com>
Date: 星期二, 12 七月 2022 15:50:42 +0800
Subject: [PATCH] remove 删除swagger引用
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
index 0889aab..f4e7dff 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
@@ -6,6 +6,7 @@
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.CaptchaType;
@@ -18,9 +19,6 @@
import com.ruoyi.sms.core.SmsTemplate;
import com.ruoyi.sms.entity.SmsResult;
import com.ruoyi.system.service.ISysConfigService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
@@ -40,7 +38,6 @@
@Anonymous
@Slf4j
@Validated
-@Api(value = "楠岃瘉鐮佹搷浣滃鐞�", tags = {"楠岃瘉鐮佺鐞�"})
@RequiredArgsConstructor
@RestController
public class CaptchaController {
@@ -51,16 +48,16 @@
/**
* 鐭俊楠岃瘉鐮�
+ *
+ * @param phonenumber 鐢ㄦ埛鎵嬫満鍙�
*/
- @ApiOperation("鐭俊楠岃瘉鐮�")
@GetMapping("/captchaSms")
- public R<Void> smsCaptcha(@ApiParam("鐢ㄦ埛鎵嬫満鍙�")
- @NotBlank(message = "{user.phonenumber.not.blank}")
+ public R<Void> smsCaptcha(@NotBlank(message = "{user.phonenumber.not.blank}")
String phonenumber) {
if (smsProperties.getEnabled()) {
R.fail("褰撳墠绯荤粺娌℃湁寮�鍚煭淇″姛鑳斤紒");
}
- String key = Constants.CAPTCHA_CODE_KEY + phonenumber;
+ String key = CacheConstants.CAPTCHA_CODE_KEY + phonenumber;
String code = RandomUtil.randomNumbers(4);
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
// 楠岃瘉鐮佹ā鏉縤d 鑷澶勭悊 (鏌ユ暟鎹簱鎴栧啓姝诲潎鍙�)
@@ -79,7 +76,6 @@
/**
* 鐢熸垚楠岃瘉鐮�
*/
- @ApiOperation("鐢熸垚楠岃瘉鐮�")
@GetMapping("/captchaImage")
public R<Map<String, Object>> getCode() {
Map<String, Object> ajax = new HashMap<>();
@@ -90,7 +86,7 @@
}
// 淇濆瓨楠岃瘉鐮佷俊鎭�
String uuid = IdUtil.simpleUUID();
- String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
+ String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
// 鐢熸垚楠岃瘉鐮�
CaptchaType captchaType = captchaProperties.getType();
boolean isMath = CaptchaType.MATH == captchaType;
--
Gitblit v1.9.3