package com.huimv.employment.service.auth.dto;

import io.swagger.v3.oas.annotations.media.Schema;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 发送登录验证码请求体。
 */
@Schema(description = "发送登录验证码请求")
public class SmsSendRequest {

    @Schema(description = "手机号，11 位中国大陆号码", example = "13800138000", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String mobile;

    @Schema(description = "用户类型：enterprise=企业主，worker=临时工", example = "enterprise", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "用户类型不能为空")
    @Pattern(regexp = "^(enterprise|worker)$", message = "用户类型只能是 enterprise 或 worker")
    private String userType;

    public String getMobile() {
        return mobile;
    }

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

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }
}
