package com.storlead.user.pojo.dto;

import com.storlead.framework.mybatis.query.QueryBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * 用户相关参数
 *
 * @author blank
 * @date 2020-12-31 下午 4:44
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "UserParam对象", description = "用户请求参数对象")
public class UserParam  extends QueryBaseEntity {

    private static final long serialVersionUID = -4911053849319957779L;

    @ApiModelProperty(value = "用户id")
    private Long id;

    @ApiModelProperty(value = "组织路由")
    private String orgRouteCode;

    @ApiModelProperty(value = "用户名")
    @NotBlank(message = "用户名不能为空")
    @Length(min = 4, max = 20, message = "用户名长度为4-20位")
    private String username;

    @ApiModelProperty(value = "原密码")
    @NotBlank(message = "原密码不能为空")
    @Length(min = 6, max = 20, message = "原密码长度为6-20位")
    private String password;

    @ApiModelProperty(value = "新密码")
    @NotBlank(message = "新密码不能为空")
    @Length(min = 6, max = 20, message = "密码长度为6-20位")
    private String newPass;

    @ApiModelProperty(value = "手机号")
    @NotBlank(message = "手机号不能为空")
    @Length(min = 11, max = 11, message = "手机号11位")
    @Pattern(regexp = "0?(13-9)[0-9]{9}", message = "手机号格式不正确")
    private String mobile;

    @ApiModelProperty(value = "角色ID列表")
    private List<Long> roleIds;

    @ApiModelProperty(value = "通用搜索条件")
    private Integer status;

    @ApiModelProperty(value = "查询离职人员：0 在职，1：在职 + 离职 ")
    private Boolean isIncludeResign = false;
}
