-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from long-woo/dev
v2.1.0
- Loading branch information
Showing
16 changed files
with
46 additions
and
54 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
enum <%= it.name %> { | ||
<%= it.data.map(it.convertValue).join(",\n\t")%> | ||
|
||
} |
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,4 +1,4 @@ | ||
|
||
|
||
// this file is auto generated. | ||
export default {"actionImport":"import '<%= it.importPath%>shared/api_client_base.dart';\nimport 'shared/dio/index.dart';\n<% if (it.imports.length) { %>\nimport '<%= it.importPath %><%= it.typeFileName %>.dart';\n<% } %>","actionMethod":"<% /* API 方法注释 */ %>\n<% if (it.summary) { %>\n/// <%~ it.summary %>\n<% } %>\n<% if (it.summary !== it.description) { %>\n<% if (it.summary && it.description) { %>\n\n///\n<% } %>\n<% if (it.description) { %>\n/// <%~ it.description %>\n<% } %>\n<% } %>\n\n<% /* API 方法 */ %>\nFuture<<%~ it.responseType %>> <%= it.methodName %>(<% it.params.forEach((param, index) => { %>\n<%~ param.type %><% if(!param.required) { %>?<% } %> <%= param.name %><% if (index < it.params.length - 1) { %>, <% } %>\n<% }) %>) async {\n var _res = await request<<%~ it.responseType %>>(\n ApiClientConfig(\n url: '<%= it.url %>',\n method: '<%= it.method %>'<% if (it.params.length) { %>,\n params: {\n<% it.params.forEach((param, index) => { %>\n '<%= param.category %>': <% if (param.category === param.name) { %><%= param.name %><% } else { %>{'<%= param.name %>' : <%= param.name %>}<% } %><% if (index < it.params.length - 1) { %>, <% } %>\n\n<% }) %>\n }\n<% } %>\n )<% if (it.responseType.includes('List<')) { %>, (json) => [<%~ it.responseName %>.fromJson(json)]<% } else if (it.responseName) { %>, <%~ it.responseName %>.fromJson<% } %>);\n\n return _res;\n}\n","definitionBody":"<% if (it.propCommit) { %>\n /// <%~ it.propCommit %>\n\n<% } %>\n <%~ it.propType %><% if (!it.prop.required) { %>?<% } %> <%= it.prop.name %>;","definitionFooter":" <%= it.defName %>({\n<% it.props.forEach((prop, index) => { %>\n <% if (prop.required) { %>required <% } %>this.<%= prop.name %><% if (index < it.props.length - 1) { %>,<% } %>\n\n<% }) %>\n });\n\n factory <%= it.defName %>.fromJson(Map<String, dynamic> json) {\n return <%= it.defName %>(\n<% it.props.forEach((prop, index) => { %>\n <%= prop.name %>: json['<%= prop.name %>']<% if (index < it.props.length - 1) { %>,<% } %>\n\n<% }) %>\n );\n }\n\n Map<String, dynamic> toJson() {\n final Map<String, dynamic> data = <String, dynamic>{};\n\n<% it.props.forEach((prop) => { %>\n data['<%= prop.name %>'] = <%= prop.name %>;\n<% }) %>\n\n return data;\n }\n}\n","definitionHeader":"class <%= it.defName %> {"} | ||
export default {"actionImport":"import '<%= it.importPath%>shared/api_client_base.dart';\nimport 'shared/dio/index.dart';\n<% if (it.imports.length) { %>\nimport '<%= it.importPath %><%= it.typeFileName %>.dart';\n<% } %>","actionMethod":"<% /* API 方法注释 */ %>\n<% if (it.summary) { %>\n/// <%~ it.summary %>\n<% } %>\n<% if (it.summary !== it.description) { %>\n<% if (it.summary && it.description) { %>\n\n///\n<% } %>\n<% if (it.description) { %>\n/// <%~ it.description %>\n<% } %>\n<% } %>\n\n<% /* API 方法 */ %>\nFuture<<%~ it.responseType %>> <%= it.methodName %>(<% it.params.forEach((param, index) => { %>\n<%~ param.type %><% if(!param.required) { %>?<% } %> <%= param.name %><% if (index < it.params.length - 1) { %>, <% } %>\n<% }) %>) async {\n var _res = await request<<%~ it.responseType %>>(\n ApiClientConfig(\n url: '<%= it.url %>',\n method: '<%= it.method %>'<% if (it.params.length) { %>,\n params: {\n<% it.params.forEach((param, index) => { %>\n '<%= param.category %>': <% if (param.category === param.name) { %><%= param.name %><% } else { %>{'<%= param.name %>' : <%= param.name %>}<% } %><% if (index < it.params.length - 1) { %>, <% } %>\n\n<% }) %>\n }\n<% } %>\n )<% if (it.responseType.includes('List<')) { %>, (json) => [<%~ it.responseName %>.fromJson(json)]<% } else if (it.responseName) { %>, <%~ it.responseName %>.fromJson<% } %>);\n\n return _res;\n}\n","definitionBody":"<% if (it.propCommit) { %>\n /// <%~ it.propCommit %>\n\n<% } %>\n <%~ it.propType %><% if (!it.prop.required) { %>?<% } %> <%= it.prop.name %>;","definitionFooter":" <%= it.defName %>({\n<% it.props.forEach((prop, index) => { %>\n <% if (prop.required) { %>required <% } %>this.<%= prop.name %><% if (index < it.props.length - 1) { %>,<% } %>\n\n<% }) %>\n });\n\n factory <%= it.defName %>.fromJson(Map<String, dynamic> json) {\n return <%= it.defName %>(\n<% it.props.forEach((prop, index) => { %>\n <%= prop.name %>: json['<%= prop.name %>']<% if (index < it.props.length - 1) { %>,<% } %>\n\n<% }) %>\n );\n }\n\n Map<String, dynamic> toJson() {\n final Map<String, dynamic> data = <String, dynamic>{};\n\n<% it.props.forEach((prop) => { %>\n data['<%= prop.name %>'] = <%= prop.name %>;\n<% }) %>\n\n return data;\n }\n}\n","definitionHeader":"class <%= it.defName %> {","enum":"enum <%= it.name %> {\n <%= it.data.map(it.convertValue).join(\",\\n\\t\")%>\n \n}"} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type <%= it.name %> = '<%~ it.data.map(it.convertValue).join("' | '") %>'; |
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,4 +1,4 @@ | ||
|
||
|
||
// this file is auto generated. | ||
export default {"actionImport":"import { fetchRuntime } from '<%= it.importPath %>shared/fetchRuntime'\n<% if (it.imports.length) { %>\nimport type { <%= it.imports.join(', ') %> } from '<%= it.importPath %><%= it.typeFileName %>'\n<% } %>","actionMethod":"<% /* API 方法注释 */ %>\n/**\n<% if (it.summary) { %>\n * <%~ it.summary %>\n<% } %>\n<% if (it.summary !== it.description) { %>\n<% if (it.summary && it.description) { %>\n\n *\n<% } %>\n<% if (it.description) { %>\n * @description <%~ it.description %>\n<% } %>\n<% } %>\n<% if (it.params.length) { %>\n\n *\n<% it.params.forEach(param => { %>\n * @param {<%~ param.type %>} <% if (!param.required) { %>[<% } %><%= param.name %><% if (!param.required) { %>]<% } %> - <%~ param.description || param.type %>\n\n<% }) %>\n<% } %>\n * @returns {Promise<<%~ it.responseType %>>} Promise<<%~ it.responseType %>>\n */\n<% /* API 方法 */ %>\nexport const <%= it.methodName %> = (<% it.params.forEach((param, index) => { %>\n<%= param.name %><% if (!param.required) { %>?<% } %>: <%~ param.type %><% if (index < it.params.length - 1) { %>, <% } %>\n<% }) %>): Promise<<%~ it.responseType %>> => fetchRuntime<<%~ it.responseType %>>('<%= it.url %>', '<%= it.method.toUpperCase() %>'<% if (it.params.length) { %>, {\n<% it.params.forEach((param, index) => { %>\n <%= param.category %><% if (param.category === param.name) { %>\n<% } else { %>: <% if (param.category === 'body') { %><%= param.name %><% } else { %>{\n\t\t<%= param.name %>\n\n\t}<% } %>\n<% } %><% if (index < it.params.length - 1) { %>, <% } %>\n\n<% }) %>\n}<% } %>)\n","definitionBody":"<% if (it.propCommit) { %>\n /**\n * <%~ it.propCommit %>\n\n */\n<% } %>\n <%= it.prop.name %><% if (!it.prop.required) { %>?<% } %>: <%~ it.propType %>;","definitionFooter":"}\n","definitionHeader":"export interface <%= it.defName %> {"} | ||
export default {"actionImport":"import { fetchRuntime } from '<%= it.importPath %>shared/fetchRuntime'\n<% if (it.imports.length) { %>\nimport type { <%= it.imports.join(', ') %> } from '<%= it.importPath %><%= it.typeFileName %>'\n<% } %>","actionMethod":"<% /* API 方法注释 */ %>\n/**\n<% if (it.summary) { %>\n * <%~ it.summary %>\n<% } %>\n<% if (it.summary !== it.description) { %>\n<% if (it.summary && it.description) { %>\n\n *\n<% } %>\n<% if (it.description) { %>\n * @description <%~ it.description %>\n<% } %>\n<% } %>\n<% if (it.params.length) { %>\n\n *\n<% it.params.forEach(param => { %>\n * @param {<%~ param.type %>} <% if (!param.required) { %>[<% } %><%= param.name %><% if (!param.required) { %>]<% } %> - <%~ param.description || param.type %>\n\n<% }) %>\n<% } %>\n * @returns {Promise<<%~ it.responseType %>>} Promise<<%~ it.responseType %>>\n */\n<% /* API 方法 */ %>\nexport const <%= it.methodName %> = (<% it.params.forEach((param, index) => { %>\n<%= param.name %><% if (!param.required) { %>?<% } %>: <%~ param.type %><% if (index < it.params.length - 1) { %>, <% } %>\n<% }) %>): Promise<<%~ it.responseType %>> => fetchRuntime<<%~ it.responseType %>>('<%= it.url %>', '<%= it.method.toUpperCase() %>'<% if (it.params.length) { %>, {\n<% it.params.forEach((param, index) => { %>\n <%= param.category %><% if (param.category === param.name) { %>\n<% } else { %>: <% if (param.category === 'body') { %><%= param.name %><% } else { %>{\n\t\t<%= param.name %>\n\n\t}<% } %>\n<% } %><% if (index < it.params.length - 1) { %>, <% } %>\n\n<% }) %>\n}<% } %>)\n","definitionBody":"<% if (it.propCommit) { %>\n /**\n * <%~ it.propCommit %>\n\n */\n<% } %>\n <%= it.prop.name %><% if (!it.prop.required) { %>?<% } %>: <%~ it.propType %>;","definitionFooter":"}\n","definitionHeader":"export interface <%= it.defName %> {","enum":"export type <%= it.name %> = '<%~ it.data.map(it.convertValue).join(\"' | '\") %>';"} |