import request from '@/router/axios'

export function getMerchantByAccount(parameter) {
  return request({
    url: '/admin/merchantMallGoods/getMerchantByAccount',
    method: 'get',
    params:parameter
  })
}

export function isUpon(parameter) {
  return request({
    url: '/admin/merchantMallGoods/batchUpon',
    method: 'put',
    params:parameter
  })
}

export function isNotUpon(parameter) {
  return request({
    url: '/admin/merchantMallGoods/batchDown',
    method: 'put',
    params:parameter
  })
}

export function fetchList(query) {
  return request({
    url: '/admin/merchantMallGoods/page',
    method: 'get',
    params: query
  })
}

export function getGoodsInfo(query) {
  return request({
    url: '/admin/merchantMallGoods/getMerchantGoodsDetail',
    method: 'get',
    params: query
  })
}
// export function getGoodsInfo(params) {
//   return request({
//     url: '/admin/merchantMallGoods/getGoodsDetails',
//     method: 'get',
//     params:params
//   })
// }


export function addObj(obj) {
  return request({
    url: '/general/merchantMallGoods',
    method: 'post',
    params: obj
  })
}

export function getObj(id) {
  return request({
    url: '/general/merchantMallGoods/' + id,
    method: 'get'
  })
}


export function putObj(obj) {
  return request({
    url: '/admin/merchantMallGoods',
    method: 'put',
    params: obj
  })
}




export function isNotHot(parameter) {
  return request({
    url: '/admin/merchantMallGoods/batchSetIsNotHot',
    method: 'put',
    params:parameter
  })
}

export function isHot(parameter) {
  return request({
    url: '/admin/merchantMallGoods/batchSetIsHot',
    method: 'put',
    params:parameter
  })
}




export function delObj(parameter) {
  return request({
    url: '/admin/merchantMallGoods/mallGoods/',
    method: 'delete',
    params:parameter
  })
}

export function querySpecNameById(parameter) {
  return request({
    url: '/admin/mallGoodsSpec/querySpecNameById',
    method: 'get',
    params:parameter
  })
}

