import { get, post } from '../../http'

/**
 * @description: 获取子管理员列表
 * @param {*} params
 * @return {*}
 */
export const getAdminList = async (params: Record<string, any>) => {
  return await get<any>('/sysUser/getUserRole', params)
}

/**
 * @description: 新增管理员
 * @param {Record} params
 * @param {*} any
 */
export const createAdmin = async (data: Record<string, any>) => {
  return await post<any>('/sysUser/saveUserRole', data)
}

/**
 * @description: 更新管理员
 * @param {Record} data
 * @param {*} any
 */
export const saveAdmin = async (data: Record<string, any>) => {
  return await post<any>('/sysUser/editUserRole', data)
}

/**
 * @description: 管理员状态切换
 * @param {string} id
 */
export const adminStatus = async (id: string) => {
  return await post<any>(`/sysUser/changeStatus/${id}`)
}

/**
 * @description: 删除管理员
 * @param {string} id
 */
export const adminDelete = async (id: string) => {
  return await post<any>(`/sysUser/deleteUserRole/${id}`)
}
