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

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

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