import request from '@/utils/request'

// 查询积分管理列表
export function listIntegral(query) {
  return request({
    url: '/pns/integral/list',
    method: 'get',
    params: query
  })
}

// 查询积分管理详细
export function getIntegral(id) {
  return request({
    url: '/pns/integral/' + id,
    method: 'get'
  })
}

// 新增积分管理
export function addIntegral(data) {
  return request({
    url: '/pns/integral',
    method: 'post',
    data: data
  })
}

// 修改积分管理
export function updateIntegral(data) {
  return request({
    url: '/pns/integral',
    method: 'put',
    data: data
  })
}

// 删除积分管理
export function delIntegral(id) {
  return request({
    url: '/pns/integral/' + id,
    method: 'delete'
  })
}

// 导出积分管理
export function exportIntegral(query) {
  return request({
    url: '/pns/integral/export',
    method: 'get',
    params: query
  })
}

export function doReturnPoints(data) {
  return request({
    url: '/pns/integral/doReturnPoints',
    method: 'post',
    data: data
  })
}

export function importTemplate() {
  return request({
    url: '/pns/integral/importTemplate',
    method: 'get'
  })
}

export function integralGroupList(query) {
  return request({
    url: '/pns/integral/groupList',
    method: 'get',
    params: query
  })
}
export function importGroupList(query) {
  return request({
    url: '/pns/integral/exportGroupList',
    method: 'get',
    params: query
  })
}
