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

export function list(query) {
  return request({
    url: '/servant/list',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
        return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}


export function create(data) {
    return request({
      url: '/servant/create',
      method: 'post',
      data
    })
  } 
  
  export function update(data) {
    return request({
      url: '/servant/update',
      method: 'post',
      data
    })
  }

  export function deleteServant(query) {
    return request({
      url: '/servant/delete',
      method: 'get',
      params: query
    })
  }
  
  export function usableServant(query) {
    return request({
      url: '/servant/usable',
      method: 'get',
      params: query
    })
  }