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

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

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

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

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

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

export async function getDoctorArticleCategoryOption() {
  return requestClient.get<any>(`article-categories/option`);
}
