package com.cico.nest.lcdp.boot.core.system.controller.admin.permission.vo.role;

import com.cico.nest.lcdp.framework.common.enums.CommonStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.util.Collections;
import java.util.Set;


@Schema(description = "管理后台 - 角色创建 Request VO")
@Data
public class RoleSaveReqVO {

    @Schema(description = "角色编号", example = "1")
    private Long id;

    @Schema(description = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "管理员")
    @NotBlank(message = "角色名称不能为空")
    @Size(max = 30, message = "角色名称长度不能超过30个字符")
    private String name;

//    @NotBlank(message = "角色标志不能为空")
    @Size(max = 100, message = "角色标志长度不能超过100个字符")
    @Schema(description = "角色编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "ADMIN")
    private String code;

    @Schema(description = "显示顺序不能为空", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @NotNull(message = "显示顺序不能为空")
    private Integer sort;

    @Schema(description = "备注", example = "我是一个角色")
    private String remark;

    @Schema(description = "归属机构", example = "1")
    private String deptId;

    @Schema(description = "角色状态,0正常1停用", example = "1")
    private Integer status;

    @Schema(description = "菜单编号列表", example = "1,3,5")
    private Set<Long> menuIds = Collections.emptySet(); // 兜底

    public void setId(Long id) {
        this.id = id;
    }

    public RoleSaveReqVO setName(String name) {
        this.name = name;
        return this;
    }

    public RoleSaveReqVO setCode(String code) {
        this.code = code;
        return this;
    }

    public RoleSaveReqVO setSort(Integer sort) {
        this.sort = sort;
        return this;
    }

    public RoleSaveReqVO setRemark(String remark) {
        this.remark = remark;
        return this;
    }

    public RoleSaveReqVO setDeptId(String deptId    ) {
        this.deptId = deptId;
        return this;
    }
}
