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

动态行为

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