import request from '@/utils/request'

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

export function batchModify(param) {
  return request({
    url: '/store/storeProduct/batchModify',
    method: 'post',
    data: param
  })
}

// 查询商品详细
export function getStoreProduct(productId) {
  return request({
    url: '/store/storeProduct/' + productId,
    method: 'get'
  })
}


export function addOrEdit(data) {
  return request({
    url: '/store/storeProduct/addOrEdit',
    method: 'post',
    data: data
  })
}

export function importTemplate() {
  return request({
    url: '/store/storeProduct/importTemplate',
    method: 'get'
  })
}


// 删除商品
export function delStoreProduct(productId) {
  return request({
    url: '/store/storeProduct/' + productId,
    method: 'delete'
  })
}

// 导出商品
export function exportStoreProduct(query) {
  return request({
    url: '/store/storeProduct/export',
    method: 'get',
    params: query
  })
}

export function genFormatAttr(productId,json) {
  return request({
    url: '/store/storeProduct/genFormatAttr/'+productId,
    method: 'post',
    data: json
  })
}


export function getStoreProductAttrValueList(query) {
  return request({
    url: '/store/storeProduct/getStoreProductAttrValueList',
    method: 'get',
    params: query
  })
}


export function getStoreTuiProductAttrValueList(query) {
  return request({
    url: '/store/storeProduct/getStoreTuiProductAttrValueList',
    method: 'get',
    params: query
  })
}

export function productBySearCh(query) {
  return request({
    url: '/store/storeProduct/listBySearch',
    method: 'get',
    params: query
  })
}


