陶杰
2024-08-22 ee9032d9baf5f33e376d2d2699136e0a7b26bec7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.mzl.flower.web.register;
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.dto.request.SmsSendDTO;
import com.mzl.flower.service.register.SmsService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
@RestController
@RequestMapping("/api/sms")
@Api(value = "发送短信验证码", tags = "发送短信验证码")
@Validated
@Slf4j
public class SmsController extends BaseController {
 
    private final SmsService smsService;
 
    public SmsController(SmsService smsService) {
        this.smsService = smsService;
    }
 
 
    @PostMapping("/send/code")
    @ApiOperation(value = "发送短信验证码")
    public ResponseEntity<ReturnDataDTO<String>> sendSmsCode(@Validated @RequestBody SmsSendDTO smsSendDTO) throws Exception {
        smsService.sendSmsCode(smsSendDTO);
        return returnData(R.SUCCESS.getCode(),null);
    }
 
 
 
}