|
@@ -0,0 +1,116 @@
|
|
|
|
|
+/**
|
|
|
|
|
+ * Generated by orval v7.0.1 🍺
|
|
|
|
|
+ * Do not edit manually.
|
|
|
|
|
+ * OpenAPI definition
|
|
|
|
|
+ * OpenAPI spec version: v0
|
|
|
|
|
+ */
|
|
|
|
|
+import type {
|
|
|
|
|
+ DeleteByIdParams,
|
|
|
|
|
+ QueryByPageParams,
|
|
|
|
|
+ Response,
|
|
|
|
|
+ ResponseBoolean,
|
|
|
|
|
+ ResponsePageVoListUserVo,
|
|
|
|
|
+ ResponseUserVo,
|
|
|
|
|
+ UpdateUserAvatarDto,
|
|
|
|
|
+ UpdateUserPasswordDto,
|
|
|
|
|
+ UpdateUserStatusDto,
|
|
|
|
|
+ UserDto,
|
|
|
|
|
+} from "./models";
|
|
|
|
|
+import { customAxiosInstance } from "../util/axios-instance";
|
|
|
|
|
+
|
|
|
|
|
+export const getUserController = () => {
|
|
|
|
|
+ const queryByPage = (params: QueryByPageParams) => {
|
|
|
|
|
+ return customAxiosInstance<ResponsePageVoListUserVo>({
|
|
|
|
|
+ url: `/user`,
|
|
|
|
|
+ method: "GET",
|
|
|
|
|
+ params,
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ const edit = (userDto: UserDto) => {
|
|
|
|
|
+ return customAxiosInstance<ResponseBoolean>({
|
|
|
|
|
+ url: `/user`,
|
|
|
|
|
+ method: "PUT",
|
|
|
|
|
+ headers: { "Content-Type": "application/json" },
|
|
|
|
|
+ data: userDto,
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ const add = (userDto: UserDto) => {
|
|
|
|
|
+ return customAxiosInstance<ResponseBoolean>({
|
|
|
|
|
+ url: `/user`,
|
|
|
|
|
+ method: "POST",
|
|
|
|
|
+ headers: { "Content-Type": "application/json" },
|
|
|
|
|
+ data: userDto,
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ const deleteById = (params: DeleteByIdParams) => {
|
|
|
|
|
+ return customAxiosInstance<ResponseBoolean>({
|
|
|
|
|
+ url: `/user`,
|
|
|
|
|
+ method: "DELETE",
|
|
|
|
|
+ params,
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ const updateUserStatus = (updateUserStatusDto: UpdateUserStatusDto) => {
|
|
|
|
|
+ return customAxiosInstance<Response>({
|
|
|
|
|
+ url: `/user/updateStatus`,
|
|
|
|
|
+ method: "PUT",
|
|
|
|
|
+ headers: { "Content-Type": "application/json" },
|
|
|
|
|
+ data: updateUserStatusDto,
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ const updatePassword = (updateUserPasswordDto: UpdateUserPasswordDto) => {
|
|
|
|
|
+ return customAxiosInstance<Response>({
|
|
|
|
|
+ url: `/user/updatePassword`,
|
|
|
|
|
+ method: "PUT",
|
|
|
|
|
+ headers: { "Content-Type": "application/json" },
|
|
|
|
|
+ data: updateUserPasswordDto,
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ const updateUserAvatar = (updateUserAvatarDto: UpdateUserAvatarDto) => {
|
|
|
|
|
+ return customAxiosInstance<Response>({
|
|
|
|
|
+ url: `/user/updateAvatar`,
|
|
|
|
|
+ method: "PUT",
|
|
|
|
|
+ headers: { "Content-Type": "application/json" },
|
|
|
|
|
+ data: updateUserAvatarDto,
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ const queryById = (id: string) => {
|
|
|
|
|
+ return customAxiosInstance<ResponseUserVo>({
|
|
|
|
|
+ url: `/user/${id}`,
|
|
|
|
|
+ method: "GET",
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ return {
|
|
|
|
|
+ queryByPage,
|
|
|
|
|
+ edit,
|
|
|
|
|
+ add,
|
|
|
|
|
+ deleteById,
|
|
|
|
|
+ updateUserStatus,
|
|
|
|
|
+ updatePassword,
|
|
|
|
|
+ updateUserAvatar,
|
|
|
|
|
+ queryById,
|
|
|
|
|
+ };
|
|
|
|
|
+};
|
|
|
|
|
+export type QueryByPageResult = NonNullable<
|
|
|
|
|
+ Awaited<ReturnType<ReturnType<typeof getUserController>["queryByPage"]>>
|
|
|
|
|
+>;
|
|
|
|
|
+export type EditResult = NonNullable<
|
|
|
|
|
+ Awaited<ReturnType<ReturnType<typeof getUserController>["edit"]>>
|
|
|
|
|
+>;
|
|
|
|
|
+export type AddResult = NonNullable<
|
|
|
|
|
+ Awaited<ReturnType<ReturnType<typeof getUserController>["add"]>>
|
|
|
|
|
+>;
|
|
|
|
|
+export type DeleteByIdResult = NonNullable<
|
|
|
|
|
+ Awaited<ReturnType<ReturnType<typeof getUserController>["deleteById"]>>
|
|
|
|
|
+>;
|
|
|
|
|
+export type UpdateUserStatusResult = NonNullable<
|
|
|
|
|
+ Awaited<ReturnType<ReturnType<typeof getUserController>["updateUserStatus"]>>
|
|
|
|
|
+>;
|
|
|
|
|
+export type UpdatePasswordResult = NonNullable<
|
|
|
|
|
+ Awaited<ReturnType<ReturnType<typeof getUserController>["updatePassword"]>>
|
|
|
|
|
+>;
|
|
|
|
|
+export type UpdateUserAvatarResult = NonNullable<
|
|
|
|
|
+ Awaited<ReturnType<ReturnType<typeof getUserController>["updateUserAvatar"]>>
|
|
|
|
|
+>;
|
|
|
|
|
+export type QueryByIdResult = NonNullable<
|
|
|
|
|
+ Awaited<ReturnType<ReturnType<typeof getUserController>["queryById"]>>
|
|
|
|
|
+>;
|