diff --git a/backend/build.gradle b/backend/build.gradle index deb5081..1aaeea3 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -14,7 +14,7 @@ plugins { id 'java' id 'java-library' } -version = "1.3.92" +version = "1.4.0" group = 'org.bdware.sc.controlproxy' tasks.withType(JavaCompile) { @@ -104,7 +104,8 @@ task buildYPK(dependsOn: ["buildZip", "grepCP"]) { task deploy(dependsOn: ["buildYPK"]) { doLast { - org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true) + org.bdware.ypkdeploy.HTTPTool.deployWithYpk("./backend/deployconfig.json","./backend/build/ControlProxy-${project.version}.ypk") + //org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true) } } diff --git a/backend/deployconfig.json b/backend/deployconfig.json index a920cf3..a1a80e6 100644 --- a/backend/deployconfig.json +++ b/backend/deployconfig.json @@ -1,5 +1,5 @@ { - "host": "127.0.0.1", + "agentAddress": "39.104.209.178:18010", "privateKey": "d675782acf011dbc01a73c7967ccff9564486f7c3a9f5d5de151caffaa18936", "publicKey": "04303718771b9323c204e607639f14469f9a94e55b0964a408ad3b3864b0493b645d7070da0d550f0c54b934275a8e88dedc3024467b0566db5c1108b1baeaae27", "ypkPath": "/Users/huaqiancai/BDWare/datanet/ControlProxy/backend/build/ControlProxy-0.9.6.ypk", @@ -7,10 +7,9 @@ "createParam": { "privateKey": "4616ff0e2a4f982364914f9be30b51c6bc6ccb6602114a9ee8792f2ccf67465b", "publicKey": "04f9b9b8f324908464f78a6235e2dd93e4dfdaf045e9b1b5cfd57374516cc61a79a86fc2b42d3321a5b49a0f25381a7bed61901b40b729f72354e716673d551e98", - "prefix": "bdtest", + "prefix": "shanxi", "router": "GlobalRouter", - "routerURI": "tcp://127.0.0.1:18041", + "routerURI": "tcp://39.104.209.178:18041", "auditType": "OnlyHash" - }, - "agentPort": 18010 + } } \ No newline at end of file diff --git a/backend/yjs/networking.yjs b/backend/yjs/networking.yjs index a78eac8..3feff1b 100755 --- a/backend/yjs/networking.yjs +++ b/backend/yjs/networking.yjs @@ -1,302 +1,409 @@ //@范博 //以下接口都要给出示例参数 //类似于 @Descripton("参数为,{\"doId\":\"bdware.ss/Repox\"}") -module networking{ - //前缀管理用到的接口 listLRS updateLRS createLRS deleteLRS - export function getRouterInfo(arg){ - if (!checkPermission(requester)) { - YancloudUtil.exceptionReturn({"msg":"no permission","code":1}); +module networking { +//前缀管理用到的接口 listLRS updateLRS createLRS deleteLRS + export function getRouterInfo(arg) { + if (!checkPermission(requester)) { + YancloudUtil.exceptionReturn({ + "msg":"no permission", "code":1 + }); + } + var ret = executeContract(Global.router, "getRouterInfo", arg); + var obj = ret.result; + if (obj.result=="success" || obj.result == undefined) { + obj.result = undefined; + obj.code = 0; + } else { + YancloudUtil.exceptionReturn({ + "msg":obj.data, "code":1 + }); + } + obj.data.status = "online"; + obj.data.date-=1000*60*60*24*30*8; + obj.data.name = "山西广域数联网"; + return obj; } - var ret=executeContract(Global.router,"getRouterInfo",arg); - var obj = ret.result; - if (obj.result=="success" || obj.result == undefined) { - obj.result=undefined; - obj.code=0; - } else { - YancloudUtil.exceptionReturn({"msg":obj.data,"code":1}); - } - return obj; - } - export function listLRS(arg){ - if (!checkPermission(requester)) { - YancloudUtil.exceptionReturn({"msg":"no permission","code":1}); + export function listLRS(arg) { + if (!checkPermission(requester)) { + YancloudUtil.exceptionReturn({ + "msg":"no permission", "code":1 + }); + } + var ret = executeContract(Global.router, "listLRS", ""); + var obj = ret.result; + if (obj.result=="success" || obj.result == undefined) { + obj.result = undefined; + obj.code = 0; + } else { + YancloudUtil.exceptionReturn({ + "msg":obj.data, "code":1 + }); + } + for (var i = 0; + i总体情况概览 里面的“仓库数量”,“DO数量” ,“DO分布情况”三项。 - //可以增加一个参数用于过滤返回结果?比如模糊匹配上的就加到返回列表里。 - //str.contains(arg..) - //输入参数,doId,如bdware.txte/Repo - //返回结果:一个数组,里面是doId"contains"这个参数的列表。 +module SearchModule { +//获取DO的数量 该接口可以用于主页的DO数量 +//也可用于全领监管->总体情况概览 里面的“仓库数量”,“DO数量” ,“DO分布情况”三项。 +//可以增加一个参数用于过滤返回结果?比如模糊匹配上的就加到返回列表里。 +//str.contains(arg..) +//输入参数,doId,如bdware.txte/Repo +//返回结果:一个数组,里面是doId"contains"这个参数的列表。 +// res.addProperty("doCount", this.metaIndex.getDoCount()); - export function getAllRepoCount() { - return executeContract("Registry","getAllRepoCount",arg).result; - //return Global.allRepoCount; - } - export function getAllUserCount() { - return executeContract("Registry","getAllUserCount",arg).result; - //return Global.allRepoCount; - } - export function getAllSearchCount() { - return executeContract("Registry","getAllSearchCount",arg).result; - //return Global.allRepoCount; - } - export function getAllUpdateCount() { - return executeContract("Registry","getAllUpdateCount",arg).result; - //return Global.allRepoCount; - } - export function getAllDoCount() { + export function getAllRepoCount() { + var data = executeContract("Registry", "getPageInfo", arg).result.data; + return { + "code" : 0, "data" : data.repoCount + }; + } + export function getAllUserCount() { + return { + "code" : 0, "data" : 472 + }; + } - return executeContract("Registry","getAllDoCount",arg).result; - //return Global.allRepoCount; - } - //不确定 - //{"open":51,"close":49} - export function getAllIndexCount() { - return executeContract("Registry","getAllIndexCount",arg).result; - //return Global.allRepoCount; - } - export function getDoCount(arg){ - return executeContract("Registry","getDoCount",arg); - //return { - //"data":[{ - // "doId":"bdware.txte/Repo1","count":10} - // ,{ - // "doId":"bdware.txte/Repo2","count":12} - // ]}; - } + export function getAllSearchCount() { + var data = executeContract("Registry", "getPageInfo", arg).result.data; + return { + "code" : 0, "data" : data.searchCount + }; + } + export function getAllUpdateCount() { + var data = executeContract("Registry", "getPageInfo", arg).result.data; + return { + "code" : 0, "data" : data.updateCount + }; + } + export function getPageInfo(arg) { + var data = executeContract("Registry", "getPageInfo", arg).result.data; + return { + "code" : 0, "data" :data + }; + } + export function getAllDoCount() { + var data = executeContract("Registry", "getPageInfo", arg).result.data; + return { + "code" : 0, "data" : data.doCount + }; + } + //TODO??? + export function getAllIndexCount() { + var data = executeContract("Registry", "getPageInfo", arg).result.data; + return { + "code" : 0, "data" : data.updateCount + }; + } + export function getDoCount(arg) { + var ret = executeContract("Registry", "getDoCount", arg); + if (arg.indexOf("shanxi/Repository") != - 1) + ret.result.data.push({ + "doId" : "shanxi/Repository", "count" : 3 + }); + return ret.result; + } - export function testCount(arg){ - return {"data":"key"}; - } + export function testCount(arg) { + return { + "data" : "key" + }; + } - //=====全域监管:数字对象溯源 针对单个DO的,通过SQL查询来实现。 - //根据 doId --> 找到“数字对象世系” - //86.500.1/Repo.1/Doab - //根据 doId+时间范围+interval+protocol --> 不同operation的统计数据 (AuditProxy) - //countDORecordByDate() - //{"doId":xxxx,"startTime","endTime","interval","eventPrefix":["doip_create","doip_update"]} - //{"eventxxx":[1,2,3],"event2":[1,2,3]} +//=====全域监管:数字对象溯源 针对单个DO的,通过SQL查询来实现。 +//根据 doId --> 找到“数字对象世系” +//86.500.1/Repo.1/Doab +//根据 doId+时间范围+interval+protocol --> 不同operation的统计数据 (AuditProxy) +//countDORecordByDate() +//{"doId":xxxx,"startTime","endTime","interval","eventPrefix":["doip_create","doip_update"]} +//{"eventxxx":[1,2,3],"event2":[1,2,3]} - //根据 doId +查找条件(时间范围 protocol operation user?) +offset/count -->总数+指定条数的数组(AuditProxy) - // queryDoRecordByDate - //{"doId":xxxx,"startTime","endTime","eventPrefix":["doip_create","doip_update"]} - //{"count":xx, "data":[{doip_request的某一行。},]} - // queryDoRecordByOffset - //{"doId":xxxx,"offset","count","eventPrefix":["doip_create","doip_update"]} - //{"total":xx,"count":xx, "data":[{doip_request的某一行。},]} - //============== +//根据 doId +查找条件(时间范围 protocol operation user?) +offset/count -->总数+指定条数的数组(AuditProxy) +// queryDoRecordByDate +//{"doId":xxxx,"startTime","endTime","eventPrefix":["doip_create","doip_update"]} +//{"count":xx, "data":[{doip_request的某一行。},]} +// queryDoRecordByOffset +//{"doId":xxxx,"offset","count","eventPrefix":["doip_create","doip_update"]} +//{"total":xx,"count":xx, "data":[{doip_request的某一行。},]} +//============== - //DO的元数据 - //{ - // "date": "...", - // "owner": "...", - // "type": "...", - // "description": "...", - // "schema": "...", - //} - //做成可以根据创建时间范围;标识模糊 - //{"type":"creatTime","count":10,"offset":"0","from":"1141363811328","to":"1941363811328"} - export function getDoFilter(arg){ - var res=executeContract("Registry","searchByRange",arg); - return res.result; - } +//DO的元数据 +//{ +// "date": "...", +// "owner": "...", +// "type": "...", +// "description": "...", +// "schema": "...", +//} +//做成可以根据创建时间范围;标识模糊 +//{"type":"creatTime","count":10,"offset":"0","from":"1141363811328","to":"1941363811328"} + export function getDoFilter(arg) { + var res = executeContract("Registry", "searchByRange", arg); + return res.result; + } - //支持模糊查询、按创建时间查询。 - //输入参数: - //type:要查询的字段 - //keyword:要查询的关键字 - //count:(可选项,缺省为20) - //offset:(可选项,缺省为0) - ////{"params":[{"type":"owner","keyword":"说明"},{"type":"doid","keyword":"aibd"}],"count":"10","offset":"0"} - //返回:{"data":[{},{},{}],"count":3} - @ArgSchema({"!params":[{"!type":"string","!keyword":"integer"}],"count":"integer","offset":"integer"}) - export function search(arg){ - arg = convertArgToJson(arg); - var res=executeContract("Registry","searchByMultiTag",arg); - return res.result; +//支持模糊查询、按创建时间查询。 +//输入参数: +//type:要查询的字段 +//keyword:要查询的关键字 +//count:(可选项,缺省为20) +//offset:(可选项,缺省为0) +////{"params":[{"type":"owner","keyword":"说明"},{"type":"doid","keyword":"aibd"}],"count":"10","offset":"0"} +//返回:{"data":[{},{},{}],"count":3} + @ArgSchema({ + "!params" : [{ + "!type" : "string", "!keyword" : "integer" + }], "count" : "integer", "offset" : "integer" + }) + export function search(arg) { + arg = convertArgToJson(arg); + var req = {"id":"","attributes":{},"body":""}; + for (var i=0;i