package com.sckw.message.controller;

import com.sckw.core.web.response.HttpResult;
import com.sckw.message.model.vo.req.SendSmsVerifyCoderReqVO;
import com.sckw.message.service.SmsService;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
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;

/**
 * @author: yzc
 * @date: 2023-06-08 10:58
 * @description: 短信相關接口
 */

@RestController
@RequestMapping(value = "/kwmSms")
@RequiredArgsConstructor
@Slf4j
public class SmsController {

    private final SmsService smsService;

    /**
     * @desc: 发送验证码
     * @author: yzc
     * @date: 2023-06-15 15:06
     * @Param param:
     * @return: com.sckw.core.web.response.HttpResult
     */
    @PostMapping(value = "/sendVerifyCode", produces = MediaType.APPLICATION_JSON_VALUE)
    public HttpResult sendVerifyCode(@Valid @RequestBody SendSmsVerifyCoderReqVO param) {
        smsService.sendVerifyCode(param);
        return HttpResult.ok();
    }

}
