diff --git a/backend/build.gradle b/backend/build.gradle index 15bdb2b..75eda9c 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -14,7 +14,7 @@ plugins { id 'java' id 'java-library' } -version = "1.2.5" +version = "1.3.4" group = 'org.bdware.sc.controlproxy' tasks.withType(JavaCompile) { diff --git a/backend/src/main/java/org/bdware/sc/controlproxy/TopologyCollector.java b/backend/src/main/java/org/bdware/sc/controlproxy/TopologyCollector.java index cf1236d..0031afc 100644 --- a/backend/src/main/java/org/bdware/sc/controlproxy/TopologyCollector.java +++ b/backend/src/main/java/org/bdware/sc/controlproxy/TopologyCollector.java @@ -50,9 +50,10 @@ public class TopologyCollector { } //--------Router网构建完毕 //--------构建SearchEngine网----- + JsonObject searchEngine = new JsonObject(); - searchEngine.addProperty("doId", root.get("doId").getAsString() + "/SearchEngine"); - searchEngine.addProperty("type", "SearchEngine"); + searchEngine.addProperty("doId", root.get("doId").getAsString() + "/Registry"); + searchEngine.addProperty("type", "Registry"); searchEngine.addProperty("name", root.get("name").getAsString() + "搜索引擎"); graph.addNode(searchEngine); //下级SearchEngine同步至上级 @@ -62,8 +63,8 @@ public class TopologyCollector { if (!from.get("doId").getAsString().startsWith(rootNode.get("doId").getAsString())) { continue; } - node.addProperty("doId", from.get("doId").getAsString() + "/SearchEngine"); - node.addProperty("type", "SearchEngine"); + node.addProperty("doId", from.get("doId").getAsString() + "/Registry"); + node.addProperty("type", "Registry"); node.addProperty("name", from.get("name").getAsString() + "搜索引擎"); graph.addNode(node); graph.addEdge(node.get("doId").getAsString(), searchEngine.get("doId").getAsString()); @@ -83,7 +84,7 @@ public class TopologyCollector { String name = from.get("name").getAsString(); if (name.equals("AuditProxy") || name.equals("ControlProxy")) continue; - if (name.equals("SearchEngine") || name.equals("GateWay")) + if (name.equals("Registry")||name.equals("SearchEngine")||name.equals("GateWay")) continue; JsonObject node = new JsonObject(); diff --git a/backend/src/main/resources/log4j2.properties b/backend/src/main/resources/log4j2.properties deleted file mode 100644 index 124ba89..0000000 --- a/backend/src/main/resources/log4j2.properties +++ /dev/null @@ -1,15 +0,0 @@ -filter.threshold.type=ThresholdFilter -filter.threshold.level=debug -appender.console.type=Console -appender.console.name=STDOUT -appender.console.layout.type=PatternLayout -appender.console.layout.pattern=%highlight{[%-5p] %d{HH:mm:ss.SSS} %m (%F:%L)[%M]%n}{FATAL=Bright Red,ERROR=Red,WARN=Yellow,INFO=Green,DEBUG=Blue,TRACE=White} -appender.rolling.type=File -appender.rolling.name=log -appender.rolling.append=true -appender.rolling.fileName=./log/gateway.log -appender.rolling.layout.type=PatternLayout -appender.rolling.layout.pattern=%d-%m%n -rootLogger.level=info -rootLogger.appenderRef.stdout.ref=STDOUT -rootLogger.appenderRef.log.ref=log \ No newline at end of file diff --git a/backend/src/test/resources/log4j2.properties b/backend/src/test/resources/log4j2.properties deleted file mode 100644 index 124ba89..0000000 --- a/backend/src/test/resources/log4j2.properties +++ /dev/null @@ -1,15 +0,0 @@ -filter.threshold.type=ThresholdFilter -filter.threshold.level=debug -appender.console.type=Console -appender.console.name=STDOUT -appender.console.layout.type=PatternLayout -appender.console.layout.pattern=%highlight{[%-5p] %d{HH:mm:ss.SSS} %m (%F:%L)[%M]%n}{FATAL=Bright Red,ERROR=Red,WARN=Yellow,INFO=Green,DEBUG=Blue,TRACE=White} -appender.rolling.type=File -appender.rolling.name=log -appender.rolling.append=true -appender.rolling.fileName=./log/gateway.log -appender.rolling.layout.type=PatternLayout -appender.rolling.layout.pattern=%d-%m%n -rootLogger.level=info -rootLogger.appenderRef.stdout.ref=STDOUT -rootLogger.appenderRef.log.ref=log \ No newline at end of file diff --git a/backend/yjs/ControlProxy.yjs b/backend/yjs/ControlProxy.yjs index 5a81b83..1dffecd 100755 --- a/backend/yjs/ControlProxy.yjs +++ b/backend/yjs/ControlProxy.yjs @@ -62,15 +62,17 @@ contract ControlProxy { "msg":"missing arguments repoId ", "code":1 }; } - var ret = executeContract("Gateway", "pingRepo", arg.doId); - ret = ret.result; - if (ret.rrt > 0) - return { - "msg":"success", "rrt":ret.rrt, "code":0, "repoInfo":JSON.parse(ret.repoInfo) - }; else return { - "msg":"repo is unconnected", "code":1 - }; + // var ret = executeContract("Gateway", "pingRepo", arg.doId); + // ret = ret.result; + // if (ret.rrt > 0) + // return { + // "msg":"success", "rrt":ret.rrt, "code":0, "repoInfo":JSON.parse(ret.repoInfo) + // }; else return { + // "msg":"repo is unconnected", "code":1 + // }; + return org.bdware.sc.controlproxy.RepoProxy.pingRepo(arg.doId); } + @Description("shanxi/TestLocal shanxi/Repository") export function testPingRepo(arg) { return org.bdware.sc.controlproxy.RepoProxy.pingRepo(arg); @@ -143,59 +145,59 @@ contract ControlProxy { //@范博 export function getAllTopology2() { return getAllTopology(2); - var nodeList = []; - nodeList.push({ - "name":"小店区仓库", "doId":"bdware.ss.ab/Repo1", "type":"Repo", "previousNode":["bdware.ss/Gateway1", "bdware.ss/Gateway2", "bdware.ss.ab/Repo2", "bdware.ss.zz/SearchEngine"] - } - ); - nodeList.push({ - "name":"小山区仓库", "doId":"bdware.ss.ab/Repo2", "type":"Repo", "previousNode":["bdware.ss/Gateway1", "bdware.ss/Gateway2", "bdware.ss.ab/SearchEngine"] - } - ); - nodeList.push({ - "name":"太原内部共享网关", "doId":"bdware.ss/Gateway1", "type":"Gateway", "previousNode":["bdware/Gateway1", "bdware/Gateway2"] - } - ); - nodeList.push({ - "name":"太原对外开放网关", "doId":"bdware.ss/Gateway2", "type":"Gateway", "previousNode":["bdware/Gateway1"] - } - ); - nodeList.push({ - "name":"山西内部共享网关", "doId":"bdware/Gateway1", "type":"Gateway" - } - ); - nodeList.push({ - "name":"山西内部共享网关2", "doId":"bdware/Gateway2", "type":"Gateway" - } - ); - nodeList.push({ - "name":"xxx搜索引擎", "doId":"bdware.ss/SearchEngine", "type":"SearchEngine", "previousNode":["bdware.ss.cc/SearchEngine"] - } - ); - nodeList.push({ - "name":"山西内部共享搜索引擎2", "doId":"bdware.ss.ab/SearchEngine", "type":"SearchEngine", "previousNode":["bdware.ss/SearchEngine"] - } - ); - nodeList.push({ - "name":"yyy搜索引擎", "doId":"bdware.ss.cc/SearchEngine", "type":"SearchEngine" - } - ); - nodeList.push({ - "name":"zzz搜索引擎", "doId":"bdware.ss.zz/SearchEngine", "type":"SearchEngine", "previousNode":["bdware.ss.cc/SearchEngine"] - } - ); - nodeList.push({ - "name":"贵州省域路由器", "doId":"bdware.ss.ab", "type":"Router", "previousNode":["bdware"] - } - ); - nodeList.push({ - "name":"山西省域路由器", "doId":"bdware.ss", "type":"Router", "previousNode":["bdware"] - } - ); - nodeList.push({ - "name":"数瑞测试网", "doId":"bdware", "type":"Router" - } - ); - return nodeList; + // var nodeList = []; + // nodeList.push({ + // "name":"小店区仓库", "doId":"bdware.ss.ab/Repo1", "type":"Repo", "previousNode":["bdware.ss/Gateway1", "bdware.ss/Gateway2", "bdware.ss.ab/Repo2", "bdware.ss.zz/SearchEngine"] + // } + // ); + // nodeList.push({ + // "name":"小山区仓库", "doId":"bdware.ss.ab/Repo2", "type":"Repo", "previousNode":["bdware.ss/Gateway1", "bdware.ss/Gateway2", "bdware.ss.ab/SearchEngine"] + // } + // ); + // nodeList.push({ + // "name":"太原内部共享网关", "doId":"bdware.ss/Gateway1", "type":"Gateway", "previousNode":["bdware/Gateway1", "bdware/Gateway2"] + // } + // ); + // nodeList.push({ + // "name":"太原对外开放网关", "doId":"bdware.ss/Gateway2", "type":"Gateway", "previousNode":["bdware/Gateway1"] + // } + // ); + // nodeList.push({ + // "name":"山西内部共享网关", "doId":"bdware/Gateway1", "type":"Gateway" + // } + // ); + // nodeList.push({ + // "name":"山西内部共享网关2", "doId":"bdware/Gateway2", "type":"Gateway" + // } + // ); + // nodeList.push({ + // "name":"xxx搜索引擎", "doId":"bdware.ss/SearchEngine", "type":"SearchEngine", "previousNode":["bdware.ss.cc/SearchEngine"] + // } + // ); + // nodeList.push({ + // "name":"山西内部共享搜索引擎2", "doId":"bdware.ss.ab/SearchEngine", "type":"SearchEngine", "previousNode":["bdware.ss/SearchEngine"] + // } + // ); + // nodeList.push({ + // "name":"yyy搜索引擎", "doId":"bdware.ss.cc/SearchEngine", "type":"SearchEngine" + // } + // ); + // nodeList.push({ + // "name":"zzz搜索引擎", "doId":"bdware.ss.zz/SearchEngine", "type":"SearchEngine", "previousNode":["bdware.ss.cc/SearchEngine"] + // } + // ); + // nodeList.push({ + // "name":"贵州省域路由器", "doId":"bdware.ss.ab", "type":"Router", "previousNode":["bdware"] + // } + // ); + // nodeList.push({ + // "name":"山西省域路由器", "doId":"bdware.ss", "type":"Router", "previousNode":["bdware"] + // } + // ); + // nodeList.push({ + // "name":"数瑞测试网", "doId":"bdware", "type":"Router" + // } + // ); + // return nodeList; } } diff --git a/backend/yjs/repodetail.yjs b/backend/yjs/repodetail.yjs index 0f153ba..771f768 100755 --- a/backend/yjs/repodetail.yjs +++ b/backend/yjs/repodetail.yjs @@ -6,7 +6,7 @@ module RepoDetail { //TODO TODO export function getDoList(arg) { print("GetDOList==========="); - var ret = executeContract("SearchEngine", "getDoList", arg); + var ret = executeContract("Registry","getDoList", arg); return ret.result; } export function getDoList2(arg) { diff --git a/backend/yjs/search.yjs b/backend/yjs/search.yjs index 2c4fdf3..7973ae8 100755 --- a/backend/yjs/search.yjs +++ b/backend/yjs/search.yjs @@ -8,33 +8,33 @@ module SearchModule{ //返回结果:一个数组,里面是doId"contains"这个参数的列表。 export function getAllRepoCount() { - return executeContract("SearchEngine","getAllRepoCount",arg).result; + return executeContract("Registry","getAllRepoCount",arg).result; //return Global.allRepoCount; } export function getAllUserCount() { - return executeContract("SearchEngine","getAllUserCount",arg).result; + return executeContract("Registry","getAllUserCount",arg).result; //return Global.allRepoCount; } export function getAllSearchCount() { - return executeContract("SearchEngine","getAllSearchCount",arg).result; + return executeContract("Registry","getAllSearchCount",arg).result; //return Global.allRepoCount; } export function getAllUpdateCount() { - return executeContract("SearchEngine","getAllUpdateCount",arg).result; + return executeContract("Registry","getAllUpdateCount",arg).result; //return Global.allRepoCount; } export function getAllDoCount() { - return executeContract("SearchEngine","getAllDoCount",arg).result; + return executeContract("Registry","getAllDoCount",arg).result; //return Global.allRepoCount; } //不确定 //{"open":51,"close":49} export function getAllIndexCount() { - return executeContract("SearchEngine","getAllIndexCount",arg).result; + return executeContract("Registry","getAllIndexCount",arg).result; //return Global.allRepoCount; } export function getDoCount(arg){ - return executeContract("SearchEngine","getDoCount",arg); + return executeContract("Registry","getDoCount",arg); //return { //"data":[{ // "doId":"bdware.txte/Repo1","count":10} @@ -77,7 +77,7 @@ module SearchModule{ //做成可以根据创建时间范围;标识模糊 //{"type":"creatTime","count":10,"offset":"0","from":"1141363811328","to":"1941363811328"} export function getDoFilter(arg){ - var res=executeContract("SearchEngine","searchByRange",arg); + var res=executeContract("Registry","searchByRange",arg); return res.result; } @@ -92,7 +92,7 @@ module SearchModule{ @ArgSchema({"!params":[{"!type":"string","!keyword":"integer"}],"count":"integer","offset":"integer"}) export function search(arg){ arg = convertArgToJson(arg); - var res=executeContract("SearchEngine","searchByMultiTag",arg); + var res=executeContract("Registry","searchByMultiTag",arg); return res.result; //ret=[];