import axios from '../utils/request'
// 获取列表
export const goodsList = (data) => {
  return axios({
    method: 'post',
    url: '/cms/goods/list',
    data
  })
}
// 点击删除
export const goodsRemove = (id) => {
  return axios({
    url: `/cms/goods/remove/${id}`
  })
}
// 新增、编辑
export const goodsSave = (data) => {
  return axios({
    method: 'post',
    url: '/cms/goods/save',
    data
  })
}
// 是否显示
export const goodsDisplay = (id, display) => {
  return axios({
    url: `/cms/goods/display/${id}/${display}`
  })
}
// 排序
export const goodsSort = (id, sort) => {
  return axios({
    url: `/cms/goods/sort/${id}/${sort}`
  })
}
// 设为封面
export const goodsImgIndex = (id, fileId) => {
  return axios({
    url: `/cms/goods/imgIndex/${id}/${fileId}`
  })
}
// 通过id获取详情
export const goodsDetail = (id) => {
  return axios({
    url: `/cms/goods/detail/${id}`
  })
}
// 删除图片
export const goodsimgRemove = (id) => {
  return axios({
    url: `/cms/goods/imgRemove/${id}`
  })
}
