package com.bicloud.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
@Schema(description = "用户注册请求DTO")
public class RegisterDto {

    @NotBlank(message = "用户名不能为空")
    @Schema(description = "用户名", example = "张三")
    private String username;

    @NotBlank(message = "所属单位不能为空")
    @Schema(description = "所属单位", example = "某某大学")
    private String company;

    @NotBlank(message = "职位不能为空")
    @Schema(description = "职位", example = "研究员")
    private String job;

    @NotBlank(message = "地址不能为空")
    @Schema(description = "所在地址", example = "北京市海淀区")
    private String address;

    @Schema(description = "感兴趣标签", example = "[\"生物信息学\", \"基因组学\"]")
    private java.util.List<String> interestTags;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @Schema(description = "手机号", example = "13800138000")
    private String mobile;

    @NotBlank(message = "验证码不能为空")
    @Schema(description = "验证码", example = "123123")
    private String vcode;

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    @Schema(description = "邮箱地址", example = "example@example.com")
    private String email;

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^[a-zA-Z\\d]{8,20}$",
            message = "密码只能由字母和数字组成，长度8-20位")
    @Schema(description = "密码", example = "Password123")
    private String pwd;

    @NotBlank(message = "确认密码不能为空")
    @Schema(description = "确认密码", example = "Password123")
    private String cpwd;
}
