提交 e6fc0239 编写于 作者: xignzi006's avatar xignzi006 🇨🇳

Swagger Api 说明 更新 %ITEM%Resource.java.ftl

上级 448da56a
...@@ -9,6 +9,7 @@ TARGET=PSDESERVICEAPI ...@@ -9,6 +9,7 @@ TARGET=PSDESERVICEAPI
<#assign itemCodeName = item.getCodeName()> <#assign itemCodeName = item.getCodeName()>
<#assign itemCodeNameLC = itemCodeName?lower_case> <#assign itemCodeNameLC = itemCodeName?lower_case>
<#assign deCodeName = de.getCodeName()> <#assign deCodeName = de.getCodeName()>
<#assign deLogicName = de.getLogicName()>
<#assign deCodeNameCamel = srfcaseformat(deCodeName,'l_u2lC')?cap_first> <#assign deCodeNameCamel = srfcaseformat(deCodeName,'l_u2lC')?cap_first>
<#assign deCodeNameLC = deCodeName?lower_case> <#assign deCodeNameLC = deCodeName?lower_case>
<#assign dePKCodeNameLC = srfcaseformat(de.getKeyPSDEField().getCodeName(),'l_u2lC')> <#assign dePKCodeNameLC = srfcaseformat(de.getKeyPSDEField().getCodeName(),'l_u2lC')>
...@@ -69,7 +70,7 @@ import ${pubPkgCodeName}.core.${deapideModuleCNLC}.service.I${deapideCN}Service; ...@@ -69,7 +70,7 @@ import ${pubPkgCodeName}.core.${deapideModuleCNLC}.service.I${deapideCN}Service;
</#if> </#if>
@Slf4j @Slf4j
@Api(tags = {"${itemCodeName}" }) @Api(tags = {"${deLogicName}" })
<#comment>两个服务接口引用同一个实体时,会产生两个Resource,通过dev模式代理启动两个服务时,会产生bean同名冲突,所以需要进行区分</#comment> <#comment>两个服务接口引用同一个实体时,会产生两个Resource,通过dev模式代理启动两个服务时,会产生bean同名冲突,所以需要进行区分</#comment>
@RestController("${itemSysApiCodeName}-${itemCodeName?lower_case}") @RestController("${itemSysApiCodeName}-${itemCodeName?lower_case}")
@RequestMapping("") @RequestMapping("")
...@@ -141,7 +142,7 @@ public class ${itemCodeName}Resource { ...@@ -141,7 +142,7 @@ public class ${itemCodeName}Resource {
<#assign deactionCodeName = deaction.getCodeName()> <#assign deactionCodeName = deaction.getCodeName()>
<#if deaction.codeName?lower_case == 'create'> <#if deaction.codeName?lower_case == 'create'>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}") @ApiOperation(value = "新建${deLogicName}", tags = {"${deLogicName}" }, notes = "新建${deLogicName}")
@RequestMapping(method = RequestMethod.POST, value = "${fullPath}") @RequestMapping(method = RequestMethod.POST, value = "${fullPath}")
<#if de.getStorageMode()==4><#else> @Transactional</#if> <#if de.getStorageMode()==4><#else> @Transactional</#if>
public ResponseEntity<${itemCodeName}DTO> create(${etParams}) { public ResponseEntity<${itemCodeName}DTO> create(${etParams}) {
...@@ -152,7 +153,7 @@ public class ${itemCodeName}Resource { ...@@ -152,7 +153,7 @@ public class ${itemCodeName}Resource {
} }
<@SecurityBatchAnnotation deaction/> <@SecurityBatchAnnotation deaction/>
@ApiOperation(value = "createBatch", tags = {"${itemCodeName}" }, notes = "createBatch") @ApiOperation(value = "批量新建${deLogicName}", tags = {"${deLogicName}" }, notes = "批量新建${deLogicName}")
@RequestMapping(method = RequestMethod.POST, value = "${fullPath}/batch") @RequestMapping(method = RequestMethod.POST, value = "${fullPath}/batch")
public ResponseEntity<Boolean> createBatch(${etParamsList}) { public ResponseEntity<Boolean> createBatch(${etParamsList}) {
${deCodeNameLC}Service.createBatch(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos)); ${deCodeNameLC}Service.createBatch(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos));
...@@ -161,7 +162,7 @@ public class ${itemCodeName}Resource { ...@@ -161,7 +162,7 @@ public class ${itemCodeName}Resource {
<#elseif deaction.codeName?lower_case == 'update'> <#elseif deaction.codeName?lower_case == 'update'>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}") @ApiOperation(value = "更新${deLogicName}", tags = {"${deLogicName}" }, notes = "更新${deLogicName}")
@RequestMapping(method = RequestMethod.PUT, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}") @RequestMapping(method = RequestMethod.PUT, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}")
<#if de.getStorageMode()==4><#else> @Transactional</#if> <#if de.getStorageMode()==4><#else> @Transactional</#if>
public ResponseEntity<${itemCodeName}DTO> update(${id_etParams}) { public ResponseEntity<${itemCodeName}DTO> update(${id_etParams}) {
...@@ -173,7 +174,7 @@ public class ${itemCodeName}Resource { ...@@ -173,7 +174,7 @@ public class ${itemCodeName}Resource {
} }
<@SecurityBatchAnnotation deaction/> <@SecurityBatchAnnotation deaction/>
@ApiOperation(value = "UpdateBatch", tags = {"${itemCodeName}" }, notes = "UpdateBatch") @ApiOperation(value = "批量更新${deLogicName}", tags = {"${deLogicName}" }, notes = "批量更新${deLogicName}")
@RequestMapping(method = RequestMethod.PUT, value = "${fullPath}/batch") @RequestMapping(method = RequestMethod.PUT, value = "${fullPath}/batch")
public ResponseEntity<Boolean> updateBatch(${etParamsList}) { public ResponseEntity<Boolean> updateBatch(${etParamsList}) {
${deCodeNameLC}Service.updateBatch(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos)); ${deCodeNameLC}Service.updateBatch(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos));
...@@ -182,14 +183,14 @@ public class ${itemCodeName}Resource { ...@@ -182,14 +183,14 @@ public class ${itemCodeName}Resource {
<#elseif deaction.codeName?lower_case == 'save'> <#elseif deaction.codeName?lower_case == 'save'>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}") @ApiOperation(value = "保存${deLogicName}", tags = {"${deLogicName}" }, notes = "保存${deLogicName}")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}") @RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}")
public ResponseEntity<Boolean> save(${etParams}) { public ResponseEntity<Boolean> save(${etParams}) {
return ResponseEntity.status(HttpStatus.OK).body(${deCodeNameLC}Service.save(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dto))); return ResponseEntity.status(HttpStatus.OK).body(${deCodeNameLC}Service.save(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dto)));
} }
<@SecurityBatchAnnotation deaction/> <@SecurityBatchAnnotation deaction/>
@ApiOperation(value = "SaveBatch", tags = {"${itemCodeName}" }, notes = "SaveBatch") @ApiOperation(value = "批量保存${deLogicName}", tags = {"${deLogicName}" }, notes = "批量保存${deLogicName}")
@RequestMapping(method = RequestMethod.POST, value = "${fullPath}/savebatch") @RequestMapping(method = RequestMethod.POST, value = "${fullPath}/savebatch")
public ResponseEntity<Boolean> saveBatch(${etParamsList}) { public ResponseEntity<Boolean> saveBatch(${etParamsList}) {
${deCodeNameLC}Service.saveBatch(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos)); ${deCodeNameLC}Service.saveBatch(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos));
...@@ -198,7 +199,7 @@ public class ${itemCodeName}Resource { ...@@ -198,7 +199,7 @@ public class ${itemCodeName}Resource {
<#elseif deaction.codeName?lower_case == 'remove'> <#elseif deaction.codeName?lower_case == 'remove'>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}") @ApiOperation(value = "删除${deLogicName}", tags = {"${deLogicName}" }, notes = "删除${deLogicName}")
@RequestMapping(method = RequestMethod.DELETE, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}") @RequestMapping(method = RequestMethod.DELETE, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}")
<#if de.getStorageMode()==4><#else> @Transactional</#if> <#if de.getStorageMode()==4><#else> @Transactional</#if>
public ResponseEntity<Boolean> remove(${idParams}) { public ResponseEntity<Boolean> remove(${idParams}) {
...@@ -206,7 +207,7 @@ public class ${itemCodeName}Resource { ...@@ -206,7 +207,7 @@ public class ${itemCodeName}Resource {
} }
<@SecurityBatchAnnotation deaction/> <@SecurityBatchAnnotation deaction/>
@ApiOperation(value = "RemoveBatch", tags = {"${itemCodeName}" }, notes = "RemoveBatch") @ApiOperation(value = "批量删除${deLogicName}", tags = {"${deLogicName}" }, notes = "批量删除${deLogicName}")
@RequestMapping(method = RequestMethod.DELETE, value = "${fullPath}/batch") @RequestMapping(method = RequestMethod.DELETE, value = "${fullPath}/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<${srfjavatype(de.getKeyPSDEField().getStdDataType())}> ids) { public ResponseEntity<Boolean> removeBatch(@RequestBody List<${srfjavatype(de.getKeyPSDEField().getStdDataType())}> ids) {
${deCodeNameLC}Service.removeBatch(ids); ${deCodeNameLC}Service.removeBatch(ids);
...@@ -215,7 +216,7 @@ public class ${itemCodeName}Resource { ...@@ -215,7 +216,7 @@ public class ${itemCodeName}Resource {
<#elseif deaction.codeName?lower_case == 'get'> <#elseif deaction.codeName?lower_case == 'get'>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}") @ApiOperation(value = "获取${deLogicName}", tags = {"${deLogicName}" }, notes = "获取${deLogicName}")
@RequestMapping(method = RequestMethod.GET, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}") @RequestMapping(method = RequestMethod.GET, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}")
public ResponseEntity<${itemCodeName}DTO> get(${idParams}) { public ResponseEntity<${itemCodeName}DTO> get(${idParams}) {
${deCodeName} domain = ${deCodeNameLC}Service.get(${itemCodeNameLC + keyCNLC}); ${deCodeName} domain = ${deCodeNameLC}Service.get(${itemCodeNameLC + keyCNLC});
...@@ -224,14 +225,14 @@ public class ${itemCodeName}Resource { ...@@ -224,14 +225,14 @@ public class ${itemCodeName}Resource {
} }
<#elseif deaction.codeName?lower_case == 'checkkey'> <#elseif deaction.codeName?lower_case == 'checkkey'>
@ApiOperation(value = "${deaction.getLogicName()}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}") @ApiOperation(value = "检查${deLogicName}", tags = {"${deLogicName}" }, notes = "检查${deLogicName}")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}") @RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}")
public ResponseEntity<Boolean> checkKey(${etParams}) { public ResponseEntity<Boolean> checkKey(${etParams}) {
return ResponseEntity.status(HttpStatus.OK).body(${deCodeNameLC}Service.checkKey(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dto))); return ResponseEntity.status(HttpStatus.OK).body(${deCodeNameLC}Service.checkKey(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dto)));
} }
<#elseif deaction.codeName?lower_case == 'getdraft'><#comment>前端支持临时模式,后台不做处理</#comment> <#elseif deaction.codeName?lower_case == 'getdraft'><#comment>前端支持临时模式,后台不做处理</#comment>
@ApiOperation(value = "${deaction.getLogicName()}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}") @ApiOperation(value = "获取${deLogicName}草稿", tags = {"${deLogicName}" }, notes = "获取${deLogicName}草稿")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}") @RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}")
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}() { public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}() {
return ResponseEntity.status(HttpStatus.OK).body(${itemCodeNameLC}Mapping.toDto(${deCodeNameLC}Service.getDraft(new ${deCodeName}()))); return ResponseEntity.status(HttpStatus.OK).body(${itemCodeNameLC}Mapping.toDto(${deCodeNameLC}Service.getDraft(new ${deCodeName}())));
...@@ -244,7 +245,7 @@ public class ${itemCodeName}Resource { ...@@ -244,7 +245,7 @@ public class ${itemCodeName}Resource {
<#elseif deaction.getUserTag()?? && deaction.getActionType()?? && deaction.getUserTag() == 'REGIST' && deaction.getActionType() == 'USERCREATE'> <#elseif deaction.getUserTag()?? && deaction.getActionType()?? && deaction.getUserTag() == 'REGIST' && deaction.getActionType() == 'USERCREATE'>
<#else> <#else>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}") @ApiOperation(value = "${deaction.getLogicName()}", tags = {"${deLogicName}" }, notes = "${deaction.getLogicName()}")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}/${deactionCodeName?lower_case}") @RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}/${deactionCodeName?lower_case}")
<#if de.getStorageMode()==4><#else> @Transactional</#if> <#if de.getStorageMode()==4><#else> @Transactional</#if>
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}(${id_etParams}) { public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}(${id_etParams}) {
...@@ -259,7 +260,7 @@ public class ${itemCodeName}Resource { ...@@ -259,7 +260,7 @@ public class ${itemCodeName}Resource {
<#elseif apiMethod.getActionType()=='FETCH'> <#elseif apiMethod.getActionType()=='FETCH'>
<#assign deds = apiMethod.getPSDEDataSet()> <#assign deds = apiMethod.getPSDEDataSet()>
<@SecurityAnnotation deds/> <@SecurityAnnotation deds/>
@ApiOperation(value = "fetch${deds.getLogicName()}", tags = {"${itemCodeName}" } ,notes = "fetch${deds.getLogicName()}") @ApiOperation(value = "获取${deds.getLogicName()}", tags = {"${deLogicName}" } ,notes = "获取{deds.getLogicName()}")
@RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>") @RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>")
public ResponseEntity<List<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>(${deCodeName}SearchContext context) { public ResponseEntity<List<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>(${deCodeName}SearchContext context) {
<#--${parentSearchParams}--> <#--${parentSearchParams}-->
...@@ -282,7 +283,7 @@ public class ${itemCodeName}Resource { ...@@ -282,7 +283,7 @@ public class ${itemCodeName}Resource {
} }
<@SecurityAnnotation deds/> <@SecurityAnnotation deds/>
@ApiOperation(value = "search${deds.getLogicName()}", tags = {"${itemCodeName}" } ,notes = "search${deds.getLogicName()}") @ApiOperation(value = "查询{deds.getLogicName()}", tags = {"${deLogicName}" } ,notes = "查询{deds.getLogicName()}")
@RequestMapping(method= RequestMethod.POST , value="${fullPath}/search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>") @RequestMapping(method= RequestMethod.POST , value="${fullPath}/search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>")
public ResponseEntity<Page<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>(@RequestBody ${deCodeName}SearchContext context) { public ResponseEntity<Page<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>(@RequestBody ${deCodeName}SearchContext context) {
<#--${parentSearchParams}--> <#--${parentSearchParams}-->
...@@ -311,6 +312,7 @@ public class ${itemCodeName}Resource { ...@@ -311,6 +312,7 @@ public class ${itemCodeName}Resource {
<#assign selfPath="/" + srfpluralize(itemCodeNameLC) > <#assign selfPath="/" + srfpluralize(itemCodeNameLC) >
<#assign parentParams = ""> <#assign parentParams = "">
<#assign byParams = "By"> <#assign byParams = "By">
<#assign byTagParams = "根据">
<#assign parentSearchParams = "" > <#assign parentSearchParams = "" >
<#assign parentSetParams = "" > <#assign parentSetParams = "" >
<#assign parentParams2 = ""> <#assign parentParams2 = "">
...@@ -330,6 +332,7 @@ public class ${itemCodeName}Resource { ...@@ -330,6 +332,7 @@ public class ${itemCodeName}Resource {
<#assign rsMainDEServiceAPI = rs.getMajorPSDEServiceAPI()> <#assign rsMainDEServiceAPI = rs.getMajorPSDEServiceAPI()>
<#assign rsMainDe = rsMainDEServiceAPI.getPSDataEntity()> <#assign rsMainDe = rsMainDEServiceAPI.getPSDataEntity()>
<#assign rsMainDeCN = rsMainDe.codeName > <#assign rsMainDeCN = rsMainDe.codeName >
<#assign rsMainDeLogicName = rsMainDe.getLogicName() >
<#assign rsMainDeCNLC = rsMainDeCN?lower_case > <#assign rsMainDeCNLC = rsMainDeCN?lower_case >
<#assign rsMainDePKCN = rsMainDe.getKeyPSDEField().codeName > <#assign rsMainDePKCN = rsMainDe.getKeyPSDEField().codeName >
<#assign rsMainDePKCNLC = rsMainDePKCN?lower_case > <#assign rsMainDePKCNLC = rsMainDePKCN?lower_case >
...@@ -340,6 +343,7 @@ public class ${itemCodeName}Resource { ...@@ -340,6 +343,7 @@ public class ${itemCodeName}Resource {
</#if> </#if>
<#assign parentParams += "@PathVariable(\"" + rsMainDeCNLC + keyCNLC + "\") " + srfjavatype(rsMainDePKDataType) + " " + rsMainDeCNLC + keyCNLC > <#assign parentParams += "@PathVariable(\"" + rsMainDeCNLC + keyCNLC + "\") " + srfjavatype(rsMainDePKDataType) + " " + rsMainDeCNLC + keyCNLC >
<#assign byParams += rsMainDeCN > <#assign byParams += rsMainDeCN >
<#assign byTagParams += rsMainDeLogicName >
<#if rs.getPSDER1N()?? && apiRsPathLast.getCodeName() == rs.getCodeName()> <#if rs.getPSDER1N()?? && apiRsPathLast.getCodeName() == rs.getCodeName()>
<#assign parentSearchParams += "context.setN_" + rs.getPSDER1N().getPSPickupDEField().getName()?lower_case + "_eq("+ rsMainDeCNLC + keyCNLC +");" > <#assign parentSearchParams += "context.setN_" + rs.getPSDER1N().getPSPickupDEField().getName()?lower_case + "_eq("+ rsMainDeCNLC + keyCNLC +");" >
<#assign parentSetParams += "domain.set" + srfcaseformat(rs.getPSDER1N().getPSPickupDEField().getCodeName(),'l_u2lC')?cap_first + "("+ rsMainDeCNLC + keyCNLC +");" > <#assign parentSetParams += "domain.set" + srfcaseformat(rs.getPSDER1N().getPSPickupDEField().getCodeName(),'l_u2lC')?cap_first + "("+ rsMainDeCNLC + keyCNLC +");" >
...@@ -385,7 +389,7 @@ public class ${itemCodeName}Resource { ...@@ -385,7 +389,7 @@ public class ${itemCodeName}Resource {
<#assign deactionCodeName = deaction.getCodeName()> <#assign deactionCodeName = deaction.getCodeName()>
<#if deaction.codeName?lower_case == 'create'> <#if deaction.codeName?lower_case == 'create'>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}${byParams}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}${byParams}") @ApiOperation(value = "${byTagParams}建立${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}建立${deLogicName}")
@RequestMapping(method = RequestMethod.POST, value = "${fullPath}") @RequestMapping(method = RequestMethod.POST, value = "${fullPath}")
<#if de.getStorageMode()==4><#else> @Transactional</#if> <#if de.getStorageMode()==4><#else> @Transactional</#if>
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(${etParams}) { public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(${etParams}) {
...@@ -397,7 +401,7 @@ public class ${itemCodeName}Resource { ...@@ -397,7 +401,7 @@ public class ${itemCodeName}Resource {
} }
<@SecurityBatchAnnotation deaction/> <@SecurityBatchAnnotation deaction/>
@ApiOperation(value = "createBatch${byParams}", tags = {"${itemCodeName}" }, notes = "createBatch${byParams}") @ApiOperation(value = "${byTagParams}批量建立${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}批量建立${deLogicName}")
@RequestMapping(method = RequestMethod.POST, value = "${fullPath}/batch") @RequestMapping(method = RequestMethod.POST, value = "${fullPath}/batch")
public ResponseEntity<Boolean> createBatch${byParams}(${etParamsList}) { public ResponseEntity<Boolean> createBatch${byParams}(${etParamsList}) {
List<${deCodeName}> domainlist=${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos); List<${deCodeName}> domainlist=${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos);
...@@ -410,7 +414,7 @@ public class ${itemCodeName}Resource { ...@@ -410,7 +414,7 @@ public class ${itemCodeName}Resource {
<#elseif deaction.codeName?lower_case == 'update'> <#elseif deaction.codeName?lower_case == 'update'>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}${byParams}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}${byParams}") @ApiOperation(value = "${byTagParams}更新${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}更新${deLogicName}")
@RequestMapping(method = RequestMethod.PUT, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}") @RequestMapping(method = RequestMethod.PUT, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}")
<#if de.getStorageMode()==4><#else> @Transactional</#if> <#if de.getStorageMode()==4><#else> @Transactional</#if>
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(${id_etParams}) { public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(${id_etParams}) {
...@@ -462,7 +466,7 @@ public class ${itemCodeName}Resource { ...@@ -462,7 +466,7 @@ public class ${itemCodeName}Resource {
} }
<@SecurityBatchAnnotation deaction/> <@SecurityBatchAnnotation deaction/>
@ApiOperation(value = "UpdateBatch${byParams}", tags = {"${itemCodeName}" }, notes = "UpdateBatch${byParams}") @ApiOperation(value = "${byTagParams}批量更新${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}批量更新${deLogicName}")
@RequestMapping(method = RequestMethod.PUT, value = "${fullPath}/batch") @RequestMapping(method = RequestMethod.PUT, value = "${fullPath}/batch")
public ResponseEntity<Boolean> updateBatch${byParams}(${etParamsList}) { public ResponseEntity<Boolean> updateBatch${byParams}(${etParamsList}) {
List<${deCodeName}> domainlist=${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos); List<${deCodeName}> domainlist=${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos);
...@@ -475,7 +479,7 @@ public class ${itemCodeName}Resource { ...@@ -475,7 +479,7 @@ public class ${itemCodeName}Resource {
<#elseif deaction.codeName?lower_case == 'remove'> <#elseif deaction.codeName?lower_case == 'remove'>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}${byParams}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}${byParams}") @ApiOperation(value = "${byTagParams}删除${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}删除${deLogicName}")
@RequestMapping(method = RequestMethod.DELETE, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}") @RequestMapping(method = RequestMethod.DELETE, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}")
<#if de.getStorageMode()==4><#else> @Transactional</#if> <#if de.getStorageMode()==4><#else> @Transactional</#if>
public ResponseEntity<Boolean> ${deactionCodeName?uncap_first}${byParams}(${idParams}) { public ResponseEntity<Boolean> ${deactionCodeName?uncap_first}${byParams}(${idParams}) {
...@@ -483,7 +487,7 @@ public class ${itemCodeName}Resource { ...@@ -483,7 +487,7 @@ public class ${itemCodeName}Resource {
} }
<@SecurityBatchAnnotation deaction/> <@SecurityBatchAnnotation deaction/>
@ApiOperation(value = "RemoveBatch${byParams}", tags = {"${itemCodeName}" }, notes = "RemoveBatch${byParams}") @ApiOperation(value = "${byTagParams}批量删除${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}批量删除${deLogicName}")
@RequestMapping(method = RequestMethod.DELETE, value = "${fullPath}/batch") @RequestMapping(method = RequestMethod.DELETE, value = "${fullPath}/batch")
public ResponseEntity<Boolean> removeBatch${byParams}(@RequestBody List<${srfjavatype(de.getKeyPSDEField().getStdDataType())}> ids) { public ResponseEntity<Boolean> removeBatch${byParams}(@RequestBody List<${srfjavatype(de.getKeyPSDEField().getStdDataType())}> ids) {
${deCodeNameLC}Service.removeBatch(ids); ${deCodeNameLC}Service.removeBatch(ids);
...@@ -492,7 +496,7 @@ public class ${itemCodeName}Resource { ...@@ -492,7 +496,7 @@ public class ${itemCodeName}Resource {
<#elseif deaction.codeName?lower_case == 'save'> <#elseif deaction.codeName?lower_case == 'save'>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}${byParams}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}${byParams}") @ApiOperation(value = "${byTagParams}保存${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}保存${deLogicName}")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}") @RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}")
public ResponseEntity<Boolean> ${deactionCodeName?uncap_first}${byParams}(${etParams}) { public ResponseEntity<Boolean> ${deactionCodeName?uncap_first}${byParams}(${etParams}) {
${deCodeName} domain = ${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dto); ${deCodeName} domain = ${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dto);
...@@ -501,7 +505,7 @@ public class ${itemCodeName}Resource { ...@@ -501,7 +505,7 @@ public class ${itemCodeName}Resource {
} }
<@SecurityBatchAnnotation deaction/> <@SecurityBatchAnnotation deaction/>
@ApiOperation(value = "SaveBatch${byParams}", tags = {"${itemCodeName}" }, notes = "SaveBatch${byParams}") @ApiOperation(value = "${byTagParams}批量保存${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}批量保存${deLogicName}")
@RequestMapping(method = RequestMethod.POST, value = "${fullPath}/savebatch") @RequestMapping(method = RequestMethod.POST, value = "${fullPath}/savebatch")
public ResponseEntity<Boolean> saveBatch${byParams}(${etParamsList}) { public ResponseEntity<Boolean> saveBatch${byParams}(${etParamsList}) {
List<${deCodeName}> domainlist=${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos); List<${deCodeName}> domainlist=${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos);
...@@ -514,7 +518,7 @@ public class ${itemCodeName}Resource { ...@@ -514,7 +518,7 @@ public class ${itemCodeName}Resource {
<#elseif deaction.codeName?lower_case == 'get'> <#elseif deaction.codeName?lower_case == 'get'>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}${byParams}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}${byParams}") @ApiOperation(value = "${byTagParams}获取${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}获取${deLogicName}")
@RequestMapping(method = RequestMethod.GET, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}") @RequestMapping(method = RequestMethod.GET, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}")
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(${idParams}) { public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(${idParams}) {
${deCodeName} domain = ${deCodeNameLC}Service.get(${itemCodeNameLC + keyCNLC}); ${deCodeName} domain = ${deCodeNameLC}Service.get(${itemCodeNameLC + keyCNLC});
...@@ -523,14 +527,14 @@ public class ${itemCodeName}Resource { ...@@ -523,14 +527,14 @@ public class ${itemCodeName}Resource {
} }
<#elseif deaction.codeName?lower_case == 'checkkey'> <#elseif deaction.codeName?lower_case == 'checkkey'>
@ApiOperation(value = "${deaction.getLogicName()}${byParams}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}${byParams}") @ApiOperation(value = "${byTagParams}检查${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}检查${deLogicName}")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}") @RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}")
public ResponseEntity<Boolean> ${deactionCodeName?uncap_first}${byParams}(${etParams}) { public ResponseEntity<Boolean> ${deactionCodeName?uncap_first}${byParams}(${etParams}) {
return ResponseEntity.status(HttpStatus.OK).body(${deCodeNameLC}Service.checkKey(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dto))); return ResponseEntity.status(HttpStatus.OK).body(${deCodeNameLC}Service.checkKey(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dto)));
} }
<#elseif deaction.codeName?lower_case == 'getdraft'> <#elseif deaction.codeName?lower_case == 'getdraft'>
@ApiOperation(value = "${deaction.getLogicName()}${byParams}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}${byParams}") @ApiOperation(value = "${byTagParams}获取${deLogicName}草稿", tags = {"${deLogicName}" }, notes = "${byTagParams}获取${deLogicName}草稿")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}") @RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}")
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(${parentParams}) { public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(${parentParams}) {
${deCodeName} domain = new ${deCodeName}(); ${deCodeName} domain = new ${deCodeName}();
...@@ -545,7 +549,7 @@ public class ${itemCodeName}Resource { ...@@ -545,7 +549,7 @@ public class ${itemCodeName}Resource {
<#elseif deaction.getUserTag()?? && deaction.getActionType()?? && deaction.getUserTag() == 'REGIST' && deaction.getActionType() == 'USERCREATE'> <#elseif deaction.getUserTag()?? && deaction.getActionType()?? && deaction.getUserTag() == 'REGIST' && deaction.getActionType() == 'USERCREATE'>
<#else> <#else>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}${byParams}", tags = {"${itemCodeName}" }, notes = "${deaction.getLogicName()}${byParams}") @ApiOperation(value = "${byTagParams}${deLogicName}", tags = {"${deLogicName}" }, notes = "${byTagParams}${deLogicName}")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}/${deactionCodeName?lower_case}") @RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}/${deactionCodeName?lower_case}")
<#if de.getStorageMode()==4><#else> @Transactional</#if> <#if de.getStorageMode()==4><#else> @Transactional</#if>
public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(${id_etParams}) { public ResponseEntity<${itemCodeName}DTO> ${deactionCodeName?uncap_first}${byParams}(${id_etParams}) {
...@@ -560,7 +564,7 @@ public class ${itemCodeName}Resource { ...@@ -560,7 +564,7 @@ public class ${itemCodeName}Resource {
<#elseif apiMethod.getActionType()=='FETCH'> <#elseif apiMethod.getActionType()=='FETCH'>
<#assign deds = apiMethod.getPSDEDataSet()> <#assign deds = apiMethod.getPSDEDataSet()>
<@SecurityAnnotation deds/> <@SecurityAnnotation deds/>
@ApiOperation(value = "fetch${deds.getLogicName()}${byParams}", tags = {"${itemCodeName}" } ,notes = "fetch${deds.getLogicName()}${byParams}") @ApiOperation(value = "${byTagParams}获取${deds.getLogicName()}", tags = {"${deLogicName}" } ,notes = "${byTagParams}获取${deds.getLogicName()}")
@RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>") @RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>")
public ResponseEntity<List<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> fetch${itemCodeName}<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>${byParams}(<#if parentParams!="">${parentParams},</#if>${deCodeName}SearchContext context) { public ResponseEntity<List<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> fetch${itemCodeName}<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>${byParams}(<#if parentParams!="">${parentParams},</#if>${deCodeName}SearchContext context) {
${parentSearchParams} ${parentSearchParams}
...@@ -583,7 +587,7 @@ public class ${itemCodeName}Resource { ...@@ -583,7 +587,7 @@ public class ${itemCodeName}Resource {
} }
<@SecurityAnnotation deds/> <@SecurityAnnotation deds/>
@ApiOperation(value = "search${deds.getLogicName()}${byParams}", tags = {"${itemCodeName}" } ,notes = "search${deds.getLogicName()}${byParams}") @ApiOperation(value = "${byTagParams}查询${deds.getLogicName()}", tags = {"${deLogicName}" } ,notes = "${byTagParams}查询${deds.getLogicName()}")
@RequestMapping(method= RequestMethod.POST , value="${fullPath}/search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>") @RequestMapping(method= RequestMethod.POST , value="${fullPath}/search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>")
public ResponseEntity<Page<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> search${itemCodeName}<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>${byParams}(<#if parentParams!="">${parentParams}, @RequestBody </#if>${deCodeName}SearchContext context) { public ResponseEntity<Page<<#if deds.isEnableGroup()>HashMap<#else>${itemCodeName}DTO</#if>>> search${itemCodeName}<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>${byParams}(<#if parentParams!="">${parentParams}, @RequestBody </#if>${deCodeName}SearchContext context) {
${parentSearchParams} ${parentSearchParams}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册