import request from '@/service/request'

export const page = (params: USER.Params.Query) => {
  return request<USER.User.Detail[]>({
    url: '/user/page',
    method: 'GET',
    params
  })
}

export const delUser = (id: string) => {
  return request<USER.User.Detail[]>({
    url: `/user/page?id=${id}`,
    method: 'GET'
  })
}

export const addUser = (data: USER.User.Detail) => {
  return request<string>({
    url: '/user',
    method: 'POST',
    data
  })
}

export const updateUser = (data: USER.User.Detail) => {
  return request<string>({
    url: '/user',
    method: 'PUT',
    data
  })
}
