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

const prefix = 'region/';
/**
 * 分页查询用户列表
 * @param data
 */
export async function getRegionList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}
/**
 * 分页查询用户列表
 * @param data
 */
export async function getRegionOption(data: any) {
  return requestClient.get<any>(`${prefix}option`, { params: data });
}
/**
 * 分页查询用户列表
 */
export async function getRegionOptionPidApi() {
  return requestClient.get<any>(`${prefix}option`, { params: {
      pid: 0,
    },
  });
}

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

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

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

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