import request from '@/utils/request'
import Qs from 'qs'

export function listCustomerInfo(query) {
  return request({
    method: 'post',
    params:{
      _gp: 'admin.customerinfo',
      _mt: 'list',
      page: query.page,
      limit: query.limit,
      ...query
    }
  })
}

export function createCustomerInfo(data) {
  return request({
    method: 'post',
    data: Qs.stringify({
      _gp: 'admin.customerinfo',
      _mt: 'create',
      CustomerInfoDTO: JSON.stringify(data)
    })
  })
}

export function updateCustomerInfo(data) {
  return request({
    method: 'post',
    data: Qs.stringify({
      _gp: 'admin.customerinfo',
      _mt: 'edit',
      CustomerInfoDTO: JSON.stringify(data)
    })
  })
}

export function deleteCustomerInfo(id) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.customerinfo',
      _mt: 'delete',
      id: id
    }
  })
}
