
package com.tmerclub.cloud.auth.dto;

import com.tmerclub.cloud.common.util.PrincipalUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;

/**
 * 用于登陆传递手机号码和验证码
 *
 * @author tmerclub
 * @date 2020/7/1
 */
@Data
@ToString
public class LoginCodeDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED)
    @Pattern(regexp = PrincipalUtil.MOBILE_REGEXP, message = "请输入正确的手机号")
    @NotBlank(message = "手机号不能为空")
    private String mobile;

    @Schema(description = "验证码", requiredMode = Schema.RequiredMode.REQUIRED)
    //TODO @NotBlank(message = "验证码不能为空")
    private String validCode;

    /**
     * @see com.tmerclub.cloud.api.auth.constant.SysTypeEnum
     */
    @Schema(description = "系统类型 0.普通用户系统", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "sysType不能为空")
    private Integer sysType;

    @Schema(description = "tempUid", requiredMode = Schema.RequiredMode.REQUIRED)
    private String tempUid;

    @Schema(description = "社交账号类型 微信小程序或者微信公众号", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer socialType;

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getValidCode() {
        return validCode;
    }

    public void setValidCode(String validCode) {
        this.validCode = validCode;
    }

    public Integer getSysType() {
        return sysType;
    }

    public void setSysType(Integer sysType) {
        this.sysType = sysType;
    }

    public String getTempUid() {
        return tempUid;
    }

    public void setTempUid(String tempUid) {
        this.tempUid = tempUid;
    }

    public Integer getSocialType() {
        return socialType;
    }

    public void setSocialType(Integer socialType) {
        this.socialType = socialType;
    }

    @Override
    public String toString() {
        return "LoginCodeDTO{" +
                "mobile='" + mobile + '\'' +
                ", validCode='" + validCode + '\'' +
                ", sysType=" + sysType +
                ", tempUid='" + tempUid + '\'' +
                ", socialType=" + socialType +
                '}';
    }
}
