package cn.novalon.manage.sys.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;

/**
 * 角色创建请求DTO
 * 
 * 文件定义：用于创建角色的请求DTO对象，封装HTTP请求参数
 * 涉及业务：角色管理、权限分配等场景
 * 算法：通过验证注解确保请求参数的有效性
 * 
 * @author 张翔
 * @date 2026-03-13
 */
@Schema(description = "角色创建请求")
public class RoleCreateRequest {

    @Schema(description = "角色名称", example = "管理员")
    @NotBlank(message = "角色名称不能为空")
    @Size(min = 2, max = 50, message = "角色名称长度必须在2-50之间")
    private String roleName;

    @Schema(description = "角色权限字符串", example = "admin")
    @NotBlank(message = "角色权限字符串不能为空")
    @Size(min = 2, max = 50, message = "角色权限字符串长度必须在2-50之间")
    @Pattern(regexp = "^[a-zA-Z0-9_-]+$", message = "角色权限字符串只能包含字母、数字、下划线和横线")
    private String roleKey;

    @Schema(description = "显示顺序", example = "1")
    @NotNull(message = "显示顺序不能为空")
    @Min(value = 1, message = "显示顺序必须大于0")
    private Integer roleSort;

    @Schema(description = "状态", example = "1")
    private Integer status;

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getRoleKey() {
        return roleKey;
    }

    public void setRoleKey(String roleKey) {
        this.roleKey = roleKey;
    }

    public Integer getRoleSort() {
        return roleSort;
    }

    public void setRoleSort(Integer roleSort) {
        this.roleSort = roleSort;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
