package com.qiaoba.api.system.entity.dto;

import com.qiaoba.common.base.validate.AddGroup;
import com.qiaoba.common.base.validate.EditGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Set;

/**
 * 用户
 *
 * @author ailanyin
 * @version 1.0
 * @since 2023/5/8 15:54
 */
@Getter
@Setter
public class SysUserDto implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    @Size(max = 20, message = "主键不能超过{max}个字符", groups = {EditGroup.class})
    private String userId;

    @Schema(description = "姓名")
    @NotNull(message = "姓名不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(min = 1, max = 20, message = "登录账号: {min}-{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String nickname;

    @Schema(description = "部门ID")
    @Size(max = 20, message = "部门ID不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String deptId;

    @Schema(description = "手机号")
    @Size(max = 11, message = "手机号不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String phone;

    @Schema(description = "邮箱")
    @Size(max = 50, message = "邮箱不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String email;

    @Schema(description = "登录账号")
    @NotNull(message = "登录账号不能为空", groups = AddGroup.class)
    @Size(min = 6, max = 20, message = "登录账号: {min}-{max}个字符", groups = AddGroup.class)
    private String username;

    @Schema(description = "密码")
    @NotNull(message = "密码不能为空", groups = AddGroup.class)
    @Size(min = 5, max = 20, message = "密码{min}-{max}个字符", groups = AddGroup.class)
    private String password;

    @Schema(description = "性别")
    @Size(max = 1, message = "性别不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String gender;

    @Schema(description = "状态(0->禁用,1->正常)")
    @Size(max = 1, message = "状态不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String status;

    @Schema(description = "备注")
    @Size(max = 500, message = "备注不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String remark;

    /**
     * 岗位组
     */
    private Set<String> postIds;

    /**
     * 角色组
     */
    private Set<String> roleIds;

}
