import api from '../index'

export default {
  page: (data: {
    keyword?: string
    dept_id?: number
    status?: string
    page?: number
    size?: number
  }) => api.post('magic-api/sys/user/page', data),

  detail: (id: number) => api.get('magic-api/sys/user/detail', { params: { id } }),

  save: (data: any) => api.post('magic-api/sys/user/save', data),

  delete: (id: number) => api.post('magic-api/sys/user/delete', { id }),

  resetPassword: (data: { id: number; new_password: string }) => api.post('magic-api/sys/user/reset_password', data),

  assignRoles: (data: { id: number; role_ids: number[] }) => api.post('magic-api/sys/user/assign_roles', data),
}
