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

动态行为

上级 64e2e2b7
...@@ -230,6 +230,10 @@ public interface I${item.codeName}Service { ...@@ -230,6 +230,10 @@ public interface I${item.codeName}Service {
@Async("asyncExecutor") @Async("asyncExecutor")
void asyncImportData(List<${de.codeName}> entities, int batchSize, boolean isIgnoreError); void asyncImportData(List<${de.codeName}> entities, int batchSize, boolean isIgnoreError);
</#if> </#if>
<#comment>动态行为服务接口</#comment>
<#if pub.isEnableDynaModel()?? && pub.isEnableDynaModel()== true>
${item.codeName} dynamicCall(${srfr7javatype(keyfield.stdDataType)} key, String action, ${item.codeName} et);
</#if>
</#macro> </#macro>
<#comment>输出测试行为</#comment> <#comment>输出测试行为</#comment>
......
...@@ -986,15 +986,14 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa ...@@ -986,15 +986,14 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
return true; return true;
} }
</#if> </#if>
<#comment>发布es服务对象</#comment> <#comment>发布es服务对象</#comment>
<@esAnno/> <@esAnno/>
<#comment>重复值检查-searchContext</#comment> <#comment>重复值检查-searchContext</#comment>
<@outputSearchContext/> <@outputSearchContext/>
<#comment>引入proxyservice</#comment> <#comment>引入proxyservice</#comment>
<@autowiredProxyService/> <@autowiredProxyService/>
<#comment>动态行为</#comment>
<@dynamicCall/>
} }
<#comment>NOSQL存储</#comment> <#comment>NOSQL存储</#comment>
...@@ -1487,15 +1486,14 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -1487,15 +1486,14 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
return entities; return entities;
} }
</#if> </#if>
<#comment>实体数据导入</#comment> <#comment>实体数据导入</#comment>
<@deImportData/> <@deImportData/>
<#comment>发布es服务对象</#comment> <#comment>发布es服务对象</#comment>
<@esAnno/> <@esAnno/>
<#comment>重复值检查-SearchContext</#comment> <#comment>重复值检查-SearchContext</#comment>
<@outputSearchContext/> <@outputSearchContext/>
<#comment>动态行为</#comment>
<@dynamicCall/>
} }
...@@ -2005,13 +2003,12 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -2005,13 +2003,12 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
</#if> </#if>
</#list> </#list>
</#if> </#if>
<#comment>实体数据导入</#comment> <#comment>实体数据导入</#comment>
<@deImportData/> <@deImportData/>
<#comment>重复值检查-SearchContext</#comment> <#comment>重复值检查-SearchContext</#comment>
<@outputSearchContext/> <@outputSearchContext/>
<#comment>动态行为</#comment>
<@dynamicCall/>
} }
<#comment>无存储</#comment> <#comment>无存储</#comment>
...@@ -2324,9 +2321,10 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -2324,9 +2321,10 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
</#if> </#if>
</#list> </#list>
</#if> </#if>
<#comment>实体数据导入</#comment> <#comment>实体数据导入</#comment>
<@deImportData/> <@deImportData/>
<#comment>动态行为</#comment>
<@dynamicCall/>
} }
</#if> </#if>
...@@ -3091,4 +3089,14 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -3091,4 +3089,14 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
} }
</#macro> </#macro>
<#comment>动态行为服务接口</#comment>
<#macro dynamicCall>
@Override
@Transactional
public ${item.codeName} dynamicCall(${srfr7javatype(keyfield.stdDataType)} key, String action, ${item.codeName} et) {
return et;
}
</#macro>
</#if> </#if>
...@@ -360,6 +360,18 @@ public class ${itemCodeName}Resource { ...@@ -360,6 +360,18 @@ public class ${itemCodeName}Resource {
} }
</#if> </#if>
<#comment>动态行为服务接口</#comment>
<#if pub.isEnableDynaModel()?? && pub.isEnableDynaModel()== true>
<#assign dynamic_id_Params = id_etParams + "@PathVariable(\"" + itemCodeNameLC + keyCNLC + "\") " + srfr7javatype(de.getKeyPSDEField().getStdDataType())+" " + itemCodeNameLC + keyCNLC +" ,@PathVariable(\"action\") String action , @RequestBody " + itemCodeName + "DTO " + itemCodeNameLC + "dto" >
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN')")
@RequestMapping(method = RequestMethod.POST, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}/{action}")
public ResponseEntity<${itemCodeName}DTO> dynamicCall(${dynamic_id_Params}) {
${itemCodeName} domain = ${deCodeNameLC}Service.dynamicCall(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC + "dto"}));
${itemCodeNameLC}dto = ${itemCodeNameLC}Mapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
</#if>
</#if> </#if>
<#-- 主接口 end --> <#-- 主接口 end -->
<#-- 关系接口 start --> <#-- 关系接口 start -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册