import { BaseDefine, MultipleQuery, MultipleResult } from './base'

/** 角色管理 */
export namespace Role {
  /** role api  */
  interface RawRole {
    code: ROLE
    roleName: string
    updateTime: string
    updaterName: string
  }

  type GetRoleList = BaseDefine<{ role?: ROLE }, RawRole[]>
  type GetRolePrivilege = BaseDefine<
    { role: ROLE },
    {
      code: string
      hasPrivilege: boolean
      id: number
      name: string
      nodeCode: string
      nodeId: number
      nodeName: string
      parentId: number
      parentNodeId: number
    }[]
  >

  type SetRolePrivilege = BaseDefine<{ role: ROLE; privilegeIds: number[] }>

  /** role api end */

  export interface ApiMap {
    getRoleList: GetRoleList
    getRolePrivilege: GetRolePrivilege
    setRolePrivilege: SetRolePrivilege
  }
}
