提交 eeea0693 编写于 作者: zhouweidong's avatar zhouweidong

支持无参自定义行为

上级 c9994736
......@@ -134,6 +134,7 @@ public class ${itemCodeName}Resource {
<#assign id_etParams = id_etParams + "@PathVariable(\"" + itemCodeNameLC + keyCNLC + "\") " + srfjavatype(de.getKeyPSDEField().getStdDataType())+" " + itemCodeNameLC + keyCNLC + ", @RequestBody " + itemCodeName + "DTO " + itemCodeNameLC + "dto" >
<#assign id_etParams4 = id_etParams4 + "@RequestBody " + itemCodeName + "DTO " + itemCodeNameLC + "dto" >
<#assign id_etParams4_batch = id_etParams4_batch + "@RequestBody List<" + itemCodeName + "DTO> " + itemCodeNameLC + "dtos" >
<#assign dtoCodeName=itemCodeName + "DTO">
<#assign fullPath = parentPath + selfPath>
<#if item.getPSDEServiceAPIMethods()??>
<#list item.getPSDEServiceAPIMethods() as apiMethod>
......@@ -258,12 +259,14 @@ public class ${itemCodeName}Resource {
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}(<#if deaction.getRequestParamType() == 'NONE'><#else>${id_etParams}</#if>) {
<#if deaction.getRequestParamType() == 'NONE'>
${deCodeName} domain =new ${deCodeName}();
domain = ${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}(domain);
${dtoCodeName} ${itemCodeNameLC}dto = ${itemCodeNameLC}Mapping.toDto(domain);
<#else>
${deCodeName} domain = ${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dto);
domain.set${dePKCodeName}(${itemCodeNameLC + keyCNLC});
</#if>
domain = ${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}(domain);
${itemCodeNameLC}dto = ${itemCodeNameLC}Mapping.toDto(domain);
</#if>
return ResponseEntity.status(HttpStatus.OK).body(${itemCodeNameLC}dto);
}
......@@ -565,12 +568,14 @@ public class ${itemCodeName}Resource {
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(<#if deaction.getRequestParamType() == 'NONE'><#else>${id_etParams}</#if>) {
<#if deaction.getRequestParamType() == 'NONE'>
${deCodeName} domain =new ${deCodeName}();
domain = ${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}(domain) ;
${dtoCodeName} ${itemCodeNameLC}dto = ${itemCodeNameLC}Mapping.toDto(domain);
<#else>
${deCodeName} domain = ${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dto);
${parentSetParams}
</#if>
domain = ${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}(domain) ;
${itemCodeNameLC}dto = ${itemCodeNameLC}Mapping.toDto(domain);
</#if>
return ResponseEntity.status(HttpStatus.OK).body(${itemCodeNameLC}dto);
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册