import request from '@/utils/request'

// 查询商品列表
export function listProduct(query) {
  return request({
    url: '/oms/product/list',
    method: 'get',
    params: query
  })
}

// 查询商品详细
export function getProduct(productId) {
  return request({
    url: '/oms/product/' + productId,
    method: 'get'
  })
}

// 新增商品
export function addOrEdit(data) {
  return request({
    url: '/oms/product/addOrEdit',
    method: 'post',
    data: data
  })
}


// 删除商品
export function delProduct(productId) {
  return request({
    url: '/oms/product/' + productId,
    method: 'delete'
  })
}

// 导出商品
export function exportProduct(query) {
  return request({
    url: '/oms/product/export',
    method: 'get',
    params: query
  })
}

// 生成属性
export function genFormatAttr(productId,json) {
  return request({
    url: '/oms/product/genFormatAttr/' + productId,
    method: 'post',
    data:json
  })
}

//获取属性值
export function getOmsProductAttrValueList(query) {
  return request({
    url: '/oms/product/getOmsProductAttrValueList',
    method: 'get',
    params: query
  })
}