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

const prefix = 'user-browsing-history/';
/**
 * 分页查询用户浏览记录列表
 * @param data
 */
export async function getUserBrowsingHistoryListApi(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

/**
 * 获取用户浏览记录下拉列表
 */
export async function getUserBrowsingHistoryOptionApi() {
  return requestClient.get<any>(`${prefix}option`);
}

/**
 * 获取用户浏览记录详情
 * @param id
 */
export async function getUserBrowsingHistoryInfoApi(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 新增用户浏览记录
 * @param data
 */
export async function createUserBrowsingHistoryApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑用户浏览记录
 * @param data
 */
export async function updateUserBrowsingHistoryApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除用户浏览记录
 * @param data
 */
export async function deleteUserBrowsingHistoryApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}
