package com.red.circle.other.app.dto.cmd.user.sms;

import com.red.circle.framework.dto.Command;
import jakarta.validation.constraints.NotNull;
import java.util.Objects;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 发送验证码.
 *
 * @author pengliang on 2021/3/25
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class SendSmsRegisterCmd extends Command {

  private static final long serialVersionUID = 1L;

  /**
   * 手机号码前缀.
   *
   * @eo.required
   */
  @NotNull(message = "phonePrefix required.")
  private Integer phonePrefix;

  /**
   * 手机号码.
   *
   * @eo.required
   */
  @NotNull(message = "phoneNumber required.")
  private String phoneNumber;

  /**
   * 验证码.
   */
  private String code;

  public String fullPhoneNumber() {
    return Objects.toString(phonePrefix).concat(Objects.toString(phoneNumber));
  }

}
