Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Feb 23, 2024
1 parent 7a72594 commit c775fff
Show file tree
Hide file tree
Showing 14 changed files with 4,380 additions and 71 deletions.
31 changes: 22 additions & 9 deletions __test__/3.0/LDFCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2944,12 +2944,26 @@ export interface SwaggerApi {
* @summary 文件上传
* @tag File
*/
post(url: '/api/File/Upload', options?: SwaggerOptions<{}, {}, {}, FormData>): Promise<IResultModel>
post(url: '/api/File/Upload', options?: SwaggerOptions<{}, {}, {}, RuntimeFormData<{
module?: string | null
}
>>): Promise<IResultModel>
/**
* @summary 图片上传
* @tag File
*/
post(url: '/api/File/UploadPic', options?: SwaggerOptions<{}, {}, {}, FormData>): Promise<IResultModel>
post(url: '/api/File/UploadPic', options?: SwaggerOptions<{}, {}, {}, RuntimeFormData<{
module?: string | null
/**
* @format int32
*/
width?: number | null
/**
* @format int32
*/
height?: number | null
}
>>): Promise<IResultModel>
/**
* @summary 获取文件(返回byte[])
* @tag File
Expand All @@ -2965,7 +2979,10 @@ export interface SwaggerApi {
* @summary 删除文件
* @tag File
*/
post(url: '/api/File/Remove', options?: SwaggerOptions<{}, {}, {}, FormData>): Promise<IResultModel>
post(url: '/api/File/Remove', options?: SwaggerOptions<{}, {}, {}, RuntimeFormData<{
code?: string | null
}
>>): Promise<IResultModel>
/**
* @summary 列表
* @tag LoginLog
Expand Down Expand Up @@ -3302,10 +3319,6 @@ type IRequestInterceptorFn = (config: IRuntimeRequestOptions) => Promise<IRuntim
type IResponseInterceptorSuccessFn<T> = (config: IRuntimeRequestOptions, response: Response, data: T) => Promise<T>;
type IResponseInterceptorErrorFn<T> = (config: IRuntimeRequestOptions, Error: RuntimeError) => Promise<T>;

export interface IRuntimeForm {
[key: string]: any;
}

export class RequestInterceptor implements IRequestInterceptor {
private _fns: IRequestInterceptorFn[] = [];
public use(fn: IRequestInterceptorFn) {
Expand Down Expand Up @@ -3369,7 +3382,7 @@ export class ResponseInterceptor implements IResponseInterceptor {
}
}

export class RuntimeForm<T extends IRuntimeForm> {
export class RuntimeFormData<T extends Record<string, any>> {
constructor(private _form: T) {}
public formData(): FormData {
const form = new FormData();
Expand Down Expand Up @@ -3557,7 +3570,7 @@ export class Runtime implements IRuntime {
? undefined
: ["GET", "HEAD"].indexOf(config.method.toUpperCase()) > -1
? undefined
: config.body instanceof RuntimeForm
: config.body instanceof RuntimeFormData
? config.body.formData()
: config.body instanceof FormData
? config.body
Expand Down
8 changes: 2 additions & 6 deletions __test__/3.0/Petstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,6 @@ type IRequestInterceptorFn = (config: IRuntimeRequestOptions) => Promise<IRuntim
type IResponseInterceptorSuccessFn<T> = (config: IRuntimeRequestOptions, response: Response, data: T) => Promise<T>;
type IResponseInterceptorErrorFn<T> = (config: IRuntimeRequestOptions, Error: RuntimeError) => Promise<T>;

export interface IRuntimeForm {
[key: string]: any;
}

export class RequestInterceptor implements IRequestInterceptor {
private _fns: IRequestInterceptorFn[] = [];
public use(fn: IRequestInterceptorFn) {
Expand Down Expand Up @@ -339,7 +335,7 @@ export class ResponseInterceptor implements IResponseInterceptor {
}
}

export class RuntimeForm<T extends IRuntimeForm> {
export class RuntimeFormData<T extends Record<string, any>> {
constructor(private _form: T) {}
public formData(): FormData {
const form = new FormData();
Expand Down Expand Up @@ -527,7 +523,7 @@ export class Runtime implements IRuntime {
? undefined
: ["GET", "HEAD"].indexOf(config.method.toUpperCase()) > -1
? undefined
: config.body instanceof RuntimeForm
: config.body instanceof RuntimeFormData
? config.body.formData()
: config.body instanceof FormData
? config.body
Expand Down
8 changes: 2 additions & 6 deletions __test__/3.0/api-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ type IRequestInterceptorFn = (config: IRuntimeRequestOptions) => Promise<IRuntim
type IResponseInterceptorSuccessFn<T> = (config: IRuntimeRequestOptions, response: Response, data: T) => Promise<T>;
type IResponseInterceptorErrorFn<T> = (config: IRuntimeRequestOptions, Error: RuntimeError) => Promise<T>;

export interface IRuntimeForm {
[key: string]: any;
}

export class RequestInterceptor implements IRequestInterceptor {
private _fns: IRequestInterceptorFn[] = [];
public use(fn: IRequestInterceptorFn) {
Expand Down Expand Up @@ -215,7 +211,7 @@ export class ResponseInterceptor implements IResponseInterceptor {
}
}

export class RuntimeForm<T extends IRuntimeForm> {
export class RuntimeFormData<T extends Record<string, any>> {
constructor(private _form: T) {}
public formData(): FormData {
const form = new FormData();
Expand Down Expand Up @@ -403,7 +399,7 @@ export class Runtime implements IRuntime {
? undefined
: ["GET", "HEAD"].indexOf(config.method.toUpperCase()) > -1
? undefined
: config.body instanceof RuntimeForm
: config.body instanceof RuntimeFormData
? config.body.formData()
: config.body instanceof FormData
? config.body
Expand Down
8 changes: 2 additions & 6 deletions __test__/3.0/api-upms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,6 @@ type IRequestInterceptorFn = (config: IRuntimeRequestOptions) => Promise<IRuntim
type IResponseInterceptorSuccessFn<T> = (config: IRuntimeRequestOptions, response: Response, data: T) => Promise<T>;
type IResponseInterceptorErrorFn<T> = (config: IRuntimeRequestOptions, Error: RuntimeError) => Promise<T>;

export interface IRuntimeForm {
[key: string]: any;
}

export class RequestInterceptor implements IRequestInterceptor {
private _fns: IRequestInterceptorFn[] = [];
public use(fn: IRequestInterceptorFn) {
Expand Down Expand Up @@ -430,7 +426,7 @@ export class ResponseInterceptor implements IResponseInterceptor {
}
}

export class RuntimeForm<T extends IRuntimeForm> {
export class RuntimeFormData<T extends Record<string, any>> {
constructor(private _form: T) {}
public formData(): FormData {
const form = new FormData();
Expand Down Expand Up @@ -618,7 +614,7 @@ export class Runtime implements IRuntime {
? undefined
: ["GET", "HEAD"].indexOf(config.method.toUpperCase()) > -1
? undefined
: config.body instanceof RuntimeForm
: config.body instanceof RuntimeFormData
? config.body.formData()
: config.body instanceof FormData
? config.body
Expand Down
8 changes: 2 additions & 6 deletions __test__/3.0/api-with-examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ type IRequestInterceptorFn = (config: IRuntimeRequestOptions) => Promise<IRuntim
type IResponseInterceptorSuccessFn<T> = (config: IRuntimeRequestOptions, response: Response, data: T) => Promise<T>;
type IResponseInterceptorErrorFn<T> = (config: IRuntimeRequestOptions, Error: RuntimeError) => Promise<T>;

export interface IRuntimeForm {
[key: string]: any;
}

export class RequestInterceptor implements IRequestInterceptor {
private _fns: IRequestInterceptorFn[] = [];
public use(fn: IRequestInterceptorFn) {
Expand Down Expand Up @@ -136,7 +132,7 @@ export class ResponseInterceptor implements IResponseInterceptor {
}
}

export class RuntimeForm<T extends IRuntimeForm> {
export class RuntimeFormData<T extends Record<string, any>> {
constructor(private _form: T) {}
public formData(): FormData {
const form = new FormData();
Expand Down Expand Up @@ -324,7 +320,7 @@ export class Runtime implements IRuntime {
? undefined
: ["GET", "HEAD"].indexOf(config.method.toUpperCase()) > -1
? undefined
: config.body instanceof RuntimeForm
: config.body instanceof RuntimeFormData
? config.body.formData()
: config.body instanceof FormData
? config.body
Expand Down
8 changes: 2 additions & 6 deletions __test__/3.0/callback-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ type IRequestInterceptorFn = (config: IRuntimeRequestOptions) => Promise<IRuntim
type IResponseInterceptorSuccessFn<T> = (config: IRuntimeRequestOptions, response: Response, data: T) => Promise<T>;
type IResponseInterceptorErrorFn<T> = (config: IRuntimeRequestOptions, Error: RuntimeError) => Promise<T>;

export interface IRuntimeForm {
[key: string]: any;
}

export class RequestInterceptor implements IRequestInterceptor {
private _fns: IRequestInterceptorFn[] = [];
public use(fn: IRequestInterceptorFn) {
Expand Down Expand Up @@ -132,7 +128,7 @@ export class ResponseInterceptor implements IResponseInterceptor {
}
}

export class RuntimeForm<T extends IRuntimeForm> {
export class RuntimeFormData<T extends Record<string, any>> {
constructor(private _form: T) {}
public formData(): FormData {
const form = new FormData();
Expand Down Expand Up @@ -320,7 +316,7 @@ export class Runtime implements IRuntime {
? undefined
: ["GET", "HEAD"].indexOf(config.method.toUpperCase()) > -1
? undefined
: config.body instanceof RuntimeForm
: config.body instanceof RuntimeFormData
? config.body.formData()
: config.body instanceof FormData
? config.body
Expand Down
8 changes: 2 additions & 6 deletions __test__/3.0/link-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ type IRequestInterceptorFn = (config: IRuntimeRequestOptions) => Promise<IRuntim
type IResponseInterceptorSuccessFn<T> = (config: IRuntimeRequestOptions, response: Response, data: T) => Promise<T>;
type IResponseInterceptorErrorFn<T> = (config: IRuntimeRequestOptions, Error: RuntimeError) => Promise<T>;

export interface IRuntimeForm {
[key: string]: any;
}

export class RequestInterceptor implements IRequestInterceptor {
private _fns: IRequestInterceptorFn[] = [];
public use(fn: IRequestInterceptorFn) {
Expand Down Expand Up @@ -153,7 +149,7 @@ export class ResponseInterceptor implements IResponseInterceptor {
}
}

export class RuntimeForm<T extends IRuntimeForm> {
export class RuntimeFormData<T extends Record<string, any>> {
constructor(private _form: T) {}
public formData(): FormData {
const form = new FormData();
Expand Down Expand Up @@ -341,7 +337,7 @@ export class Runtime implements IRuntime {
? undefined
: ["GET", "HEAD"].indexOf(config.method.toUpperCase()) > -1
? undefined
: config.body instanceof RuntimeForm
: config.body instanceof RuntimeFormData
? config.body.formData()
: config.body instanceof FormData
? config.body
Expand Down
8 changes: 2 additions & 6 deletions __test__/3.0/petstore-expanded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ type IRequestInterceptorFn = (config: IRuntimeRequestOptions) => Promise<IRuntim
type IResponseInterceptorSuccessFn<T> = (config: IRuntimeRequestOptions, response: Response, data: T) => Promise<T>;
type IResponseInterceptorErrorFn<T> = (config: IRuntimeRequestOptions, Error: RuntimeError) => Promise<T>;

export interface IRuntimeForm {
[key: string]: any;
}

export class RequestInterceptor implements IRequestInterceptor {
private _fns: IRequestInterceptorFn[] = [];
public use(fn: IRequestInterceptorFn) {
Expand Down Expand Up @@ -163,7 +159,7 @@ export class ResponseInterceptor implements IResponseInterceptor {
}
}

export class RuntimeForm<T extends IRuntimeForm> {
export class RuntimeFormData<T extends Record<string, any>> {
constructor(private _form: T) {}
public formData(): FormData {
const form = new FormData();
Expand Down Expand Up @@ -351,7 +347,7 @@ export class Runtime implements IRuntime {
? undefined
: ["GET", "HEAD"].indexOf(config.method.toUpperCase()) > -1
? undefined
: config.body instanceof RuntimeForm
: config.body instanceof RuntimeFormData
? config.body.formData()
: config.body instanceof FormData
? config.body
Expand Down

0 comments on commit c775fff

Please sign in to comment.