import request from '@/config/axios'

export interface UserVO {
  id: number
  name: string
  avatar: string
  video: string
  description: string
  sex1: string
  sex2: number
  sex3: boolean
  birthday: Date
  memo: string
  createTime: Date
}

// 查询用户列表
export const getUserPage = async (params) => {
  return await request.get({ url: `/system/user/page`, params })
}

// 查询用户详情
export const getUser = async (id: number) => {
  return await request.get({ url: `/system/user/get?id=` + id })
}

// 新增用户
export const createUser = async (data: UserVO) => {
  return await request.post({ url: `/system/user/create`, data })
}

// 修改用户
export const updateUser = async (data: UserVO) => {
  return await request.put({ url: `/system/user/update`, data })
}

// 删除用户
export const deleteUser = async (id: number) => {
  return await request.delete({ url: `/system/user/delete?id=` + id })
}

// 导出用户 Excel
export const exportUser = async (params) => {
  return await request.download({ url: `/system/user/export-excel`, params })
}