import {BaseQuery, BaseRequest, BaseResponse} from "@/types/base";

// 权限类型枚举
export enum PermissionType {
    MENU = 'MENU',
    BUTTON = 'BUTTON',
    API = 'API'
}

// 权限类型显示文本
export const PermissionTypeText = {
    [PermissionType.MENU]: '菜单权限',
    [PermissionType.BUTTON]: '按钮权限',
    [PermissionType.API]: '接口权限'
};

// 角色查询参数
export interface RoleQuery extends BaseQuery{
    code?: string;
    name?: string;
    enabled?: boolean;
}

// 角色请求参数
export interface RoleRequest extends BaseRequest{
    code: string;
    name: string;
    description?: string;
    sort?: number;
}

// 角色响应数据
export interface RoleResponse extends BaseResponse {
    code: string;
    name: string;
    description?: string;
    sort: number;
    tags?: RoleTagResponse[];
    createTime: string;
    updateTime: string;
}

// 角色标签请求参数
export interface RoleTagRequest {
    name: string;
    color?: string;
    description?: string;
}

// 角色标签响应数据
export interface RoleTagResponse extends BaseResponse {
    name: string;
    color: string;
    description?: string;
}

// 权限数据
export interface Permission {
    id: number;
    code: string;
    name: string;
    type: PermissionType;
    menuId: number;
    menuName?: string;
    enabled: boolean;
    sort: number;
    description?: string;
} 