import axios from '../utils/request'
// 获取列表
export const goodsList = (data) => {
  return axios({
    method: 'post',
    url: '/api/cms/goods/list',
    data
  })
}
// 点击删除
export const goodsRemove = (id) => {
  return axios({
    url: `/api/cms/goods/remove/${id}`
  })
}
// 新增、编辑
export const goodsSave = (data) => {
  return axios({
    method: 'post',
    url: '/api/cms/goods/save',
    data
  })
}
// 是否显示
export const goodsDisplay = (id, display) => {
  return axios({
    url: `/api/cms/goods/display/${id}/${display}`
  })
}

// 通过id获取详情
export const goodsDetail = (id) => {
  return axios({
    url: `/api/cms/goods/detail/${id}`
  })
}

// ------------------------------操作日志列表
export const logList = (data) => {
  return axios({
    method: 'post',
    url: '/api/sys/log/list',
    data
  })
}

// ------------------------------操作日志列表
export const dictGetTree = (data) => {
  return axios({
    method: 'post',
    url: '/api/cms/dict/getTree',
    data
  })
}

// ------------------------------统计
export const goodsReport = (data) => {
  return axios({
    url: '/api/cms/goods/report',
    data
  })
}
