SmsCodeController.java 1.04 KB
package com.meishu.controller;


import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.sms.SendVerifyCodeDTO;
import com.meishu.service.SmsCodeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 短信验证码 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2021-04-25
 */
@RestController
@RequestMapping("/sms")
public class SmsCodeController {

    @Autowired
    private SmsCodeService smsCodeService;

    @PostMapping(value = "/send")
    @ApiOperation("发送短信验证码")
    public ResponseVO sendVerifyCode(@RequestBody SendVerifyCodeDTO sendVerifyCodeDTO ) {
        smsCodeService.sendVerifyCode(sendVerifyCodeDTO);
        return ResponseData.generateCreatedResponse(0);
    }
}