import { requestClient } from '#/api/request';

const prefix = 'base-config/';
/**
 * 分页查询用户列表
 * @param data
 */
export async function getBaseConfigList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}
/**
 * 分页查询用户列表
 * @param data
 */
export async function getBaseConfigOption(data: any) {
  return requestClient.get<any>(`${prefix}option`, { params: data });
}

/**
 * 获取协议详情
 * @param id
 */
export async function getBaseConfigInfo(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 新增协议
 * @param data
 */
export async function createBaseConfig(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑协议
 * @param data
 */
export async function updateBaseConfig(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除协议
 * @param data
 */
export async function deleteBaseConfig(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}
