import api from '@/utils/request'

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

export const iGetCollectList = params => api.post(`/admin/article/collect`, params)

export const iGetPvList = params => api.post(`/admin/article/pv`, params)

export const iGetStastics = params => api.post(`/admin/article/statistics`, params)

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

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

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

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

export const iChangeReleaseStatus = ({ id, ...params }) => api.put(`/admin/article/${id}/changeRelease`, params)

export const iChangeSelectReleaseStatus = params => api.put(`/admin/article/changeRelease`, params)

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

export const iDeleteArticles = params => api.del(`/admin/article/delete`, params)
