import { GetUserListParams, SaveUserType } from "@/types";
import { requestByGet, requestByPost } from "@dage/service";

export const userApi = {
  getList(params: GetUserListParams) {
    return requestByPost("/api/sys/user/list", params);
  },
  handleType(id: number, isEnabled: number) {
    return requestByGet(`/api/sys/user/editStatus/${id}/${isEnabled}`);
  },
  del(ids: number) {
    return requestByGet(`/api/sys/user/removes/${ids}`);
  },
  resetPwd(id: number) {
    return requestByGet(`/api/sys/user/resetPass/${id}`);
  },
  getDetail(id: number) {
    return requestByGet(`/api/sys/user/detail/${id}`);
  },
  edit(params: SaveUserType) {
    return requestByPost("/api/sys/user/save", params);
  },
};
