import request from '@/utils/request'

// 获取商品管理列表
export function getGoodManageInfo(query) {
  return request({
    url: '/goods/goodInfoManage/getGoodManage',
    method: 'get',
    params: query
  })
}

// 获取商品分类列表
export function getGoodType(query) {
  return request({
    url: '/goods/goodInfoManage/goodType',
    method: 'get',
    params: query
  })
}

// 新商品发布
export function goodAdd(data) {
  return request({
    url: '/goods/goodInfoManage/goodSave',
    method: 'post',
    data: data
  })
}
// 编辑商品发布
export function goodEdit(data) {
  return request({
    url: '/goods/goodInfoManage/goodEdit',
    method: 'put',
    data: data
  })
}
// 商品删除
export function goodDelete(data) {
  return request({
    url: '/goods/business/category/remove',
    method: 'post',
    data: data
  })
}

// 商品上下架
export function goodUpAndDown(data) {
  return request({
    url: '/goods/goodInfoManage/goodEdit',
    method: 'post',
    data: data
  })
}

// 获取商品信息（id）
export function getGoodInfo(id) {
  return request({
    url: '/goods/goodInfoManage/getGoodInfo/' + id,
    method: 'get'
  })
}

// 获取商品优惠信息配置项
export function getActiveInfos() {
  return request({
    url: '/goods/goodInfoManage/getActiveInfos',
    method: 'get'
  })
}