From 448aa21e33d3684d17f3bf7b3ef6f0420208ba8d Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 5 Feb 2022 21:20:54 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7=20APP?= =?UTF-8?q?=20=E5=8F=91=E9=80=81=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/member/service/auth/MemberAuthServiceImpl.java | 2 +- .../module/system/api/sms/dto/code/SmsCodeSendReqDTO.java | 3 ++- .../cn/iocoder/yudao/module/system/enums/sms/SmsSceneEnum.java | 3 ++- .../system/controller/admin/sms/SmsCallbackController.java | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java index b95408afc..107c23b63 100644 --- a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java +++ b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java @@ -304,7 +304,7 @@ public class MemberAuthServiceImpl implements MemberAuthService { @Override public void sendSmsCode(Long userId, AppAuthSendSmsReqVO reqVO) { // TODO 要根据不同的场景,校验是否有用户 - smsCodeApi.sendSmsCode(AuthConvert.INSTANCE.convert(reqVO)); + smsCodeApi.sendSmsCode(AuthConvert.INSTANCE.convert(reqVO).setCreateIp(getClientIP())); } /** diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java index 2d2a4c7e3..5d6579bd7 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; import lombok.Data; import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; /** * 短信验证码的发送 Request DTO @@ -24,7 +25,7 @@ public class SmsCodeSendReqDTO { /** * 发送场景 */ - @NotEmpty(message = "发送场景不能为空") + @NotNull(message = "发送场景不能为空") @InEnum(SmsSceneEnum.class) private Integer scene; /** diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsSceneEnum.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsSceneEnum.java index 2edcf0a2d..f8f267301 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsSceneEnum.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsSceneEnum.java @@ -43,7 +43,8 @@ public enum SmsSceneEnum implements IntArrayValuable { } public static SmsSceneEnum getCodeByScene(Integer scene) { - return ArrayUtil.firstMatch(sceneEnum -> sceneEnum.getScene().equals(scene)); + return ArrayUtil.firstMatch(sceneEnum -> sceneEnum.getScene().equals(scene), + values()); } } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java index 00f17d9dd..def88c14c 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java @@ -19,6 +19,7 @@ import javax.servlet.http.HttpServletRequest; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +// TODO 芋艿:这块的接口命名,在纠结下 @Api(tags = "管理后台 - 短信回调") @RestController @RequestMapping("/system/sms/callback")