package com.xy.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

@Data
@ApiModel("部门表DTO")
@Accessors(chain = true)
public class SysDeptDto {
    /**
     * 部门ID
     */
    @ApiModelProperty("部门ID")
    private Long id;

    /**
     * 系统ID
     */
    @NotNull(message = "所属系统不可为空")
    @ApiModelProperty(value = "系统", required = true)
    private Long sysId;


    /**
     * 父id
     */
    @ApiModelProperty(value = "系统", required = false)
    private Long parentId;


    /**
     * 名称
     */
    @NotNull(message = "部门名称不能为空")
    @Size(max = 64, min = 2, message = "部门名称长度需要在2-64之间")
    @ApiModelProperty(value = "部门名称", required = true)
    private String name;

    /**
     * 标识
     */
    @ApiModelProperty(value = "部门编码", required = false)
    private String code;

    /**
     * 状态(true启用，false)
     */
    @ApiModelProperty(value = "状态", required = false)
    private Boolean status;
    /**
     * 排序
     */
    @ApiModelProperty(value = "排序", required = false)
    private Integer sortNum;

    @ApiModelProperty(value = "角色ID(数组)", required = false)
    private List<Long> roleIds;


    @Data
    @ApiModel("添加类")
    @Accessors(chain = true)
    public static class QueryRoleDTO {

        @ApiModelProperty(value = "系统id", required = false)
        private Long sysId;

        @NotNull(message = "部门ID不能为空")
        @ApiModelProperty(value = "部门ID", required = true)
        private Long id;

    }

}
