import api from '@/utils/request'

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

export const iGetListInArticle = ({ articleId, ...params }) => api.post(`/admin/comment/page/article/${articleId}`, params)

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

export const iGetTodayNum = params => api.post(`/admin/comment/count/today`, params)

export const iChangeShowStatus = ({ id, ...params }) => api.put(`/admin/comment/setShow/${id}`, params)

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

export const iDeleteComments = params => api.del(`/admin/comment/list/delete`, params)

export const iSetTopItem = ({ id, ...params }) => api.put(`/admin/comment/setTop/${id}`, params)

export const iApproveItem = ({ id, ...params }) => api.put(`/admin/comment/approve/${id}`, params)

export const iSaveItem = ({ id, ...params }) => api.put(`/admin/comment/${id}`, params)

// 非本表操作

export const iGetSensitiveOptions = ({ dictKey, ...params }) => api.get(`/data-dict/dict-key/${dictKey}/children`, params)

export const iGetSesitiveList = ({ type, ...params }) => api.get(`/admin/comment/sensitive/list/${type}`, params)

export const iAddSesitive = ({ type, ...params }) => api.post(`/admin/comment/sensitive/item`, params)

export const iUpdateSesitive = ({ sensitiveWordsId, ...params }) => api.put(`/admin/comment/sensitive/item/${sensitiveWordsId}`, params)

export const iDeleteSesitive = ({ sensitiveWordsId, ...params }) => api.del(`/admin/comment/sensitive/${sensitiveWordsId}`, params)
