From cd6d1d65cc1f94a25fc918a636c610d9f32a4fde Mon Sep 17 00:00:00 2001 From: icanci Date: Wed, 20 Sep 2023 19:43:50 +0800 Subject: [PATCH 1/6] index js --- .../resources/vueboot/src/router/index.js | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/views/src/main/resources/vueboot/src/router/index.js b/views/src/main/resources/vueboot/src/router/index.js index 901ac06..acda0c8 100644 --- a/views/src/main/resources/vueboot/src/router/index.js +++ b/views/src/main/resources/vueboot/src/router/index.js @@ -174,30 +174,30 @@ export const constantRoutes = [ }, ] }, - { - path: '/bicData', - component: Layout, - redirect: '/bic-data/index', - name: 'bicData', - meta: { - title: '纠察图数据', - icon: 'form' - }, - children: [ - { - path: 'edge-data', - component: () => import('@/views/bic-data/edge-data'), - name: 'edgeData', - meta: {title: '边数据'} - }, - { - path: 'node-data', - component: () => import('@/views/bic-data/node-data'), - name: 'nodeData', - meta: {title: '节点数据'} - }, - ] - }, + // { + // path: '/bicData', + // component: Layout, + // redirect: '/bic-data/index', + // name: 'bicData', + // meta: { + // title: '纠察图数据', + // icon: 'form' + // }, + // children: [ + // { + // path: 'edge-data', + // component: () => import('@/views/bic-data/edge-data'), + // name: 'edgeData', + // meta: {title: '边数据'} + // }, + // { + // path: 'node-data', + // component: () => import('@/views/bic-data/node-data'), + // name: 'nodeData', + // meta: {title: '节点数据'} + // }, + // ] + // }, { path: '/bicView', component: Layout, -- Gitee From 2053e091bc81e7ea4b3f0098a216a5b8cc32efc9 Mon Sep 17 00:00:00 2001 From: icanci Date: Wed, 20 Sep 2023 19:52:40 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=9A=E8=87=AA=E5=8A=A8=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E9=BB=98=E8=AE=A4=E8=BE=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/dts/impl/SystemDtsServiceImpl.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/SystemDtsServiceImpl.java diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/SystemDtsServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/SystemDtsServiceImpl.java new file mode 100644 index 0000000..ac2c735 --- /dev/null +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/SystemDtsServiceImpl.java @@ -0,0 +1,39 @@ +package cn.icanci.loopstack.bic.biz.dts.impl; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import cn.icanci.loopstack.bic.biz.dts.DTS; +import cn.icanci.loopstack.bic.biz.dts.GraphDtsService; +import cn.icanci.loopstack.bic.biz.service.EdgeStyleService; +import cn.icanci.loopstack.bic.biz.utils.TemplateFileUtils; +import cn.icanci.loopstack.bic.common.model.base.EdgeStyleVO; +import cn.icanci.loopstack.bic.common.model.base.SystemVO; + +/** + * @author icanci + * @since 1.0 Created in 2023/09/20 19:47 + */ +@Service +@DTS(SystemVO.class) +public class SystemDtsServiceImpl implements GraphDtsService { + @Resource + private EdgeStyleService edgeStyleService; + private static final String SYSTEM_DEFAULT_EDGE_STYLE_NAME = "系统默认"; + private static final String SYSTEM_DEFAULT_EDGE_STYLE_KEY = "SYSTEM_DEFAULT_KEY"; + + @Override + public void dtsUnitViewTree(SystemVO system) { + edgeStyleService.save(buildEdge(system)); + } + + private EdgeStyleVO buildEdge(SystemVO system) { + EdgeStyleVO edge = new EdgeStyleVO(); + edge.setSystemUuid(system.getUuid()); + edge.setEdgeStyleName(SYSTEM_DEFAULT_EDGE_STYLE_NAME); + edge.setEdgeStyleKey(SYSTEM_DEFAULT_EDGE_STYLE_KEY); + edge.setEdgeStyle(TemplateFileUtils.queryDefaultEdgeStyleTemplate()); + return edge; + } +} -- Gitee From 0f09bac1a3cee9476cbf685a651135d3f23d3713 Mon Sep 17 00:00:00 2001 From: icanci Date: Wed, 20 Sep 2023 19:53:50 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=9A=E8=87=AA=E5=8A=A8=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E9=BB=98=E8=AE=A4=E8=BE=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loopstack/bic/biz/service/impl/SystemServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/SystemServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/SystemServiceImpl.java index 37fc92e..76770f4 100644 --- a/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/SystemServiceImpl.java +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/SystemServiceImpl.java @@ -8,6 +8,7 @@ import org.springframework.stereotype.Service; import com.google.common.collect.Lists; +import cn.icanci.loopstack.bic.biz.dts.GraphDtsServiceProxy; import cn.icanci.loopstack.bic.biz.mapper.SystemMapper; import cn.icanci.loopstack.bic.biz.service.SystemService; import cn.icanci.loopstack.bic.common.model.TextValue; @@ -24,9 +25,11 @@ import cn.icanci.loopstack.bic.dal.mongo.dateobject.SystemDO; public class SystemServiceImpl implements SystemService { @Resource - private SystemDAO systemDAO; + private SystemDAO systemDAO; @Resource - private SystemMapper systemMapper; + private SystemMapper systemMapper; + @Resource + private GraphDtsServiceProxy graphDtsServiceProxy; @Override public List queryAll() { @@ -39,6 +42,7 @@ public class SystemServiceImpl implements SystemService { if (doInsert(systemVO)) { SystemDO insert = systemMapper.vo2do(systemVO); systemDAO.insert(insert); + graphDtsServiceProxy.dtsUnitViewTree(systemVO); } else { systemDAO.update(systemMapper.vo2do(systemVO)); } -- Gitee From cf2dea240c07bb7d0b9242c378d06dd741817687 Mon Sep 17 00:00:00 2001 From: icanci Date: Wed, 20 Sep 2023 19:57:38 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=9A=E8=87=AA=E5=8A=A8=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=A0=B7=E5=BC=8F=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bic/biz/dts/impl/NodeDtsServiceImpl.java | 40 +++++++++++++++++++ .../bic/biz/service/impl/NodeServiceImpl.java | 17 ++++---- 2 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeDtsServiceImpl.java diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeDtsServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeDtsServiceImpl.java new file mode 100644 index 0000000..5340de5 --- /dev/null +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeDtsServiceImpl.java @@ -0,0 +1,40 @@ +package cn.icanci.loopstack.bic.biz.dts.impl; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import cn.icanci.loopstack.bic.biz.dts.DTS; +import cn.icanci.loopstack.bic.biz.dts.GraphDtsService; +import cn.icanci.loopstack.bic.biz.service.NodeStyleService; +import cn.icanci.loopstack.bic.biz.utils.TemplateFileUtils; +import cn.icanci.loopstack.bic.common.model.base.NodeStyleVO; +import cn.icanci.loopstack.bic.common.model.base.NodeVO; + +/** + * @author icanci + * @since 1.0 Created in 2023/09/20 19:54 + */ +@Service +@DTS(NodeVO.class) +public class NodeDtsServiceImpl implements GraphDtsService { + private static final String SYSTEM_DEFAULT_EDGE_STYLE_NAME = "系统默认"; + private static final String SYSTEM_DEFAULT_EDGE_STYLE_KEY = "SYSTEM_DEFAULT_KEY"; + @Resource + private NodeStyleService nodeStyleService; + + @Override + public void dtsUnitViewTree(NodeVO node) { + nodeStyleService.save(buildNodeStyle(node)); + } + + private NodeStyleVO buildNodeStyle(NodeVO node) { + NodeStyleVO nodeStyle = new NodeStyleVO(); + nodeStyle.setSystemUuid(node.getSystemUuid()); + nodeStyle.setNodeStyleName(SYSTEM_DEFAULT_EDGE_STYLE_NAME); + nodeStyle.setNodeStyleKey(SYSTEM_DEFAULT_EDGE_STYLE_KEY); + nodeStyle.setNodeStyle(TemplateFileUtils.queryDefaultNodeStyleTemplate()); + return nodeStyle; + } + +} diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeServiceImpl.java index f698958..74a22a0 100644 --- a/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeServiceImpl.java +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeServiceImpl.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Service; import com.google.common.collect.Lists; +import cn.icanci.loopstack.bic.biz.dts.GraphDtsServiceProxy; import cn.icanci.loopstack.bic.biz.mapper.NodeMapper; import cn.icanci.loopstack.bic.biz.service.NodeService; import cn.icanci.loopstack.bic.common.model.TextValue; @@ -24,9 +25,11 @@ import cn.icanci.loopstack.bic.dal.mongo.dateobject.NodeDO; @Service("nodeService") public class NodeServiceImpl implements NodeService { @Resource - private NodeDAO nodeDAO; + private NodeDAO nodeDAO; @Resource - private NodeMapper nodeMapper; + private NodeMapper nodeMapper; + @Resource + private GraphDtsServiceProxy graphDtsServiceProxy; @Override public List queryAll() { @@ -34,18 +37,14 @@ public class NodeServiceImpl implements NodeService { } @Override -// @Transactional(rollbackFor = Exception.class) + // @Transactional(rollbackFor = Exception.class) public void save(NodeVO nodeVO) { // TODO 日志记录 - // TODO 事务插入 测试 + // TODO 事务插入 if (doInsert(nodeVO)) { NodeDO insert = nodeMapper.vo2do(nodeVO); nodeDAO.insert(insert); - - // TODO - // 插入样式 - // 插入组件函数 - + graphDtsServiceProxy.dtsUnitViewTree(nodeVO); } else { nodeDAO.update(nodeMapper.vo2do(nodeVO)); } -- Gitee From e97e4c34c4b9642bcf0399e0ecd808967e43f79e Mon Sep 17 00:00:00 2001 From: icanci Date: Wed, 20 Sep 2023 20:04:23 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=9A=E8=87=AA=E5=8A=A8=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E7=BB=84=E4=BB=B6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bic/biz/dts/impl/NodeDtsServiceImpl.java | 28 +++++++++++-- .../biz/dts/impl/SystemDtsServiceImpl.java | 8 ++-- .../bic/biz/utils/TemplateFileUtils.java | 4 ++ .../main/resources/vue/default-node-vue.vue | 39 +++++++++++++++++++ 4 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 biz/src/main/resources/vue/default-node-vue.vue diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeDtsServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeDtsServiceImpl.java index 5340de5..0567852 100644 --- a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeDtsServiceImpl.java +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeDtsServiceImpl.java @@ -7,9 +7,12 @@ import org.springframework.stereotype.Service; import cn.icanci.loopstack.bic.biz.dts.DTS; import cn.icanci.loopstack.bic.biz.dts.GraphDtsService; import cn.icanci.loopstack.bic.biz.service.NodeStyleService; +import cn.icanci.loopstack.bic.biz.service.NodeVueService; import cn.icanci.loopstack.bic.biz.utils.TemplateFileUtils; +import cn.icanci.loopstack.bic.common.enums.NodeVueTypeEnum; import cn.icanci.loopstack.bic.common.model.base.NodeStyleVO; import cn.icanci.loopstack.bic.common.model.base.NodeVO; +import cn.icanci.loopstack.bic.common.model.base.NodeVueVO; /** * @author icanci @@ -18,23 +21,40 @@ import cn.icanci.loopstack.bic.common.model.base.NodeVO; @Service @DTS(NodeVO.class) public class NodeDtsServiceImpl implements GraphDtsService { - private static final String SYSTEM_DEFAULT_EDGE_STYLE_NAME = "系统默认"; - private static final String SYSTEM_DEFAULT_EDGE_STYLE_KEY = "SYSTEM_DEFAULT_KEY"; + private static final String DEFAULT_NAME = "系统默认"; + private static final String DEFAULT_KEY = "DEFAULT_KEY"; + private static final String DEFAULT_PLUGIN_CONTEXT = "{}"; @Resource private NodeStyleService nodeStyleService; + @Resource + private NodeVueService nodeVueService; @Override public void dtsUnitViewTree(NodeVO node) { + // 插入样式信息 nodeStyleService.save(buildNodeStyle(node)); + // 插入组件信息 + nodeVueService.save(buildNodeVue(node)); } private NodeStyleVO buildNodeStyle(NodeVO node) { NodeStyleVO nodeStyle = new NodeStyleVO(); nodeStyle.setSystemUuid(node.getSystemUuid()); - nodeStyle.setNodeStyleName(SYSTEM_DEFAULT_EDGE_STYLE_NAME); - nodeStyle.setNodeStyleKey(SYSTEM_DEFAULT_EDGE_STYLE_KEY); + nodeStyle.setNodeStyleName(DEFAULT_NAME); + nodeStyle.setNodeStyleKey(DEFAULT_KEY); nodeStyle.setNodeStyle(TemplateFileUtils.queryDefaultNodeStyleTemplate()); return nodeStyle; } + private NodeVueVO buildNodeVue(NodeVO node) { + NodeVueVO nodeVue = new NodeVueVO(); + nodeVue.setSystemUuid(node.getSystemUuid()); + nodeVue.setNodeUuid(node.getUuid()); + nodeVue.setNodeVueName(DEFAULT_NAME); + nodeVue.setNodeVueKey(DEFAULT_KEY); + nodeVue.setNodeVueCode(TemplateFileUtils.queryDefaultNodeVue()); + nodeVue.setNodeVueType(NodeVueTypeEnum.DIALOG); + nodeVue.setPluginContext(DEFAULT_PLUGIN_CONTEXT); + return nodeVue; + } } diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/SystemDtsServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/SystemDtsServiceImpl.java index ac2c735..b4d0140 100644 --- a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/SystemDtsServiceImpl.java +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/SystemDtsServiceImpl.java @@ -20,8 +20,8 @@ import cn.icanci.loopstack.bic.common.model.base.SystemVO; public class SystemDtsServiceImpl implements GraphDtsService { @Resource private EdgeStyleService edgeStyleService; - private static final String SYSTEM_DEFAULT_EDGE_STYLE_NAME = "系统默认"; - private static final String SYSTEM_DEFAULT_EDGE_STYLE_KEY = "SYSTEM_DEFAULT_KEY"; + private static final String DEFAULT_NAME = "系统默认"; + private static final String DEFAULT_KEY = "DEFAULT_KEY"; @Override public void dtsUnitViewTree(SystemVO system) { @@ -31,8 +31,8 @@ public class SystemDtsServiceImpl implements GraphDtsService { private EdgeStyleVO buildEdge(SystemVO system) { EdgeStyleVO edge = new EdgeStyleVO(); edge.setSystemUuid(system.getUuid()); - edge.setEdgeStyleName(SYSTEM_DEFAULT_EDGE_STYLE_NAME); - edge.setEdgeStyleKey(SYSTEM_DEFAULT_EDGE_STYLE_KEY); + edge.setEdgeStyleName(DEFAULT_NAME); + edge.setEdgeStyleKey(DEFAULT_KEY); edge.setEdgeStyle(TemplateFileUtils.queryDefaultEdgeStyleTemplate()); return edge; } diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/utils/TemplateFileUtils.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/utils/TemplateFileUtils.java index d1fffc5..8ce4542 100644 --- a/biz/src/main/java/cn/icanci/loopstack/bic/biz/utils/TemplateFileUtils.java +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/utils/TemplateFileUtils.java @@ -11,6 +11,7 @@ public class TemplateFileUtils { private static final String DEFAULT_NODE_STYLE_TEMPLATE = "style/default-node-style-template.json"; private static final String DEFAULT_NODE_EDGE_TEMPLATE = "style/default-edge-style-template.json"; private static final String DEFAULT_NODE_VUE_TEMPLATE = "vue/default-node-vue-template.vue"; + private static final String DEFAULT_NODE_VUE = "vue/default-node-vue.vue"; /** * queryMockFile @@ -41,6 +42,9 @@ public class TemplateFileUtils { public static String queryDefaultNodeVueTemplate() { return queryLocalFile(DEFAULT_NODE_VUE_TEMPLATE); } + public static String queryDefaultNodeVue() { + return queryLocalFile(DEFAULT_NODE_VUE); + } public static String queryDefaultEdgeStyleTemplate() { return queryLocalFile(DEFAULT_NODE_EDGE_TEMPLATE); diff --git a/biz/src/main/resources/vue/default-node-vue.vue b/biz/src/main/resources/vue/default-node-vue.vue new file mode 100644 index 0000000..eee3a3e --- /dev/null +++ b/biz/src/main/resources/vue/default-node-vue.vue @@ -0,0 +1,39 @@ + + + + + -- Gitee From 43f633b74ba1bd790cb41454d9c5d9bc324f7300 Mon Sep 17 00:00:00 2001 From: icanci Date: Wed, 20 Sep 2023 20:08:50 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E7=BA=A0=E5=AF=9F=E5=9B=BE=E7=BB=93=E6=9E=84=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/icanci/loopstack/bic/biz/dts/DTS.java | 4 +++- .../biz/dts/impl/EdgeStyleDtsServiceImpl.java | 21 +++++++++++++++++++ .../biz/dts/impl/NodeStyleDtsServiceImpl.java | 21 +++++++++++++++++++ .../biz/dts/impl/NodeVueDtsServiceImpl.java | 21 +++++++++++++++++++ .../service/impl/EdgeStyleServiceImpl.java | 9 +++++--- .../service/impl/NodeStyleServiceImpl.java | 8 +++++-- .../biz/service/impl/NodeVueServiceImpl.java | 8 +++++-- 7 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/EdgeStyleDtsServiceImpl.java create mode 100644 biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeStyleDtsServiceImpl.java create mode 100644 biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeVueDtsServiceImpl.java diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/DTS.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/DTS.java index 0e0780d..0b95d9f 100644 --- a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/DTS.java +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/DTS.java @@ -1,5 +1,7 @@ package cn.icanci.loopstack.bic.biz.dts; +import cn.icanci.loopstack.bic.common.model.BaseVO; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -12,5 +14,5 @@ import java.lang.annotation.Target; @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface DTS { - Class value(); + Class value(); } diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/EdgeStyleDtsServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/EdgeStyleDtsServiceImpl.java new file mode 100644 index 0000000..a050dba --- /dev/null +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/EdgeStyleDtsServiceImpl.java @@ -0,0 +1,21 @@ +package cn.icanci.loopstack.bic.biz.dts.impl; + +import org.springframework.stereotype.Service; + +import cn.icanci.loopstack.bic.biz.dts.DTS; +import cn.icanci.loopstack.bic.biz.dts.GraphDtsService; +import cn.icanci.loopstack.bic.common.model.base.EdgeStyleVO; + +/** + * @author icanci + * @since 1.0 Created in 2023/09/20 20:05 + */ + +@Service +@DTS(EdgeStyleVO.class) +public class EdgeStyleDtsServiceImpl implements GraphDtsService { + @Override + public void dtsUnitViewTree(EdgeStyleVO type) { + // TODO 自动刷新纠察图结构缓存 + } +} diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeStyleDtsServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeStyleDtsServiceImpl.java new file mode 100644 index 0000000..9ab6b4e --- /dev/null +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeStyleDtsServiceImpl.java @@ -0,0 +1,21 @@ +package cn.icanci.loopstack.bic.biz.dts.impl; + +import org.springframework.stereotype.Service; + +import cn.icanci.loopstack.bic.biz.dts.DTS; +import cn.icanci.loopstack.bic.biz.dts.GraphDtsService; +import cn.icanci.loopstack.bic.common.model.base.NodeStyleVO; + +/** + * @author icanci + * @since 1.0 Created in 2023/09/20 20:05 + */ + +@Service +@DTS(NodeStyleVO.class) +public class NodeStyleDtsServiceImpl implements GraphDtsService { + @Override + public void dtsUnitViewTree(NodeStyleVO type) { + // TODO 节点样式变更之后:自动刷新纠察图结构缓存 + } +} diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeVueDtsServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeVueDtsServiceImpl.java new file mode 100644 index 0000000..9daea63 --- /dev/null +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/dts/impl/NodeVueDtsServiceImpl.java @@ -0,0 +1,21 @@ +package cn.icanci.loopstack.bic.biz.dts.impl; + +import org.springframework.stereotype.Service; + +import cn.icanci.loopstack.bic.biz.dts.DTS; +import cn.icanci.loopstack.bic.biz.dts.GraphDtsService; +import cn.icanci.loopstack.bic.common.model.base.NodeVueVO; + +/** + * @author icanci + * @since 1.0 Created in 2023/09/20 20:05 + */ + +@Service +@DTS(NodeVueVO.class) +public class NodeVueDtsServiceImpl implements GraphDtsService { + @Override + public void dtsUnitViewTree(NodeVueVO type) { + // TODO 节点组件变更之后:自动刷新纠察图结构缓存 + } +} diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/EdgeStyleServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/EdgeStyleServiceImpl.java index 5f75591..d632b07 100644 --- a/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/EdgeStyleServiceImpl.java +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/EdgeStyleServiceImpl.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Service; import com.google.common.collect.Lists; +import cn.icanci.loopstack.bic.biz.dts.GraphDtsServiceProxy; import cn.icanci.loopstack.bic.biz.mapper.EdgeStyleMapper; import cn.icanci.loopstack.bic.biz.service.EdgeStyleService; import cn.icanci.loopstack.bic.biz.utils.TemplateFileUtils; @@ -26,9 +27,11 @@ import cn.icanci.loopstack.bic.dal.mongo.dateobject.EdgeStyleDO; public class EdgeStyleServiceImpl implements EdgeStyleService { @Resource - private EdgeStyleDAO edgeStyleDAO; + private EdgeStyleDAO edgeStyleDAO; @Resource - private EdgeStyleMapper edgeStyleMapper; + private EdgeStyleMapper edgeStyleMapper; + @Resource + private GraphDtsServiceProxy graphDtsServiceProxy; @Override public List queryAll() { @@ -38,12 +41,12 @@ public class EdgeStyleServiceImpl implements EdgeStyleService { @Override public void save(EdgeStyleVO edgeStyleVO) { // TODO 日志记录 - // TODO 更新视图 if (doInsert(edgeStyleVO)) { EdgeStyleDO insert = edgeStyleMapper.vo2do(edgeStyleVO); edgeStyleDAO.insert(insert); } else { edgeStyleDAO.update(edgeStyleMapper.vo2do(edgeStyleVO)); + graphDtsServiceProxy.dtsUnitViewTree(edgeStyleVO); } // TODO 最后补充更新视图的逻辑,因为这个地方会构建缓存 } diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeStyleServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeStyleServiceImpl.java index 16e255a..f81b8ec 100644 --- a/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeStyleServiceImpl.java +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeStyleServiceImpl.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Service; import com.google.common.collect.Lists; +import cn.icanci.loopstack.bic.biz.dts.GraphDtsServiceProxy; import cn.icanci.loopstack.bic.biz.mapper.NodeStyleMapper; import cn.icanci.loopstack.bic.biz.service.NodeStyleService; import cn.icanci.loopstack.bic.biz.utils.TemplateFileUtils; @@ -26,9 +27,11 @@ import cn.icanci.loopstack.bic.dal.mongo.dateobject.NodeStyleDO; public class NodeStyleServiceImpl implements NodeStyleService { @Resource - private NodeStyleDAO nodeStyleDAO; + private NodeStyleDAO nodeStyleDAO; @Resource - private NodeStyleMapper nodeStyleMapper; + private NodeStyleMapper nodeStyleMapper; + @Resource + private GraphDtsServiceProxy graphDtsServiceProxy; @Override public List queryAll() { @@ -43,6 +46,7 @@ public class NodeStyleServiceImpl implements NodeStyleService { nodeStyleDAO.insert(insert); } else { nodeStyleDAO.update(nodeStyleMapper.vo2do(nodeStyleVO)); + graphDtsServiceProxy.dtsUnitViewTree(nodeStyleVO); } // 更新视图样式 // TODO 最后补充更新视图的逻辑,因为这个地方会构建缓存 diff --git a/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeVueServiceImpl.java b/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeVueServiceImpl.java index 29ba2e5..d5beaec 100644 --- a/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeVueServiceImpl.java +++ b/biz/src/main/java/cn/icanci/loopstack/bic/biz/service/impl/NodeVueServiceImpl.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Service; import com.google.common.collect.Lists; +import cn.icanci.loopstack.bic.biz.dts.GraphDtsServiceProxy; import cn.icanci.loopstack.bic.biz.mapper.NodeVueMapper; import cn.icanci.loopstack.bic.biz.service.NodeVueService; import cn.icanci.loopstack.bic.biz.utils.TemplateFileUtils; @@ -25,9 +26,11 @@ import cn.icanci.loopstack.bic.dal.mongo.dateobject.NodeVueDO; @Service public class NodeVueServiceImpl implements NodeVueService { @Resource - private NodeVueDAO nodeVueDAO; + private NodeVueDAO nodeVueDAO; @Resource - private NodeVueMapper nodeVueMapper; + private NodeVueMapper nodeVueMapper; + @Resource + private GraphDtsServiceProxy graphDtsServiceProxy; @Override public List queryAll() { @@ -43,6 +46,7 @@ public class NodeVueServiceImpl implements NodeVueService { nodeVueDAO.insert(insert); } else { nodeVueDAO.update(nodeVueMapper.vo2do(nodeVueVO)); + graphDtsServiceProxy.dtsUnitViewTree(nodeVueVO); } } -- Gitee