import request from '@/utils/request'

// 列表
export function list(data){
  return request({
    url: `/admin/goods/list`,
    method: 'post',
    data
  })
}

// 详情
export function detail(id) {
  return request({
    url: `/admin/goods/queryGoodById/${id}`,
    method: 'get'
  })
}

// 修改
export function edit(data){
  return request({
    url: `/admin/goods/edit`,
    method: 'put',
    data
  })
}

// 新增
export function create(data){
  return request({
    url: `/admin/goods/add`,
    method: 'post',
    data
  })
}

// 删除
export function remove(id) {
  return request({
    url: `/admin/goods/remove/${id}`,
    method: 'get'
  })
}

// 下架
export function shelve(id) {
  return request({
    url: `/admin/goods/unshelve/${id}`,
    method: 'get'
  })
}

// 流量套餐
export function goodsList() {
  return request({
    url: `/admin/goods/queryPackageList`,
    method: 'get'
  })
}