package com.trade.client.enterprise.customer.domain.model;

import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @description: 注册 body
 * @Author: wanglang
 * @Date: 2024/4/1 17:23
 * @Version: 1.0
 */
public class RegisterMo extends LoginMo {

    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "\\d{11}", message = "手机号必须是11位数字")
    private String phoneNumber;
    @ApiModelProperty(name = "email", value = "电子邮箱")
    /** 电子邮箱 */
    @Length(max = 300, message = "邮箱长度超过限制")
    @Email(message = "邮箱格式不正确")
    private String email;
    @ApiModelProperty(name = "code", value = "验证码")
    /** 验证码 */
    @NotEmpty(message = "验证码不能为空")
    @Pattern(regexp = "\\d{6}", message = "验证码必须是6为数字")
    private String code;
    @ApiModelProperty(name = "referralCode", value = "推荐码")
    /** 辅助字段：不保存数据库，推荐码 */
    private String referralCode;

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getReferralCode() {
        return referralCode;
    }

    public void setReferralCode(String referralCode) {
        this.referralCode = referralCode;
    }
}
