提交 e754676d 编写于 作者: tony001's avatar tony001

update:更新方法路径是否带资源主键

上级 d2620e5d
......@@ -7,9 +7,10 @@
* @memberof {{pascalCase appEntity.codeName}}ServiceBase
*/
public async {{singleAppMethod.codeName}}(context: IContext = {}, data: IParam = {}): Promise<any> {
{{! 方法路径是否带资源主键 }}
const deResPath = this.buildDeResPath(context, {{singleAppMethod.psDEServiceAPIMethod.isNeedResourceKey}});
{{#if (eq singleAppMethod.methodType "SELECT")}}
{{! 方法类型为SELECT }}
const deResPath = this.buildDeResPath(context, true);
{{#if (or (eq singleAppMethod.psDEServiceAPIMethod.requestMethod "PUT") (eq singleAppMethod.psDEServiceAPIMethod.requestMethod "POST") )}}
const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`,data);
{{else}}
......@@ -17,18 +18,15 @@
{{/if}}
{{else if (eq singleAppMethod.methodType "FETCHTEMP")}}
{{! 方法类型为FETCHTEMP }}
const deResPath = this.buildDeResPath(context, false);
const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`);
{{else if (eq singleAppMethod.methodType "FETCH")}}
{{! 方法类型为FETCH }}
const deResPath = this.buildDeResPath(context, false);
const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`);
{{else}}
{{! 方法类型为DEACTION }}
this.beforeExecuteAction(context,data,'{{singleAppMethod.codeName}}');
{{#if (eq singleAppMethod.psDEServiceAPIMethod.requestParamType "NONE")}}
{{! 参数类型为NONE,包含GetDraft }}
const deResPath = this.buildDeResPath(context, false);
{{#if (neq singleAppMethod.codeName 'GetDraft')}}
const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`);
{{else}}
......@@ -36,19 +34,12 @@
{{/if}}
{{else if (eq singleAppMethod.psDEServiceAPIMethod.requestParamType "FIELD")}}
{{! 参数类型为FIELD,包含Get,Remove }}
const deResPath = this.buildDeResPath(context, true);
const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`);
{{else if (eq singleAppMethod.psDEServiceAPIMethod.requestParamType "ENTITY")}}
{{! 参数类型为ENTITY,包含CheckKey,Create,Save,Update }}
{{#if (eq singleAppMethod.codeName "Create")}}
const deResPath = this.buildDeResPath(context, false);
{{else}}
const deResPath = this.buildDeResPath(context, true);
{{/if}}
const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`,data);
{{else}}
{{! 参数类型为URIPARAM }}
const deResPath = this.buildDeResPath(context, true);
const res = await this.http.{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestMethod }}(`${deResPath}{{lowerCase singleAppMethod.psDEServiceAPIMethod.requestPath}}`,data);
{{/if}}
this.afterExecuteAction(context,data,'{{singleAppMethod.codeName}}');
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册