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

服务接口补充返回值类型为空值

上级 5d787742
......@@ -145,6 +145,10 @@ public class ${itemCodeName}Resource {
<#assign deaction = apiMethod.getPSDEAction()>
<#assign deactionName = deaction.getName()>
<#assign deactionCodeName = deaction.getCodeName()>
<#assign apiReturnValueType=itemCodeName+"DTO">
<#if apiMethod.getReturnValueType()?? && apiMethod.getReturnValueType()?lower_case =='void' >
<#assign apiReturnValueType = "Void">
</#if>
<#comment>输出主接口测试行为</#comment>
<@outputTestActionDetail deaction/>
<#if deaction.codeName?lower_case == 'create'>
......@@ -252,7 +256,7 @@ public class ${itemCodeName}Resource {
<@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}", tags = {"${deLogicName}" }, notes = "${deaction.getLogicName()}")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}<#if deaction.getRequestParamType() == 'NONE'><#else>/{${itemCodeNameLC + keyCNLC}}</#if>/${deactionCodeName?lower_case}")
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}(<#if deaction.getRequestParamType() == 'NONE'><#else>${id_etParams}</#if>) {
public ResponseEntity<${apiReturnValueType}> ${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);
......@@ -263,7 +267,11 @@ public class ${itemCodeName}Resource {
domain = ${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}(domain);
${itemCodeNameLC}dto = ${itemCodeNameLC}Mapping.toDto(domain);
</#if>
<#if apiReturnValueType?lower_case =='void'>
return ResponseEntity.status(HttpStatus.OK).build();
<#else>
return ResponseEntity.status(HttpStatus.OK).body(${itemCodeNameLC}dto);
</#if>
}
<#comment>自定义行为批处理</#comment>
<#if (deaction.getActionType()=='USERCUSTOM')>
......@@ -433,6 +441,10 @@ public class ${itemCodeName}Resource {
<#assign deaction = apiMethod.getPSDEAction()>
<#assign deactionName = deaction.getName()>
<#assign deactionCodeName = deaction.getCodeName()>
<#assign apiReturnValueType=itemCodeName+"DTO">
<#if apiMethod.getReturnValueType()?? && apiMethod.getReturnValueType()?lower_case =='void' >
<#assign apiReturnValueType = "Void">
</#if>
<#comment>输出从接口测试行为</#comment>
<@outputTestActionDetail2 deaction/>
<#if deaction.codeName?lower_case == 'create'>
......@@ -597,7 +609,7 @@ public class ${itemCodeName}Resource {
<@SecurityAnnotation deaction/>
@ApiOperation(value = "${byTagParams}${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}${deLogicName}")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}<#if deaction.getRequestParamType() == 'NONE'><#else>/{${itemCodeNameLC + keyCNLC}}</#if>/${deactionCodeName?lower_case}")
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(<#if deaction.getRequestParamType() == 'NONE'><#else>${id_etParams}</#if>) {
public ResponseEntity<${apiReturnValueType}> ${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) ;
......@@ -608,7 +620,11 @@ public class ${itemCodeName}Resource {
domain = ${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}(domain) ;
${itemCodeNameLC}dto = ${itemCodeNameLC}Mapping.toDto(domain);
</#if>
<#if apiReturnValueType?lower_case =='void'>
return ResponseEntity.status(HttpStatus.OK).build();
<#else>
return ResponseEntity.status(HttpStatus.OK).body(${itemCodeNameLC}dto);
</#if>
}
<#comment>自定义行为批处理</#comment>
<#if (deaction.getActionType()=='USERCUSTOM')>
......@@ -1023,3 +1039,5 @@ public class ${itemCodeName}Resource {
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册