blob: 4dd6f421b038cc7c6e8585c886a7f64542c38bc7 [file] [log] [blame]
86133aaa3f5d2025-04-20 21:33:29 +08001// @ts-ignore
2/* eslint-disable */
3import { request } from '@umijs/max';
4
5/** Create user This can only be done by the logged in user. POST /user */
6export async function createUser(body: API.User, options?: { [key: string]: any }) {
7 return request<any>('/user', {
8 method: 'POST',
9 data: body,
10 ...(options || {}),
11 });
12}
13
14/** Get user by user name GET /user/${param0} */
15export async function getUserByName(
16 // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
17 params: API.getUserByNameParams,
18 options?: { [key: string]: any },
19) {
20 const { username: param0, ...queryParams } = params;
21 return request<API.User>(`/user/${param0}`, {
22 method: 'GET',
23 params: { ...queryParams },
24 ...(options || {}),
25 });
26}
27
28/** Updated user This can only be done by the logged in user. PUT /user/${param0} */
29export async function updateUser(
30 // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
31 params: API.updateUserParams,
32 body: API.User,
33 options?: { [key: string]: any },
34) {
35 const { username: param0, ...queryParams } = params;
36 return request<any>(`/user/${param0}`, {
37 method: 'PUT',
38 params: { ...queryParams },
39 data: body,
40 ...(options || {}),
41 });
42}
43
44/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */
45export async function deleteUser(
46 // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
47 params: API.deleteUserParams,
48 options?: { [key: string]: any },
49) {
50 const { username: param0, ...queryParams } = params;
51 return request<any>(`/user/${param0}`, {
52 method: 'DELETE',
53 params: { ...queryParams },
54 ...(options || {}),
55 });
56}
57
58/** Creates list of users with given input array POST /user/createWithArray */
59export async function createUsersWithArrayInput(
60 body: API.User[],
61 options?: { [key: string]: any },
62) {
63 return request<any>('/user/createWithArray', {
64 method: 'POST',
65 data: body,
66 ...(options || {}),
67 });
68}
69
70/** Creates list of users with given input array POST /user/createWithList */
71export async function createUsersWithListInput(body: API.User[], options?: { [key: string]: any }) {
72 return request<any>('/user/createWithList', {
73 method: 'POST',
74 data: body,
75 ...(options || {}),
76 });
77}
78
79/** Logs user into the system GET /user/login */
80export async function loginUser(
81 // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
82 params: API.loginUserParams,
83 options?: { [key: string]: any },
84) {
85 return request<string>('/user/login', {
86 method: 'GET',
87 params: {
88 ...params,
89 },
90 ...(options || {}),
91 });
92}
93
94/** Logs out current logged in user session GET /user/logout */
95export async function logoutUser(options?: { [key: string]: any }) {
96 return request<any>('/user/logout', {
97 method: 'GET',
98 ...(options || {}),
99 });
100}