/** * Generated by orval v7.0.1 🍺 * Do not edit manually. * Serve API * Serve应用接口文档 * OpenAPI spec version: 0.0.1-SNAPSHOT */ import type { DeleteByIdParams, QueryByPageParams, Response, ResponseBoolean, ResponseMapStringObject, ResponsePageVoListUserVo, ResponseUserVo, ResponseVoid, UpdateRoleBody, UpdateUserAvatarDto, UpdateUserPasswordDto, UpdateUserStatusDto, UserDto, } from "./models"; import { customAxiosInstance } from "../util/axios-instance"; export const getUserController = () => { const queryByPage = (params: QueryByPageParams) => { return customAxiosInstance({ url: `/user`, method: "GET", params, }); }; const edit = (userDto: UserDto) => { return customAxiosInstance({ url: `/user`, method: "PUT", headers: { "Content-Type": "application/json" }, data: userDto, }); }; const add = (userDto: UserDto) => { return customAxiosInstance({ url: `/user`, method: "POST", headers: { "Content-Type": "application/json" }, data: userDto, }); }; const deleteById = (params: DeleteByIdParams) => { return customAxiosInstance({ url: `/user`, method: "DELETE", params, }); }; const updateRole = (id: number, updateRoleBody: UpdateRoleBody) => { return customAxiosInstance({ url: `/user/${id}/role`, method: "PUT", headers: { "Content-Type": "application/json" }, data: updateRoleBody, }); }; const updateUserStatus = (updateUserStatusDto: UpdateUserStatusDto) => { return customAxiosInstance({ url: `/user/updateStatus`, method: "PUT", headers: { "Content-Type": "application/json" }, data: updateUserStatusDto, }); }; const updatePassword = (updateUserPasswordDto: UpdateUserPasswordDto) => { return customAxiosInstance({ url: `/user/updatePassword`, method: "PUT", headers: { "Content-Type": "application/json" }, data: updateUserPasswordDto, }); }; const updateUserAvatar = (updateUserAvatarDto: UpdateUserAvatarDto) => { return customAxiosInstance({ url: `/user/updateAvatar`, method: "PUT", headers: { "Content-Type": "application/json" }, data: updateUserAvatarDto, }); }; const queryById = (id: string) => { return customAxiosInstance({ url: `/user/${id}`, method: "GET", }); }; const profile = () => { return customAxiosInstance({ url: `/user/profile`, method: "GET", }); }; return { queryByPage, edit, add, deleteById, updateRole, updateUserStatus, updatePassword, updateUserAvatar, queryById, profile, }; }; export type QueryByPageResult = NonNullable< Awaited["queryByPage"]>> >; export type EditResult = NonNullable< Awaited["edit"]>> >; export type AddResult = NonNullable< Awaited["add"]>> >; export type DeleteByIdResult = NonNullable< Awaited["deleteById"]>> >; export type UpdateRoleResult = NonNullable< Awaited["updateRole"]>> >; export type UpdateUserStatusResult = NonNullable< Awaited["updateUserStatus"]>> >; export type UpdatePasswordResult = NonNullable< Awaited["updatePassword"]>> >; export type UpdateUserAvatarResult = NonNullable< Awaited["updateUserAvatar"]>> >; export type QueryByIdResult = NonNullable< Awaited["queryById"]>> >; export type ProfileResult = NonNullable< Awaited["profile"]>> >;