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.Min;
import javax.validation.constraints.NotBlank;
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 SysRoleDto implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @Schema(description = "角色名称")
    @NotBlank(message = "角色名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 30, message = "角色名称不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String roleName;

    @Schema(description = "权限字符")
    @NotBlank(message = "权限字符不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 30, message = "权限字符不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String roleKey;

    @Schema(description = "角色排序")
    @Min(value = 1, message = "排序最小允许: {value}", groups = {AddGroup.class, EditGroup.class})
    private Integer roleSort;

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

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

    @Schema(description = "部门组(数据权限)")
    private Set<String> deptIds;

    @Schema(description = "菜单组")
    private Set<String> menuIds;

}
