Revert "Merge branch 'openapi'"
This reverts commit9a6f0acdf0, reversing changes made to08a81e433b.
This commit is contained in:
13
src/service/displayEnumLabel.ts
Normal file
13
src/service/displayEnumLabel.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import * as API from './types';
|
||||
|
||||
export function displayStatusEnum(field: API.StatusEnum) {
|
||||
return { available: 'available', pending: 'pending', sold: 'sold' }[field];
|
||||
}
|
||||
|
||||
export function displayStatusEnum2(field: API.StatusEnum2) {
|
||||
return { placed: 'placed', approved: 'approved', delivered: 'delivered' }[
|
||||
field
|
||||
];
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
export * from './types';
|
||||
export * from './displayEnumLabel';
|
||||
|
||||
export * from './listAll';
|
||||
export * from './info';
|
||||
export * from './pet';
|
||||
export * from './store';
|
||||
export * from './user';
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '@/http/vue-query';
|
||||
import { CustomRequestOptions } from '@/http/types';
|
||||
|
||||
import * as API from './types';
|
||||
|
||||
/** 用户信息 GET /user/info */
|
||||
export async function infoUsingGet({
|
||||
options,
|
||||
}: {
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<API.UserItem>('/user/info', {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '@/http/vue-query';
|
||||
import { CustomRequestOptions } from '@/http/types';
|
||||
|
||||
import * as API from './types';
|
||||
|
||||
/** 用户列表 GET /user/listAll */
|
||||
export async function listAllUsingGet({
|
||||
options,
|
||||
}: {
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<API.UserItem[]>('/user/listAll', {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
185
src/service/pet.ts
Normal file
185
src/service/pet.ts
Normal file
@@ -0,0 +1,185 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '@/http/vue-query';
|
||||
import { CustomRequestOptions } from '@/http/types';
|
||||
|
||||
import * as API from './types';
|
||||
|
||||
/** Update an existing pet PUT /pet */
|
||||
export async function petUsingPut({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.Pet;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<unknown>('/pet', {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Add a new pet to the store POST /pet */
|
||||
export async function petUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.Pet;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<unknown>('/pet', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Find pet by ID Returns a single pet GET /pet/${param0} */
|
||||
export async function petPetIdUsingGet({
|
||||
params,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.PetPetIdUsingGetParams;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
const { petId: param0, ...queryParams } = params;
|
||||
|
||||
return request<API.Pet>(`/pet/${param0}`, {
|
||||
method: 'GET',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Updates a pet in the store with form data POST /pet/${param0} */
|
||||
export async function petPetIdUsingPost({
|
||||
params,
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.PetPetIdUsingPostParams;
|
||||
body: API.PetPetIdUsingPostBody;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
const { petId: param0, ...queryParams } = params;
|
||||
|
||||
return request<unknown>(`/pet/${param0}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
params: { ...queryParams },
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Deletes a pet DELETE /pet/${param0} */
|
||||
export async function petPetIdUsingDelete({
|
||||
params,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.PetPetIdUsingDeleteParams;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
const { petId: param0, ...queryParams } = params;
|
||||
|
||||
return request<unknown>(`/pet/${param0}`, {
|
||||
method: 'DELETE',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** uploads an image POST /pet/${param0}/uploadImage */
|
||||
export async function petPetIdUploadImageUsingPost({
|
||||
params,
|
||||
body,
|
||||
file,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.PetPetIdUploadImageUsingPostParams;
|
||||
body: API.PetPetIdUploadImageUsingPostBody;
|
||||
file?: File;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
const { petId: param0, ...queryParams } = params;
|
||||
const formData = new FormData();
|
||||
|
||||
if (file) {
|
||||
formData.append('file', file);
|
||||
}
|
||||
|
||||
Object.keys(body).forEach((ele) => {
|
||||
const item = (body as { [key: string]: any })[ele];
|
||||
|
||||
if (item !== undefined && item !== null) {
|
||||
if (typeof item === 'object' && !(item instanceof File)) {
|
||||
if (item instanceof Array) {
|
||||
item.forEach((f) => formData.append(ele, f || ''));
|
||||
} else {
|
||||
formData.append(ele, JSON.stringify(item));
|
||||
}
|
||||
} else {
|
||||
formData.append(ele, item);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return request<API.ApiResponse>(`/pet/${param0}/uploadImage`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
params: { ...queryParams },
|
||||
data: formData,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */
|
||||
export async function petFindByStatusUsingGet({
|
||||
params,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.PetFindByStatusUsingGetParams;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<API.Pet[]>('/pet/findByStatus', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */
|
||||
export async function petFindByTagsUsingGet({
|
||||
params,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.PetFindByTagsUsingGetParams;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<API.Pet[]>('/pet/findByTags', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
72
src/service/store.ts
Normal file
72
src/service/store.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '@/http/vue-query';
|
||||
import { CustomRequestOptions } from '@/http/types';
|
||||
|
||||
import * as API from './types';
|
||||
|
||||
/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */
|
||||
export async function storeInventoryUsingGet({
|
||||
options,
|
||||
}: {
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<Record<string, number>>('/store/inventory', {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Place an order for a pet POST /store/order */
|
||||
export async function storeOrderUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.Order;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<API.Order>('/store/order', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Find purchase order by ID For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions GET /store/order/${param0} */
|
||||
export async function storeOrderOrderIdUsingGet({
|
||||
params,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.StoreOrderOrderIdUsingGetParams;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
const { orderId: param0, ...queryParams } = params;
|
||||
|
||||
return request<API.Order>(`/store/order/${param0}`, {
|
||||
method: 'GET',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Delete purchase order by ID For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors DELETE /store/order/${param0} */
|
||||
export async function storeOrderOrderIdUsingDelete({
|
||||
params,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.StoreOrderOrderIdUsingDeleteParams;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
const { orderId: param0, ...queryParams } = params;
|
||||
|
||||
return request<unknown>(`/store/order/${param0}`, {
|
||||
method: 'DELETE',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@@ -1,29 +1,350 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
|
||||
export type InfoUsingGetResponse = {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: UserItem;
|
||||
export type ApiResponse = {
|
||||
code?: number;
|
||||
type?: string;
|
||||
message?: string;
|
||||
};
|
||||
|
||||
export type InfoUsingGetResponses = {
|
||||
200: InfoUsingGetResponse;
|
||||
export type Category = {
|
||||
id?: number;
|
||||
name?: string;
|
||||
};
|
||||
|
||||
export type ListAllUsingGetResponse = {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: UserItem[];
|
||||
export type Order = {
|
||||
id?: number;
|
||||
petId?: number;
|
||||
quantity?: number;
|
||||
shipDate?: string;
|
||||
/** Order Status */
|
||||
status?: 'placed' | 'approved' | 'delivered';
|
||||
complete?: boolean;
|
||||
};
|
||||
|
||||
export type ListAllUsingGetResponses = {
|
||||
200: ListAllUsingGetResponse;
|
||||
export type Pet = {
|
||||
id?: number;
|
||||
category?: Category;
|
||||
name: string;
|
||||
photoUrls: string[];
|
||||
tags?: Tag[];
|
||||
/** pet status in the store */
|
||||
status?: 'available' | 'pending' | 'sold';
|
||||
};
|
||||
|
||||
export type UserItem = {
|
||||
userId: number;
|
||||
export type PetFindByStatusUsingGetParams = {
|
||||
/** Status values that need to be considered for filter */
|
||||
status: ('available' | 'pending' | 'sold')[];
|
||||
};
|
||||
|
||||
export type PetFindByStatusUsingGetResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
200: Pet[];
|
||||
/**
|
||||
* Invalid status value
|
||||
*/
|
||||
400: unknown;
|
||||
};
|
||||
|
||||
export type PetFindByTagsUsingGetParams = {
|
||||
/** Tags to filter by */
|
||||
tags: string[];
|
||||
};
|
||||
|
||||
export type PetFindByTagsUsingGetResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
200: Pet[];
|
||||
/**
|
||||
* Invalid tag value
|
||||
*/
|
||||
400: unknown;
|
||||
};
|
||||
|
||||
export type PetPetIdUploadImageUsingPostBody = {
|
||||
/** Additional data to pass to server */
|
||||
additionalMetadata?: string;
|
||||
/** file to upload */
|
||||
file?: string;
|
||||
};
|
||||
|
||||
export type PetPetIdUploadImageUsingPostParams = {
|
||||
/** ID of pet to update */
|
||||
petId: number;
|
||||
};
|
||||
|
||||
export type PetPetIdUploadImageUsingPostResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
200: ApiResponse;
|
||||
};
|
||||
|
||||
export type PetPetIdUsingDeleteParams = {
|
||||
/** Pet id to delete */
|
||||
petId: number;
|
||||
};
|
||||
|
||||
export type PetPetIdUsingDeleteResponses = {
|
||||
/**
|
||||
* Invalid ID supplied
|
||||
*/
|
||||
400: unknown;
|
||||
/**
|
||||
* Pet not found
|
||||
*/
|
||||
404: unknown;
|
||||
};
|
||||
|
||||
export type PetPetIdUsingGetParams = {
|
||||
/** ID of pet to return */
|
||||
petId: number;
|
||||
};
|
||||
|
||||
export type PetPetIdUsingGetResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
200: Pet;
|
||||
/**
|
||||
* Invalid ID supplied
|
||||
*/
|
||||
400: unknown;
|
||||
/**
|
||||
* Pet not found
|
||||
*/
|
||||
404: unknown;
|
||||
};
|
||||
|
||||
export type PetPetIdUsingPostBody = {
|
||||
/** Updated name of the pet */
|
||||
name?: string;
|
||||
/** Updated status of the pet */
|
||||
status?: string;
|
||||
};
|
||||
|
||||
export type PetPetIdUsingPostParams = {
|
||||
/** ID of pet that needs to be updated */
|
||||
petId: number;
|
||||
};
|
||||
|
||||
export type PetPetIdUsingPostResponses = {
|
||||
/**
|
||||
* Invalid input
|
||||
*/
|
||||
405: unknown;
|
||||
};
|
||||
|
||||
export type PetUsingPostResponses = {
|
||||
/**
|
||||
* Invalid input
|
||||
*/
|
||||
405: unknown;
|
||||
};
|
||||
|
||||
export type PetUsingPutResponses = {
|
||||
/**
|
||||
* Invalid ID supplied
|
||||
*/
|
||||
400: unknown;
|
||||
/**
|
||||
* Pet not found
|
||||
*/
|
||||
404: unknown;
|
||||
/**
|
||||
* Validation exception
|
||||
*/
|
||||
405: unknown;
|
||||
};
|
||||
|
||||
export enum StatusEnum {
|
||||
'available' = 'available',
|
||||
'pending' = 'pending',
|
||||
'sold' = 'sold',
|
||||
}
|
||||
|
||||
export type IStatusEnum = keyof typeof StatusEnum;
|
||||
|
||||
export enum StatusEnum2 {
|
||||
'placed' = 'placed',
|
||||
'approved' = 'approved',
|
||||
'delivered' = 'delivered',
|
||||
}
|
||||
|
||||
export type IStatusEnum2 = keyof typeof StatusEnum2;
|
||||
|
||||
export type StoreInventoryUsingGetResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
200: Record<string, number>;
|
||||
};
|
||||
|
||||
export type StoreOrderOrderIdUsingDeleteParams = {
|
||||
/** ID of the order that needs to be deleted */
|
||||
orderId: number;
|
||||
};
|
||||
|
||||
export type StoreOrderOrderIdUsingDeleteResponses = {
|
||||
/**
|
||||
* Invalid ID supplied
|
||||
*/
|
||||
400: unknown;
|
||||
/**
|
||||
* Order not found
|
||||
*/
|
||||
404: unknown;
|
||||
};
|
||||
|
||||
export type StoreOrderOrderIdUsingGetParams = {
|
||||
/** ID of pet that needs to be fetched */
|
||||
orderId: number;
|
||||
};
|
||||
|
||||
export type StoreOrderOrderIdUsingGetResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
200: Order;
|
||||
/**
|
||||
* Invalid ID supplied
|
||||
*/
|
||||
400: unknown;
|
||||
/**
|
||||
* Order not found
|
||||
*/
|
||||
404: unknown;
|
||||
};
|
||||
|
||||
export type StoreOrderUsingPostResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
200: Order;
|
||||
/**
|
||||
* Invalid Order
|
||||
*/
|
||||
400: unknown;
|
||||
};
|
||||
|
||||
export type Tag = {
|
||||
id?: number;
|
||||
name?: string;
|
||||
};
|
||||
|
||||
export type User = {
|
||||
id?: number;
|
||||
username?: string;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
email?: string;
|
||||
password?: string;
|
||||
phone?: string;
|
||||
/** User Status */
|
||||
userStatus?: number;
|
||||
};
|
||||
|
||||
export type UserCreateWithArrayUsingPostBody = User[];
|
||||
|
||||
export type UserCreateWithArrayUsingPostResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
default: unknown;
|
||||
};
|
||||
|
||||
export type UserCreateWithListUsingPostBody = User[];
|
||||
|
||||
export type UserCreateWithListUsingPostResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
default: unknown;
|
||||
};
|
||||
|
||||
export type UserLoginUsingGetParams = {
|
||||
/** The user name for login */
|
||||
username: string;
|
||||
nickname: string;
|
||||
avatar: string;
|
||||
/** The password for login in clear text */
|
||||
password: string;
|
||||
};
|
||||
|
||||
export type UserLoginUsingGetResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
200: string;
|
||||
/**
|
||||
* Invalid username/password supplied
|
||||
*/
|
||||
400: unknown;
|
||||
};
|
||||
|
||||
export type UserLogoutUsingGetResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
default: unknown;
|
||||
};
|
||||
|
||||
export type UserUsernameUsingDeleteParams = {
|
||||
/** The name that needs to be deleted */
|
||||
username: string;
|
||||
};
|
||||
|
||||
export type UserUsernameUsingDeleteResponses = {
|
||||
/**
|
||||
* Invalid username supplied
|
||||
*/
|
||||
400: unknown;
|
||||
/**
|
||||
* User not found
|
||||
*/
|
||||
404: unknown;
|
||||
};
|
||||
|
||||
export type UserUsernameUsingGetParams = {
|
||||
/** The name that needs to be fetched. Use user1 for testing. */
|
||||
username: string;
|
||||
};
|
||||
|
||||
export type UserUsernameUsingGetResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
200: User;
|
||||
/**
|
||||
* Invalid username supplied
|
||||
*/
|
||||
400: unknown;
|
||||
/**
|
||||
* User not found
|
||||
*/
|
||||
404: unknown;
|
||||
};
|
||||
|
||||
export type UserUsernameUsingPutParams = {
|
||||
/** name that need to be updated */
|
||||
username: string;
|
||||
};
|
||||
|
||||
export type UserUsernameUsingPutResponses = {
|
||||
/**
|
||||
* Invalid user supplied
|
||||
*/
|
||||
400: unknown;
|
||||
/**
|
||||
* User not found
|
||||
*/
|
||||
404: unknown;
|
||||
};
|
||||
|
||||
export type UserUsingPostResponses = {
|
||||
/**
|
||||
* successful operation
|
||||
*/
|
||||
default: unknown;
|
||||
};
|
||||
|
||||
150
src/service/user.ts
Normal file
150
src/service/user.ts
Normal file
@@ -0,0 +1,150 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '@/http/vue-query';
|
||||
import { CustomRequestOptions } from '@/http/types';
|
||||
|
||||
import * as API from './types';
|
||||
|
||||
/** Create user This can only be done by the logged in user. 返回值: successful operation POST /user */
|
||||
export async function userUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.User;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<unknown>('/user', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Get user by user name GET /user/${param0} */
|
||||
export async function userUsernameUsingGet({
|
||||
params,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.UserUsernameUsingGetParams;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
const { username: param0, ...queryParams } = params;
|
||||
|
||||
return request<API.User>(`/user/${param0}`, {
|
||||
method: 'GET',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Updated user This can only be done by the logged in user. PUT /user/${param0} */
|
||||
export async function userUsernameUsingPut({
|
||||
params,
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.UserUsernameUsingPutParams;
|
||||
body: API.User;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
const { username: param0, ...queryParams } = params;
|
||||
|
||||
return request<unknown>(`/user/${param0}`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
params: { ...queryParams },
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */
|
||||
export async function userUsernameUsingDelete({
|
||||
params,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.UserUsernameUsingDeleteParams;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
const { username: param0, ...queryParams } = params;
|
||||
|
||||
return request<unknown>(`/user/${param0}`, {
|
||||
method: 'DELETE',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Creates list of users with given input array 返回值: successful operation POST /user/createWithArray */
|
||||
export async function userCreateWithArrayUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.UserCreateWithArrayUsingPostBody;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<unknown>('/user/createWithArray', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Creates list of users with given input array 返回值: successful operation POST /user/createWithList */
|
||||
export async function userCreateWithListUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.UserCreateWithListUsingPostBody;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<unknown>('/user/createWithList', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Logs user into the system GET /user/login */
|
||||
export async function userLoginUsingGet({
|
||||
params,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.UserLoginUsingGetParams;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<string>('/user/login', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Logs out current logged in user session 返回值: successful operation GET /user/logout */
|
||||
export async function userLogoutUsingGet({
|
||||
options,
|
||||
}: {
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<unknown>('/user/logout', {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user