import request from '@/utils/request'

// 筛选商品
export function goodsAttr(data) {
  return request({
    url: '/studioGood/get_goods_attr',
    method: 'get',
    data
  })
}

// 上传主图
export function uploadImage(data) {
  return request({
    url: '/goods/uploadgoodsimage',
    method: 'post',
    data
  })
}

// 添加商品
export function addGoods(data) {
  return request({
    url: '/studioGood/add_good',
    method: 'post',
    data
  })
}

// 添加商品
export function updateGoods(data) {
  return request({
    url: '/studioGood/update_good',
    method: 'post',
    data
  })
}

export function getList(data) {
  return request({
    url: '/studioGood/good_list',
    method: 'get',
    params: data
  })
}

// 获取商品属性
export function getTypeList(params) {
  return request({
    url: '/studioGood/good_attr',
    method: 'get',
    params
  })
}

// 获取商品属性
export function getAddType(data) {
  return request({
    url: '/studioGood/add_good_attr',
    method: 'get',
    params: data
  })
}

// 删除商品
export function deleteGoods(data) {
  return request({
    url: '/studioGood/destorygoods',
    method: 'post',
    data
  })
}

// 查看商品详情
export function getInfo(data) {
  return request({
    url: '/studioGood/good_detail',
    method: 'get',
    params: data
  })
}

// 修改商品信息
export function editGoods(data) {
  return request({
    url: '/studioGood/updategoods',
    method: 'post',
    data
  })
}

// 修改商品信息添加尺寸
export function addSize(data) {
  return request({
    url: '/studioGood/add_size',
    method: 'get',
    params: data
  })
}

// 修改商品信息删除尺寸
export function delSize(data) {
  return request({
    url: '/studioGood/destory_size',
    method: 'get',
    params: data
  })
}

// 获取排序商品列表
export function getSortList(data) {
  return request({
    url: '/studioGood/get_good_attr',
    method: 'get',
    data
  })
}

// 商品排序
export function sortGood(data) {
  return request({
    url: '/studioGood/good_sort',
    method: 'post',
    data
  })
}
