86133 | aaa3f5d | 2025-04-20 21:33:29 +0800 | [diff] [blame] | 1 | // @ts-ignore |
| 2 | /* eslint-disable */ |
| 3 | import { request } from '@umijs/max'; |
| 4 | |
| 5 | /** Create user This can only be done by the logged in user. POST /user */ |
| 6 | export 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} */ |
| 15 | export 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} */ |
| 29 | export 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} */ |
| 45 | export 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 */ |
| 59 | export 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 */ |
| 71 | export 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 */ |
| 80 | export 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 */ |
| 95 | export async function logoutUser(options?: { [key: string]: any }) { |
| 96 | return request<any>('/user/logout', { |
| 97 | method: 'GET', |
| 98 | ...(options || {}), |
| 99 | }); |
| 100 | } |