houzhongjian
2024-10-16 7da8f196dee8e3c526c009a4bc7f5983ece6bb97
提交 | 用户 | 时间
e7c126 1 package com.iailab.module.system.api.sms;
H 2
3 import com.iailab.framework.common.pojo.CommonResult;
4 import com.iailab.module.system.api.sms.dto.code.SmsCodeSendReqDTO;
5 import com.iailab.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
6 import com.iailab.module.system.api.sms.dto.code.SmsCodeValidateReqDTO;
7 import com.iailab.module.system.service.sms.SmsCodeService;
8 import org.springframework.validation.annotation.Validated;
9 import org.springframework.web.bind.annotation.RestController;
10
11 import javax.annotation.Resource;
12
13 import static com.iailab.framework.common.pojo.CommonResult.success;
14
15 @RestController // 提供 RESTful API 接口,给 Feign 调用
16 @Validated
17 public class SmsCodeApiImpl implements SmsCodeApi {
18
19     @Resource
20     private SmsCodeService smsCodeService;
21
22     @Override
23     public CommonResult<Boolean> sendSmsCode(SmsCodeSendReqDTO reqDTO) {
24         smsCodeService.sendSmsCode(reqDTO);
25         return success(true);
26     }
27
28     @Override
29     public CommonResult<Boolean> useSmsCode(SmsCodeUseReqDTO reqDTO) {
30         smsCodeService.useSmsCode(reqDTO);
31         return success(true);
32     }
33
34     @Override
35     public CommonResult<Boolean> validateSmsCode(SmsCodeValidateReqDTO reqDTO) {
36         smsCodeService.validateSmsCode(reqDTO);
37         return success(true);
38     }
39
40 }