-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yangqianjun
committed
May 6, 2021
1 parent
5e61140
commit f67af6e
Showing
16 changed files
with
289 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "auto-service", | ||
"version": "3.5.2", | ||
"version": "3.5.3", | ||
"description": "auto generate swagger or yapi mock to typescript services and models", | ||
"repository": "[email protected]:gogoyqj/auto-service.git", | ||
"author": "杨乾军 <yang@yang>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{{>licenseInfo}} | ||
import { ExtraFetchParams } from '@ajax'; | ||
{{^models.isEmpty}} | ||
import * as models from '../model/models'; | ||
{{/models.isEmpty}} | ||
|
||
/* tslint:disable:no-unused-variable member-ordering object-literal-shorthand */ | ||
|
||
{{#operations}} | ||
{{#description}} | ||
/** @description {{&description}} */ | ||
{{/description}} | ||
|
||
declare global { | ||
interface AutosAPIS { | ||
{{#operation}} | ||
{{#description}}/** {{&description}} */{{/description}} | ||
'{{httpMethod}} {{{contextPath}}}{{{path}}}': [[ | ||
{ | ||
opt?: {{^headerParams.0}}ExtraFetchParams{{/headerParams.0}}{{#headerParams.0}}{ headers: ParamsHeader{{nickname}} } & Omit<ExtraFetchParams, 'headers'> {{/headerParams.0}} | ||
{{#queryParams.0}} | ||
query: { | ||
{{#queryParams}} | ||
'{{paramName}}'{{^required}}?{{/required}}: {{&dataType}}; | ||
{{/queryParams}} | ||
}; | ||
{{/queryParams.0}} | ||
{{#pathParams.0}} | ||
path: { | ||
{{#pathParams}} | ||
'{{paramName}}'{{^required}}?{{/required}}: {{&dataType}}; | ||
{{/pathParams}} | ||
}; | ||
{{/pathParams.0}} | ||
{{#formParams.0}} | ||
{{#isFile}} | ||
form: { | ||
{{#formParams}} | ||
'{{baseName}}'{{^required}}?{{/required}}: {{&dataType}}; | ||
{{/formParams}} | ||
}; | ||
isFile: true; | ||
{{/isFile}} | ||
{{^isFile}} | ||
form: { | ||
{{#formParams}} | ||
'{{paramName}}'{{^required}}?{{/required}}: {{&dataType}}; | ||
{{/formParams}} | ||
}; | ||
{{/isFile}} | ||
{{/formParams.0}} | ||
{{#bodyParam.0}} | ||
data: { | ||
{{#bodyParam}} | ||
'{{paramName}}'{{^required}}?{{/required}}: {{&dataType}}; | ||
{{/bodyParam}} | ||
}; | ||
{{/bodyParam.0}} | ||
}], {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}]; | ||
{{/operation}} | ||
} | ||
} | ||
{{/operations}} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
wwwroot/*.js | ||
node_modules | ||
typings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './api/api'; | ||
export * from './model/models'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* {{{appName}}} | ||
* {{{appDescription}}} | ||
* | ||
* {{#version}}OpenAPI spec version: {{{version}}}{{/version}} | ||
* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} | ||
* | ||
* NOTE: This class is auto generated by the swagger code generator program. | ||
* https://github.com/swagger-api/swagger-codegen.git | ||
* Do not edit the class manually. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{{>licenseInfo}} | ||
import * as models from './models'; | ||
|
||
{{#models}} | ||
{{#model}} | ||
/** | ||
{{#description}} | ||
* @description {{&description}} | ||
{{/description}} | ||
{{#vars}} | ||
* @property `{{^required}}[{{/required}}{{name}}{{^required}}]{{/required}}` {{&description}} | ||
{{/vars}} | ||
*/ | ||
export interface {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{ | ||
{{#vars}} | ||
{{#description}} | ||
/** | ||
* {{&description}} | ||
*/ | ||
{{/description}} | ||
"{{name}}"{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; | ||
{{/vars}} | ||
} | ||
|
||
{{#hasEnums}} | ||
export namespace {{classname}} { | ||
{{#vars}} | ||
{{#isEnum}} | ||
export enum {{enumName}} { | ||
{{#allowableValues}} | ||
{{#enumVars}} | ||
{{#description}} | ||
/** | ||
* `{{name}}` {{&description}} | ||
*/ | ||
{{/description}} | ||
{{{name}}} = {{{value}}} as any{{^-last}},{{/-last}} | ||
{{/enumVars}} | ||
{{/allowableValues}} | ||
} | ||
{{/isEnum}} | ||
{{/vars}} | ||
} | ||
{{/hasEnums}} | ||
{{/model}} | ||
{{/models}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{#models}} | ||
{{#model}} | ||
export * from './{{{ classFilename }}}'; | ||
{{/model}} | ||
{{/models}} | ||
export type ModelInteger = number; | ||
export type ModelFloat = number; | ||
export type LocalDate = Date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{{#operations}} | ||
{{#operation}} | ||
{{#allParams.0}} | ||
{{^hasOnlyBodyParams}} | ||
{{#headerParams.0}} | ||
/**{{#headerParams}} | ||
* @description {{nickname}} headers 参数 | ||
* @property `{{^required}}[{{/required}}{{baseName}}{{^required}}]{{/required}}` {{&description}} | ||
{{/headerParams}}*/ | ||
export interface ParamsHeader{{nickname}} { | ||
{{#headerParams}} | ||
{{#description}} | ||
/** {{&description}} */ | ||
{{/description}} | ||
'{{baseName}}'{{^required}}?{{/required}}: {{&dataType}}; | ||
{{/headerParams}} | ||
} | ||
{{/headerParams.0}} | ||
/** | ||
{{#description}} | ||
* @description {{nickname}}参数 | ||
{{/description}} | ||
{{#pathParams.0}} | ||
{{#pathParams}} | ||
* @property `{{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}}` {{&description}} | ||
{{/pathParams}} | ||
{{/pathParams.0}} | ||
{{#queryParams.0}} | ||
{{#queryParams}} | ||
* @property `{{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}}` {{&description}} | ||
{{/queryParams}} | ||
{{/queryParams.0}} | ||
{{#formParams.0}} | ||
{{#formParams}} | ||
* @property `{{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}}` {{&description}} | ||
{{/formParams}} | ||
{{/formParams.0}} | ||
*/ | ||
export interface Params{{nickname}} { | ||
{{#pathParams.0}} | ||
// pathParams | ||
{{#pathParams}} | ||
{{#description}} | ||
/** | ||
* {{&description}} | ||
*/ | ||
{{/description}} | ||
{{paramName}}{{^required}}?{{/required}}: {{&dataType}}; | ||
{{/pathParams}} | ||
{{/pathParams.0}} | ||
{{#queryParams.0}} | ||
// queryParams | ||
{{#queryParams}} | ||
{{#description}} | ||
/** | ||
* {{&description}} | ||
*/ | ||
{{/description}} | ||
{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}; | ||
{{/queryParams}} | ||
{{/queryParams.0}} | ||
{{#formParams.0}} | ||
// formParams | ||
{{#formParams}} | ||
{{#description}} | ||
/** | ||
* {{&description}} | ||
*/ | ||
{{/description}} | ||
{{paramName}}{{^required}}?{{/required}}: {{&dataType}}; | ||
{{/formParams}} | ||
{{/formParams.0}} | ||
} | ||
{{/hasOnlyBodyParams}} | ||
{{#bodyParam}} | ||
/** | ||
{{#description}} | ||
* {{&description}} | ||
{{/description}} | ||
*/ | ||
export type ParamsBody{{nickname}} = {{&dataType}}; | ||
{{/bodyParam}} | ||
{{/allParams.0}} | ||
{{/operation}} | ||
{{/operations}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.