| 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); | 
|     } | 
|   | 
|   | 
|   | 
| } |