import request from '../utils/request'

const api = {
  Goods: '/Goods',
  GoodsList: '/Goods/List',
  GetCount: '/Goods/GetCount',
  SendCount: '/Goods/SendCount',
  AdminGoods: '/Admin/Goods',
  AdminGoodsList: '/Admin/Goods/List'
}

export function getGoods (parameter) {
  return request({
    url: api.Goods,
    method: 'get',
    params: parameter
  })
}

export function addGoods (parameter) {
  return request({
    url: api.AdminGoods,
    method: 'post',
    data: parameter
  })
}

export function sendCount (parameter) {
  return request({
    url: api.SendCount,
    method: 'post',
    data: parameter
  })
}

export function adminGetGoods (parameter) {
  return request({
    url: api.AdminGoods,
    method: 'get',
    params: parameter
  })
}

export function getGoodsList (parameter) {
  return request({
    url: api.GoodsList,
    method: 'get',
    params: parameter
  })
}

export function adminGetGoodsList (parameter) {
  return request({
    url: api.AdminGoodsList,
    method: 'get',
    params: parameter
  })
}

export function getCount (parameter) {
  return request({
    url: api.GetCount,
    method: 'get',
    params: parameter
  })
}
