import { get, post, put, del, request } from './http'

export interface User {
  id: number
  name: string
  username: string
  email: string
  phone: string
  website: string
}
// get请求
export function getUsers(params?: any) {
  return get<User[]>('/users', params)
}
// post请求
export function createUser(data: Partial<User>) {
  return post<User>('/users', data)
}
// put请求
export function updateUser(id: number, data: Partial<User>) {
  return put<User>(`/users/${id}`, data)
}
// del请求
export function deleteUser(id: number) {
  return del(`/users/${id}`)
}
