import request from '@/utils/axios.js'
import api from '@/utils/axiosAPI.js'

/**
  * @description 商品列表
  */
export function storeListApi(id, data) {
    return request.get(`server/${id}/product/lst`, { params: data })
}


/**
  * @description 商品详情
  */
export function getAttrValue(id, data) {
    return request.get(`store/product/detail/${id}`, { params: data })
}

/**
  * @description 免审编辑
  */
export function userFreeTrialApi(id, data) {
    return request.post(`user_free_trial/${id}`, data)
}

/**
  * @description 商品状态分类数量
  */
export function productTitleApi(id, data) {
    return request.get(`server/${id}/product/title`, { params: data })
}

/**
  * @description 上下架
  */
export function productStatusApi(store_id, id, data) {
    return request.post(`server/${store_id}/product/status/${id}`, data)
}

/**
  * @description 平台分类
  */
export function categoryListApi(store_id, data) {
    return request.get(`server/${store_id}/category/list`, { params: data })
}

/**
  * @description 添加商品
  */
export function productCreateApi(store_id, data) {
    return request.post(`server/${store_id}/product/create`, data)
}

/**
  * @description 编辑商品
  */
export function productUpdateApi(store_id, id, data) {
    return request.post(`server/${store_id}/product/update/${id}`, data)
}

/**
  * @description 商品详情
  */
export function productDetailApi(store_id, id, data) {
    return request.get(`server/${store_id}/product/detail/${id}`, { params: data })
}

// /**
//   * @description 批发商品列表
//   */
// export function saleStoreListApi(data) {
//     return request.get(`/store_product/storeProduct/lists`, { params: data })
// }

/**
  * @description 批发商品列表
  */
export function saleStoreListApi(data) {
    return api.get(`/product/product/lists`, { params: data })
}

/**
  * @description 店铺商品分类
  */
export function merchantCategoryListApi(data) {
    return request.get(`/cate/cate/lists`, { params: data })
}


/**
  * @description 门店入库操作列表
  */
export function storeStorageInfoListsApi(data) {
    return request.get('/system_store_storage/systemstorestorage/lists', { params: data })
}

/**
  * @description 门店入库操作入库
  */
export function storeStorageInfoEditApi(data) {
    return request.post('/system_store_storage/systemstorestorage/edit', data)
}