| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- /**
- * 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<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 updateRole = (id: number, updateRoleBody: UpdateRoleBody) => {
- return customAxiosInstance<ResponseVoid>({
- url: `/user/${id}/role`,
- method: "PUT",
- headers: { "Content-Type": "application/json" },
- data: updateRoleBody,
- });
- };
- 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",
- });
- };
- const profile = () => {
- return customAxiosInstance<ResponseMapStringObject>({
- url: `/user/profile`,
- method: "GET",
- });
- };
- return {
- queryByPage,
- edit,
- add,
- deleteById,
- updateRole,
- updateUserStatus,
- updatePassword,
- updateUserAvatar,
- queryById,
- profile,
- };
- };
- 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 UpdateRoleResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getUserController>["updateRole"]>>
- >;
- 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"]>>
- >;
- export type ProfileResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getUserController>["profile"]>>
- >;
|