package com.red.circle.other.adapter.app.user.sms;

import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.cmd.user.sms.SendSmsRegisterCmd;
import com.red.circle.other.app.service.user.user.RegisterSmsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
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;

/**
 * 注册验证码.
 *
 * @author pengliang on 2023/8/14
 * @eo.api-type http
 * @eo.groupName 用户服务.账号管理
 * @eo.path /user/register-sms
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/user/register-sms", produces = MediaType.APPLICATION_JSON_VALUE)
public class RegisterSmsRestController extends BaseController {

  private final RegisterSmsService registerSmsService;

  /**
   * 发送注册短信验证码.
   *
   * @eo.name 发送注册短信验证码.
   * @eo.url /
   * @eo.method post
   * @eo.request-type json
   */
  @PostMapping
  public void sendRegisterCode(@RequestBody @Validated SendSmsRegisterCmd cmd) {
    // registerSmsService.sendCode(cmd);
  }

  /**
   * 验证-注册验证码是否正确.
   *
   * @eo.name 验证-注册验证码是否正确.
   * @eo.url /check
   * @eo.method post
   * @eo.request-type json
   */
  @PostMapping("/check")
  public Boolean checkRegisterVerificationCode(@RequestBody @Validated SendSmsRegisterCmd cmd) {
    // return registerSmsService.checkCode(cmd);
    return Boolean.FALSE;
  }

}
