import api from '@/utils/request'

export const iGetList = params => api.post(`/admin/doctor/page`, params)

export const iGetItem = ({ id, ...params }) => api.get(`/admin/doctor/item/${id}`, params)

export const iGetDoctorWithArticleNum = ({ status, ...params }) => api.post(`/admin/doctor/count/${status}`, params)

export const iUpdateItem = (id, params) => api.put(`/admin/doctor/item/${id}`, params)

export const iAddItem = params => api.post(`/admin/doctor/item`, params)

export const iChangeShowStatus = ({ id, ...params }) => api.get(`/admin/doctor/${id}/changeShow`, params)

export const iGetDeptList = params => api.get(`/admin/doctor/dept/list`, params)

export const iGetDoctortList = params => api.get(`/admin/doctor/list`, params)

export const iDeleteDoctor = ({ id, ...params }) => api.del(`/admin/doctor/delete/${id}`, params)

export const iDeleteDoctors = params => api.delData(`/admin/doctor/list/delete`, params)

// 非本表操作

export const iGetArticleList = ({ doctorId, ...params }) => api.post(`/admin/article/page/doctor/${doctorId}`, params)

export const iDeleteDoctorInArticle = ({ articleId, ...params }) => api.put(`/admin/article/${articleId}/doctor/relation`, params)

export const iDeleteDoctorsInArticle = params => api.put(`/admin/article/doctor/relation`, params)
