import request, { postBlob, getBlob, handleImport } from '@/utils/request'

export function websitGoodsAloneMList(data) {
  return request({
    url: `/websit/goods/alone/m/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function websitGoodsAloneMListExport(data, name) {
  return postBlob({
    url: '/websit/goods/alone/m/list/export',
    data,
    name
  })
}

export function websitGoodsAloneMImport(data) {
  return handleImport('/websit/goods/alone/m/import', data.formdata, data.id || '')
}

// --------------------------------------------------

export function websitGoodsAlonePList(data) {
  return request({
    url: `/websit/goods/alone/p/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function websitGoodsAlonePListExport(data, name) {
  return postBlob({
    url: '/websit/goods/alone/p/list/export',
    data,
    name
  })
}

export function websitGoodsAlonePImport(data) {
  return handleImport('/websit/goods/alone/p/import', data.formdata, data.id || '')
}

// ----------------------------------------------

export function websitGoodsAloneDetail(params) {
  return request({
    url: '/websit/goods/alone/detail',
    method: 'post',
    params
  })
}

export function websitGoodsAloneEdit(data) {
  return request({
    url: '/websit/goods/alone/edit',
    method: 'post',
    data: data
  })
}

export function websitGoodsAloneAdd(data) {
  return request({
    url: '/websit/goods/alone/add',
    method: 'post',
    data: data
  })
}

export function websitGoodsAloneBatchUpdateStatus(params) {
  return request({
    url: '/websit/goods/alone/batch/update/status',
    method: 'post',
    params
  })
}
