import request from '@/utils/request'

// 分页查询
export const pageList = (query) => {
  return request({
    url: '/goods/goods/pageList',
    method: 'get',
    params: query
  })
}

export const ticketPageList = (query) => {
  return request({
    url: '/goods/goods/pageList',
    method: 'get',
    params: query
  })
}

// 新增/修改
export const saveAndEdit = (data) => {
  return request({
    url: '/goods/goods/insertOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除模板
export const deleteById = (id) => {
  return request({
    url: '/goods/goods/deleteById',
    method: 'delete',
    params: {id:id}
  })
}

// 修改上/下架状态
export const updateStatus = (query) => {
  return request({
    url: '/goods/goods/updateStatus',
    method: 'get',
    params: query
  })
}

// id获取详情
export function getSelectById(id) {
  return request({
    url: '/goods/goods/selectById?id=' + id,
    method: 'get'
  })
}

// 获取行政区划
export function basePositionApi(data) {
  return request({
    url: '/system/basePosition/list',
    method: 'get',
    params:data
  })
}
