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

实体、属性、关系注册

上级 c52f2210
package cn.ibizlab.core.lite.extensions.service;
import cn.ibizlab.core.extensions.service.DstSystemExService;
import cn.ibizlab.core.lite.domain.MetaEntity;
import cn.ibizlab.core.lite.domain.MetaField;
import cn.ibizlab.core.lite.domain.MetaRelationship;
......@@ -39,25 +38,27 @@ public class LiteCoreService {
@Autowired
@Lazy
DstSystemExService proxyService;
LiteCoreService proxyService;
@Autowired
@Lazy
MetaEntityMapping entityMapping;
/**
* 自定义行为[SyncSysModel]用户扩展
* @param sysModel
* @return
*/
@Transactional
public boolean syncSysModel(SysModel sysModel) {
// proxyService.asyncSysModel(sysModel);
return true;
}
@Transactional
@Async("asyncExecutor")
public void syncSysModel(SysModel sysModel) {
public void asyncSysModel(SysModel sysModel) {
long start = System.currentTimeMillis();
log.info("开始同步[{}]系统模型",sysModel.getSystemid());
syncDE(sysModel);
syncDERelation(sysModel);
syncDEField(sysModel);
syncDERelation(sysModel);
long end = System.currentTimeMillis();
log.info("完成[{}]系统同步模型任务,总耗时[{}]秒",sysModel.getSystemid(),(end-start)/1000);
}
......
......@@ -31,6 +31,10 @@ public class LiteCoreResource {
@Autowired
private IDstComponentService dstComponentService;
@Autowired
@Lazy
LiteCoreService liteCoreService;
@RequestMapping(method = RequestMethod.GET, value = "/lite/{system}/entitys/{entity}")
public ResponseEntity<EntityModel> getEntityModel(@PathVariable("system") String system,@PathVariable("entity") String entity) {
return ResponseEntity.status(HttpStatus.OK).body(liteModelService.getEntityModel(system,entity));
......@@ -50,14 +54,10 @@ public class LiteCoreResource {
return ResponseEntity.status(HttpStatus.OK).body(JSON.parseObject(dstComponent.getConfig()));
}
@Autowired
@Lazy
LiteCoreService liteCoreService;
@ApiOperation(value = "保存系统", tags = {"系统" }, notes = "保存系统")
@RequestMapping(method = RequestMethod.POST, value = "/lite/syncsysmodel")
public void syncSysModel(@RequestBody SysModel sysModel) {
// liteCoreService.syncSysModel(sysModel);
public ResponseEntity<Boolean> syncSysModel(@RequestBody SysModel sysModel) {
return ResponseEntity.status(HttpStatus.OK).body(liteCoreService.syncSysModel(sysModel));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册