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 WechatLoginRequest {

    @Schema(description = "wx.login 返回的临时 code", example = "081abcXYZ", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "微信 code 不能为空")
    private String code;

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

    public String getCode() {
        return code;
    }

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

    public String getUserType() {
        return userType;
    }

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