package com.ningdatech.carapi.open.controller;

import javax.validation.Valid;

import org.springframework.validation.annotation.Validated;
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;

import com.ningdatech.carapi.open.manage.UserLoginManage;
import com.ningdatech.carapi.open.model.dto.UserLoginDTO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 用户登录获取验证码
 *
 * @author CMM
 * @since 2023/01/06 16:38
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/open/api/user/login")
@Api(value = "OpenApiUserLoginVerificationCodeController", tags = "验证码登录")
@RequiredArgsConstructor
public class OpenApiUserLoginVerificationCodeController {

    private final UserLoginManage userLoginManage;

    @PostMapping( "/get/verificationCode")
    @ApiOperation(value = "触发发短信接口，获取短信验证码")
    public String getVerificationCode(@RequestBody @Valid UserLoginDTO param){
        return userLoginManage.getVerificationCode(param);
    }
}
