import request from '@/config/axios'
import type { TableData } from './types'

export const getRoleListApi = (params: any) => {
  return request.post({ url: '/role/list', params })
}

// export const getRoleListApi = (data: any) => {
//   return request.post({ url: '/system/spi/SysRole/list', data })
// }

export const delRoleListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: '/role/deletes', data: { ids } })
}

export const saveRoleApi = (data: Partial<TableData>): Promise<IResponse> => {
  return request.post({ url: '/role/save', data })
}

export const queryRoleApi = (id: string | number): Promise<IResponse> => {
  return request.post({ url: '/role/queryOne', data: { id } })
}
