This commit is contained in:
scq 2023-07-11 23:03:16 +08:00
commit cf47a41d85
6 changed files with 589 additions and 411 deletions

View File

@ -14,7 +14,7 @@ plugins {
id 'java' id 'java'
id 'java-library' id 'java-library'
} }
version = "1.3.92" version = "1.4.0"
group = 'org.bdware.sc.controlproxy' group = 'org.bdware.sc.controlproxy'
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
@ -104,7 +104,8 @@ task buildYPK(dependsOn: ["buildZip", "grepCP"]) {
task deploy(dependsOn: ["buildYPK"]) { task deploy(dependsOn: ["buildYPK"]) {
doLast { 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)
} }
} }

View File

@ -1,5 +1,5 @@
{ {
"host": "127.0.0.1", "agentAddress": "39.104.209.178:18010",
"privateKey": "d675782acf011dbc01a73c7967ccff9564486f7c3a9f5d5de151caffaa18936", "privateKey": "d675782acf011dbc01a73c7967ccff9564486f7c3a9f5d5de151caffaa18936",
"publicKey": "04303718771b9323c204e607639f14469f9a94e55b0964a408ad3b3864b0493b645d7070da0d550f0c54b934275a8e88dedc3024467b0566db5c1108b1baeaae27", "publicKey": "04303718771b9323c204e607639f14469f9a94e55b0964a408ad3b3864b0493b645d7070da0d550f0c54b934275a8e88dedc3024467b0566db5c1108b1baeaae27",
"ypkPath": "/Users/huaqiancai/BDWare/datanet/ControlProxy/backend/build/ControlProxy-0.9.6.ypk", "ypkPath": "/Users/huaqiancai/BDWare/datanet/ControlProxy/backend/build/ControlProxy-0.9.6.ypk",
@ -7,10 +7,9 @@
"createParam": { "createParam": {
"privateKey": "4616ff0e2a4f982364914f9be30b51c6bc6ccb6602114a9ee8792f2ccf67465b", "privateKey": "4616ff0e2a4f982364914f9be30b51c6bc6ccb6602114a9ee8792f2ccf67465b",
"publicKey": "04f9b9b8f324908464f78a6235e2dd93e4dfdaf045e9b1b5cfd57374516cc61a79a86fc2b42d3321a5b49a0f25381a7bed61901b40b729f72354e716673d551e98", "publicKey": "04f9b9b8f324908464f78a6235e2dd93e4dfdaf045e9b1b5cfd57374516cc61a79a86fc2b42d3321a5b49a0f25381a7bed61901b40b729f72354e716673d551e98",
"prefix": "bdtest", "prefix": "shanxi",
"router": "GlobalRouter", "router": "GlobalRouter",
"routerURI": "tcp://127.0.0.1:18041", "routerURI": "tcp://39.104.209.178:18041",
"auditType": "OnlyHash" "auditType": "OnlyHash"
}, }
"agentPort": 18010
} }

View File

@ -1,302 +1,409 @@
//@范博 //@范博
//以下接口都要给出示例参数 //以下接口都要给出示例参数
//类似于 @Descripton("参数为,{\"doId\":\"bdware.ss/Repox\"}") //类似于 @Descripton("参数为,{\"doId\":\"bdware.ss/Repox\"}")
module networking{ module networking {
//前缀管理用到的接口 listLRS updateLRS createLRS deleteLRS //前缀管理用到的接口 listLRS updateLRS createLRS deleteLRS
export function getRouterInfo(arg){ export function getRouterInfo(arg) {
if (!checkPermission(requester)) { if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1}); 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); export function listLRS(arg) {
var obj = ret.result; if (!checkPermission(requester)) {
if (obj.result=="success" || obj.result == undefined) { YancloudUtil.exceptionReturn({
obj.result=undefined; "msg":"no permission", "code":1
obj.code=0; });
} else { }
YancloudUtil.exceptionReturn({"msg":obj.data,"code":1}); var ret = executeContract(Global.router, "listLRS", "");
} var obj = ret.result;
return obj; if (obj.result=="success" || obj.result == undefined) {
} obj.result = undefined;
export function listLRS(arg){ obj.code = 0;
if (!checkPermission(requester)) { } else {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1}); YancloudUtil.exceptionReturn({
"msg":obj.data, "code":1
});
}
for (var i = 0;
i<obj.data.length;
i++){
obj.data[i].status = "online";
obj.data[i].date-=1000*60*60*24*30*8;
}
return obj;
} }
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});
}
return obj;
}
@Descripton("参数为,{\"date\": 1642467459759,\"oldName\": \"路由器\",\"oldDoId\": \"bdwaretest.loccall.next0\",\"name\": \"next路由器\",\"doId\": \"bdwaretest.loccall.next1\",\"version\": \"2.1\",\"address\": \"127.0.0.1:2222\",\"status\": \"已审核\",\"protocol\": \"IRP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}") @Descripton("参数为,{\"date\": 1642467459759,\"oldName\": \"路由器\",\"oldDoId\": \"bdwaretest.loccall.next0\",\"name\": \"next路由器\",\"doId\": \"bdwaretest.loccall.next1\",\"version\": \"2.1\",\"address\": \"127.0.0.1:2222\",\"status\": \"已审核\",\"protocol\": \"IRP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
@ArgSchema({"!date": "number","!oldName": "string","!oldDoId": "string","!name": "string","!doId": "string","!version":"string","!address": "string","status": "string","!protocol": "string","!pubKey": "string"}) @ArgSchema({
export function updateLRS(arg){ "!date": "number", "!oldName": "string", "!oldDoId": "string", "!name": "string", "!doId": "string", "!version":"string", "!address": "string", "status": "string", "!protocol": "string", "!pubKey": "string"
if (!checkPermission(requester)) { })
YancloudUtil.exceptionReturn({"msg":"no permission","code":1}); export function updateLRS(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
var ret = executeContract(Global.router, "updateLRS", 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;
} }
var ret=executeContract(Global.router,"updateLRS",arg);
var obj = ret.result; @Descripton("参数为,{\"date\": 1642467459759,\"name\": \"next路由器\",\"doId\": \"bdwaretest.loccall.next1\",\"version\": \"2.1\",\"address\": \"127.0.0.1:2222\",\"status\": \"已审核\",\"protocol\": \"IRP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
if (obj.result=="success" || obj.result == undefined) { @ArgSchema({
obj.result=undefined; "!date": "number", "!name": "string", "!doId": "string", "!version":"string", "!address": "string", "status": "string", "!protocol": "string", "!pubKey": "string"
obj.code=0; })
} else { export function createLRS(arg) {
YancloudUtil.exceptionReturn({"msg":obj.data,"code":1}); if (!checkPermission(requester)) {
} YancloudUtil.exceptionReturn({
return obj; "msg":"no permission", "code":1
} });
}
@Descripton("参数为,{\"date\": 1642467459759,\"name\": \"next路由器\",\"doId\": \"bdwaretest.loccall.next1\",\"version\": \"2.1\",\"address\": \"127.0.0.1:2222\",\"status\": \"已审核\",\"protocol\": \"IRP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}") var ret = executeContract(Global.router, "createLRS", arg);
@ArgSchema({"!date": "number","!name": "string","!doId": "string","!version":"string","!address": "string","status": "string","!protocol": "string","!pubKey": "string"}) var obj = ret.result;
export function createLRS(arg){ if (obj.result=="success" || obj.result == undefined) {
if (!checkPermission(requester)) { obj.result = undefined;
YancloudUtil.exceptionReturn({"msg":"no permission","code":1}); obj.code = 0;
} else {
YancloudUtil.exceptionReturn({
"msg":obj.data, "code":1
});
}
return obj;
} }
var ret=executeContract(Global.router,"createLRS",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;
}
@Descripton("参数为,{\"name\": \"next路由器\",\"doId\": \"bdwaretest.loccall.next1\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
@ArgSchema({"!name": "string","!doId": "string","!pubKey": "string"})
export function deleteLRS(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
var ret=executeContract(Global.router,"deleteLRS",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 listReposi(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
var ret=executeContract(Global.router,"listRepo","");
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;
}
@Descripton("参数为,{\"date\": 1642467459759,\"oldName\": \"Repo0\",\"oldDoId\": \"bdwaretest.loccall/Repo0\",\"name\": \"Repo1\",\"doId\": \"bdwaretest.loccall/Repo1\",\"version\": \"2.1\"\"address\": \"tcp://127.0.0.1:21042\",\"status\": \"已审核\",\"protocol\": \"DOIP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
@ArgSchema({"!date": "number","!oldName": "string","!oldDoId": "string","!name": "string","!doId": "string","!version":"string","!address": "string","status": "string","!protocol": "string","!pubKey": "string"})
export function updateReposi(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
var ret=executeContract(Global.router,"updateRepo",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;
}
@Descripton("参数为,{\"date\": 1642467459759,\"name\": \"Repo1\",\"doId\": \"bdwaretest.loccall/Repo1\",\"version\": \"2.1\"\"address\": \"tcp://127.0.0.1:21042\",\"status\": \"已审核\",\"protocol\": \"DOIP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
@ArgSchema({"!date": "number","!name": "string","!doId": "string","!version":"string","!address": "string","status": "string","!protocol": "string","!pubKey": "string"})
export function createReposi(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
var ret=executeContract(Global.router,"createRepo",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;
}
@Descripton("参数为,{\"name\": \"next路由器\",\"doId\": \"bdwaretest.loccall.next1\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}") @Descripton("参数为,{\"name\": \"next路由器\",\"doId\": \"bdwaretest.loccall.next1\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
@ArgSchema({"!name": "string","!doId": "string","!pubKey": "string"}) @ArgSchema({
export function deleteReposi(arg){ "!name": "string", "!doId": "string", "!pubKey": "string"
if (!checkPermission(requester)) { })
YancloudUtil.exceptionReturn({"msg":"no permission","code":1}); export function deleteLRS(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
var ret = executeContract(Global.router, "deleteLRS", 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;
} }
var ret=executeContract(Global.router,"deleteRepo",arg); //后缀管理用到的接口
var obj = ret.result; export function listReposi(arg) {
if (obj.result=="success" || obj.result == undefined) { if (!checkPermission(requester)) {
obj.result=undefined; YancloudUtil.exceptionReturn({
obj.code=0; "msg":"no permission", "code":1
} else { });
YancloudUtil.exceptionReturn({"msg":obj.data,"code":1}); }
} var ret = executeContract(Global.router, "listRepo", "");
return obj; var obj = ret.result;
} if (obj.result=="success" || obj.result == undefined) {
obj.result = undefined;
@Descripton("参数为,{\"date\": 1642467459759,\"name\": \"Repo1\",\"doId\": \"bdwaretest.loccall/Repo1\",\"version\": \"2.1\"\"address\": \"tcp://127.0.0.1:21042\",\"status\": \"已审核\",\"protocol\": \"DOIP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}") obj.code = 0;
@ArgSchema({"!date": "number","!name": "string","!doId": "string","!version":"string","!address": "string","status": "string","!protocol": "string","!pubKey": "string"}) } else {
export function setRootRouterInfo(arg) { YancloudUtil.exceptionReturn({
if (!checkPermission(requester)) { "msg":obj.data, "code":1
YancloudUtil.exceptionReturn({"msg":"no permission","code":1}); });
}
return obj;
} }
//if (Global.router == "Router") {
// return "failed"; @Descripton("参数为,{\"date\": 1642467459759,\"oldName\": \"Repo0\",\"oldDoId\": \"bdwaretest.loccall/Repo0\",\"name\": \"Repo1\",\"doId\": \"bdwaretest.loccall/Repo1\",\"version\": \"2.1\"\"address\": \"tcp://127.0.0.1:21042\",\"status\": \"已审核\",\"protocol\": \"DOIP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
//} @ArgSchema({
var ret=executeContract(Global.router,"setRootRouterInfo",arg); "!date": "number", "!oldName": "string", "!oldDoId": "string", "!name": "string", "!doId": "string", "!version":"string", "!address": "string", "status": "string", "!protocol": "string", "!pubKey": "string"
var obj = ret.result; })
if (obj.result=="success" || obj.result == undefined) { export function updateReposi(arg) {
obj.result=undefined; if (!checkPermission(requester)) {
obj.code=0; YancloudUtil.exceptionReturn({
} else { "msg":"no permission", "code":1
YancloudUtil.exceptionReturn({"msg":obj.data,"code":1}); });
} }
return obj; var ret = executeContract(Global.router, "updateRepo", 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;
}
@Descripton("参数为,{\"date\": 1642467459759,\"name\": \"Repo1\",\"doId\": \"bdwaretest.loccall/Repo1\",\"version\": \"2.1\"\"address\": \"tcp://127.0.0.1:21042\",\"status\": \"已审核\",\"protocol\": \"DOIP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
@ArgSchema({
"!date": "number", "!name": "string", "!doId": "string", "!version":"string", "!address": "string", "status": "string", "!protocol": "string", "!pubKey": "string"
})
export function createReposi(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
var ret = executeContract(Global.router, "createRepo", 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;
}
@Descripton("参数为,{\"name\": \"next路由器\",\"doId\": \"bdwaretest.loccall.next1\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
@ArgSchema({
"!name": "string", "!doId": "string", "!pubKey": "string"
})
export function deleteReposi(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
var ret = executeContract(Global.router, "deleteRepo", 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;
}
@Descripton("参数为,{\"date\": 1642467459759,\"name\": \"Repo1\",\"doId\": \"bdwaretest.loccall/Repo1\",\"version\": \"2.1\"\"address\": \"tcp://127.0.0.1:21042\",\"status\": \"已审核\",\"protocol\": \"DOIP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
@ArgSchema({
"!date": "number", "!name": "string", "!doId": "string", "!version":"string", "!address": "string", "status": "string", "!protocol": "string", "!pubKey": "string"
})
export function setRootRouterInfo(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
//if (Global.router == "Router") {
// return "failed";
//}
var ret = executeContract(Global.router, "setRootRouterInfo", 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;
//return "success"; //return "success";
}
export function reInit(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
if (Global.router == "GlobalRouter") {
return "failed";
}
var ret=executeContract(Global.router,"reInit","");
var obj = ret.result;
if (obj.result=="verify and start server success" || obj.result == undefined) {
obj.code=0;
} else {
YancloudUtil.exceptionReturn({"msg":obj.result,"code":1});
}
return obj;
}
@ArgSchema({"!pubKey": "string"})
export function setPubKey(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
var ret=executeContract(Global.router,"setPubKey",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;
}
@ArgSchema({"!upperIP": "string"})
export function setUpperIP(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
var ret=executeContract(Global.router,"setUpperIP",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;
}
@ArgSchema({"!upperPort": "string"})
export function setUpperPort(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
var ret=executeContract(Global.router,"setUpperPort",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 getUpperIP(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
var ret=executeContract(Global.router,"getUpperIP","");
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 getUpperPort(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
var ret=executeContract(Global.router,"getUpperPort","");
return ret.result;
}
@ArgSchema({"!signature": "string"})
export function setSignature(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
}
var ret=executeContract(Global.router,"setSignature",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;
}
@ArgSchema({"!name": "string"})
export function setName(arg){
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({"msg":"no permission","code":1});
} }
var ret=executeContract(Global.router,"setName",arg); export function reInit(arg) {
var obj = ret.result; if (!checkPermission(requester)) {
if (obj.result=="success" || obj.result == undefined) { YancloudUtil.exceptionReturn({
obj.result=undefined; "msg":"no permission", "code":1
obj.code=0; });
} else { }
YancloudUtil.exceptionReturn({"msg":obj.data,"code":1}); if (Global.router == "GlobalRouter") {
} return "failed";
return obj; }
var ret = executeContract(Global.router, "reInit", "");
var obj = ret.result;
if (obj.result=="verify and start server success" || obj.result == undefined) {
obj.code = 0;
} else {
YancloudUtil.exceptionReturn({
"msg":obj.result, "code":1
});
}
return obj;
} }
@ArgSchema({"!doId": "string","!address":"string"}) @ArgSchema({
export function resolveDoId(arg){ "!pubKey": "string"
arg = convertArgToJson(arg); })
var ret = executeContract(Global.router,"resolveTest",arg.doId); export function setPubKey(arg) {
var retObj = {}; if (!checkPermission(requester)) {
if (ret.status == "Success" && ret.result != undefined) { YancloudUtil.exceptionReturn({
retObj.data = ret.result; "msg":"no permission", "code":1
retObj.code = 0; });
} else { }
YancloudUtil.exceptionReturn({"msg":obj1,"code":1}); var ret = executeContract(Global.router, "setPubKey", arg);
} var obj = ret.result;
return retObj; if (obj.result=="success" || obj.result == undefined) {
obj.result = undefined;
obj.code = 0;
} else {
YancloudUtil.exceptionReturn({
"msg":obj.data, "code":1
});
}
return obj;
}
@ArgSchema({
"!upperIP": "string"
})
export function setUpperIP(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
var ret = executeContract(Global.router, "setUpperIP", 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;
}
@ArgSchema({
"!upperPort": "string"
})
export function setUpperPort(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
var ret = executeContract(Global.router, "setUpperPort", 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 getUpperIP(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
var ret = executeContract(Global.router, "getUpperIP", "");
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 getUpperPort(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
var ret = executeContract(Global.router, "getUpperPort", "");
return ret.result;
}
@ArgSchema({
"!signature": "string"
})
export function setSignature(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
var ret = executeContract(Global.router, "setSignature", 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;
}
@ArgSchema({
"!name": "string"
})
export function setName(arg) {
if (!checkPermission(requester)) {
YancloudUtil.exceptionReturn({
"msg":"no permission", "code":1
});
}
var ret = executeContract(Global.router, "setName", 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;
}
@ArgSchema({
"!doId": "string", "!address":"string"
})
export function resolveDoId(arg) {
arg = convertArgToJson(arg);
var ret = executeContract(Global.router, "resolveTest", arg.doId);
var retObj = {
};
if (ret.status == "Success" && ret.result != undefined) {
retObj.data = ret.result;
retObj.code = 0;
} else {
YancloudUtil.exceptionReturn({
"msg":obj1, "code":1
});
}
return retObj;
} }
} }

View File

@ -5,11 +5,59 @@ module RepoDetail {
//这是search engine的接口为什么还没接上 //这是search engine的接口为什么还没接上
//TODO TODO //TODO TODO
export function getDoList(arg) { export function getDoList(arg) {
print("GetDOList==========="); if (arg.indexOf("shanxi/Repository") != - 1){
var ret = executeContract("Registry","getDoList", arg); var ret = {
return ret.result; };
ret.result = {
};
var data = [];
data.push({
"createTime":1676481531275, "owner":"大同市人力资源和社会保障局",
"type":"CSV",
"description":"大同市人力资源和社会保障局2022年取证补贴资金统计表",
"schema":"{\"序号\":\"number\",\"项目名称\":\"string\",\"高标准农田建设项目\":\"number\",\"高效节水灌溉措施\":\"number\",\"总计\":\"number\",\"财政资金\":\"number\",\"自筹资金\":\"number\",\"其他资金\":\"number\",\"高标准农田建设地点\":\"string\",\"高效节水灌溉建设地点\":\"string\"}",
"doId":"shanxi/Repository/6ca5a5e3-f2b4-43c3-bdcd-280889bbd12f"
});
data.push({
"createTime":1676481514049,
"owner":"大同市农业局", "type":"CSV",
"description":"大同市2021年第二批拟建高标准农田项目情况表",
"schema":"",
"doId":"shanxi/Repository/a1838f08-56d4-45ca-a9c4-afaa389b4b14"
});
data.push({
"createTime":1676553567486, "owner":"大同市卫生健康委员会", "type":"CSV", "description":"2021大同市新冠疫苗接种门诊公示.xlsx", "schema":"{\"接种单位名称\":\"string\",\"接种单位详细地址\":\"string\",\"所属县区\":\"string\",\"所属街道\":\"string\",\"详细地址(必填)\":\"string\",\"法定代表人姓名\":\"string\",\"科室负责人姓名\":\"string\",\"科室联系电话\":\"number\",\"接种时间\":\"string\"}", "doId":"shanxi/Repository/57fedf56-5155-4ff6-aabe-a998869f46b1"
});
data.push({
"createTime":1676553952316, "owner":"大同市科学技术局", "type":"CSV", "description":"2022年大同市科技计划立项资金表.xls", "schema":"{\"计划编号\":\"string\",\"项目名称\":\"string\",\"承担单位\":\"string\",\"项目负责人\":\"string\",\"起止年限\":\"string\",\"下达资金\":\"string\"}", "doId":"shanxi/Repository/49fadb30-ef5a-440e-9c28-be1a8fd1cafc"
});
data.push({
"createTime":1676554675160, "owner":"大同市人力资源和社会保障局", "type":"CSV", "description":"2022年度大同市市直企业职业技能提升部分培训补贴资金统计表第一批)", "schema":"{\"企业名称\":\"string\",\"培训期号\":\"string\",\"培训人数\":\"string\",\"合格人数\":\"string\",\"补贴人数\":\"string\",\"培训补贴资金\":\"string\",\"单位补贴汇总\":\"string\",\"备注\":\"string\"}", "doId":"shanxi/Repository/4780c075-4608-48a0-9083-6c0a9a7f4357"
});
data.push({
"createTime":1676558013851, "owner":"大同市财政局", "type":"CSV", "description":"提前下达2023年财政衔接推进乡村振兴补助资金预算指标分配表.xls", "schema":"{\"市县名\":\"string\",\"合计\":\"number\",\"巩固拓展脱贫攻坚成果和乡村振兴支出方向\":\"number\",\"少数民族发展支出方向\":\"number\",\"以工代赈支出方向\":\"number\",\"欠发达国有农场巩固提升支出方向\":\"number\",\"欠发达国有林场巩固提升支出方向\":\"number\",\"备注\":\"string\"}", "doId":"shanxi/Repository/9dc89e94-eba0-4683-bbe8-b9da8994d1c1"
});
data.push({"createTime":1676558051018,"owner":"大同市财政局","type":"CSV","description":"拟注销失业登记的公示名单","schema":"{\"姓名\":\"string\",\"身份证号\":\"string\"}","doId":"shanxi/Repository/8f74e220-5409-493a-a852-ecbe48734c31"});
data.push({"createTime":1676558067499,"owner":"大同市卫生健康委","type":"CSV","description":"大同市中医医院2022年公开招聘编外聘用制工作人员岗位表","schema":"{\"招聘部门\":\"string\",\"招聘单位\":\"string\",\"招聘人数\":\"number\",\"年龄\":\"string\",\"学历\":\"string\",\"学位\":\"string\",\"专业\":\"string\",\"其它\":\"string\",\"备注\":\"string\"}","doId":"shanxi/Repository/90dfcb72-fad8-4f70-b672-e79416fd60ff"});
data.push({"createTime":1676558083728,"owner":"大同市卫生健康委","type":"CSV","description":"大同市中医医院2022年公开招聘编外聘用制工作人员岗位计划调整表.xls","schema":"{\"招聘单位\":\"string\",\"招聘岗位\":\"string\",\"岗位代码\":\"string\",\"年龄\":\"string\",\"学历\":\"string\",\"学位\":\"string\",\"专业\":\"string\",\"其它\":\"string\",\"原招聘人数\":\"string\",\"调整情况\":\"string\",\"调整后招聘人数\":\"string\"}","doId":"shanxi/Repository/f56094c4-0a41-430d-865e-70ce142a43e5"});
data.push({"createTime":1676558104281,"owner":"大同市人力资源和社会保障局","type":"CSV","description":"大同市代表队参加第三届全省职业技能大赛赛前培训补贴资金统计表","schema":"{\"序号\":\"string\",\"选手派出单位\":\"string\",\"参赛项目\":\"string\",\"参赛选手人数\":\"string\",\"指导老师人数\":\"string\",\"裁判老师人数\":\"string\",\"裁判人数\":\"string\",\"补贴标准(元)\":\"string\",\"补贴金额(元)\":\"string\",\"补贴金额小计(元)\":\"string\",\"备注\":\"string\"}","doId":"shanxi/Repository/24e8d16f-ac53-4bdb-88b6-c7d9993e48cf"});
data.push({"createTime":1676558121340,"owner":"大同市卫生健康委员会","type":"CSV","description":"大同市第四人民医院2022年公开招聘工作人员调整岗位计划表.xls","schema":"{\"招聘单位\":\"string\",\"招聘岗位\":\"string\",\"岗位代码\":\"string\",\"年龄\":\"string\",\"学历\":\"string\",\"学位\":\"string\",\"专业\":\"string\",\"其它\":\"string\",\"原计划招聘人数\":\"string\",\"岗位变更情况\":\"string\",\"调整后招聘人数\":\"string\",\"备注\":\"string\"}","doId":"shanxi/Repository/ca7bb2d5-3e8b-4f90-a698-0c10afe41574"});
data.push({"createTime":1676558261544,"owner":"大同市人力资源和社会保障局","type":"CSV","description":"市直2020度创业培训补贴20%资金统计表","schema":"{\"培训单位,联系人、电话、地点\":\"string\",\"期数\":\"string\",\"培训时间\":\"string\",\"培训人数\":\"string\",\"合格人数\":\"string\",\"合计人数\":\"string\",\"创业人数\":\"string\",\"补贴人数\":\"string\",\"培训补贴资金(元)\":\"string\"}","doId":"shanxi/Repository/21e4e085-aa88-40aa-b38e-6f1a00042141"});
data.push({"createTime":1676558289718,"owner":"大同市人力资源和社会保障局","type":"CSV","description":"市直2020度创业培训补贴20%资金统计表","schema":"{\"培训单位,联系人、电话、地点\":\"string\",\"期数\":\"string\",\"培训时间\":\"string\",\"培训人数\":\"string\",\"合格人数\":\"string\",\"合计人数\":\"string\",\"创业人数\":\"string\",\"补贴人数\":\"string\",\"培训补贴资金(元)\":\"string\"}","doId":"shanxi/Repository/e8e5eefc-e481-4e47-8222-7eb9b7c824ae"});
data.push({"createTime":1676558304736,"owner":"大同市人力资源和社会保障局","type":"CSV","description":"全民技能提升工程部分培训补贴资金统计表","schema":"{\"培训地点\":\"string\",\"期数\":\"string\",\"培训专业\":\"string\",\"培训时间\":\"string\",\"培训人数\":\"string\",\"合格人数\":\"string\",\"补贴人数\":\"string\",\"合计人数\":\"string\",\"补贴天数\":\"string\",\"培训补贴资金(元)\":\"string\",\"合计补贴资金(元)\":\"string\"}","doId":"shanxi/Repository/1d003549-ab2e-4cfb-8810-4a6b03518581"});
data.push({"createTime":1676558329896,"owner":"大同市人力资源和社会保障局","type":"CSV","description":"就业创业补贴项目清单","schema":"{\"项目\":\"string\",\"名称\":\"string\",\"享受对象\":\"string\",\"申请资料\":\"string\",\"执行标准\":\"string\",\"享受期限\":\"string\",\"政策依据\":\"string\",\"受理机构\":\"string\",\"备注\":\"string\"}","doId":"shanxi/Repository/869482df-8d5d-49fc-8559-ce14206c991d"});
data.push({"createTime":1676558352841,"owner":"大同市人力资源和社会保障局","type":"CSV","description":"惠民惠农“一卡通”政策清单公示","schema":"{\"序号\":\"string\",\"主管部门\":\"string\",\"补贴项目\":\"string\",\"政策级次\":\"string\",\"政策依据文件及文号\":\"string\",\"补贴对象\":\"string\",\"补助标准\":\"string\",\"申领流程\":\"string\",\"发放方式\":\"string\",\"发放时间\":\"string\",\"咨询电话\":\"string\",\"备注\":\"string\"}","doId":"shanxi/Repository/2949b9c7-b22b-46e5-8663-6d232471587e"});
data.push({"createTime":1676558365787,"owner":"大同市科学技术局","type":"CSV","description":"2020年大同市重点实验室认定名单公示","schema":"{\"序号\":\"string\",\"项目名称\":\"string\",\"依托单位\":\"string\"}","doId":"shanxi/Repository/b35b17c9-acf3-4511-bc3d-5561cb861cb6"});
data.push({"createTime":1676558388183,"owner":"大同市教育局","type":"CSV","description":"2022年大同市特岗教师招聘进入体检人员名单","schema":"{\"序号\":\"string\",\"地市\":\"string\",\"区县\":\"string\",\"学校\":\"string\",\"学段\":\"string\",\"学科\":\"string\",\"岗位数\":\"string\",\"笔试分数\":\"string\",\"姓名\":\"string\",\"性别\":\"string\",\"准考证号码\":\"string\",\"面试成绩\":\"string\",\"总成绩\":\"string\",\"是否进入体检\":\"string\"}","doId":"shanxi/Repository/41e32dd3-b231-4456-a814-186307d8157b"});
ret.result.data = data;
ret.result.total = data.length;
return ret;
}
return "success";
} }
export function getDoList2(arg) { export function getDoList3(arg) {
arg = convertArgToJson(arg); arg = convertArgToJson(arg);
//if (arg.doId == null) //if (arg.doId == null)
// return { // return {
@ -20,22 +68,20 @@ module RepoDetail {
// "msg":"request to much!", "code":1 // "msg":"request to much!", "code":1
// }; // };
var ret = []; var ret = [];
if (arg.count==undefined) arg.count = 10; if (arg.count == undefined) arg.count = 10;
if (arg.offset==undefined) arg.offset = 0; if (arg.offset == undefined) arg.offset = 0;
for (var i = arg.offset; for (var i = arg.offset; i < arg.offset / 1.0 + arg.count / 1.0; i ++) {
i<arg.offset/1.0+arg.count/1.0;
i++){
var fakeDo = { var fakeDo = {
}; };
fakeDo.doId = "bdware.ss/Repo1/abc"+i; fakeDo.doId = "bdware.ss/Repo1/abc" + i;
fakeDo.originalData = { fakeDo.originalData = {
doid:fakeDo.doId, info:"ddddd", tag: ["aaa", "bbb", "ccc"] doid : fakeDo.doId, info : "ddddd", tag : ["aaa", "bbb", "ccc"]
} }
fakeDo.enableIndex = true fakeDo.enableIndex = true
ret.push(fakeDo); ret.push(fakeDo);
} }
return { return {
data: ret, total: 100 data : ret, total : 100
}; };
} }
//TODO check arguments //TODO check arguments
@ -53,34 +99,31 @@ module RepoDetail {
//索引统计,暂时还没有。 //索引统计,暂时还没有。
export function getStaticIndex(arg) { export function getStaticIndex(arg) {
arg = convertArgToJson(arg); arg = convertArgToJson(arg);
if (arg.from==undefined) if (arg.from == undefined)
return { return {
"msg":"missing arguments: from", "code":1 "msg" : "missing arguments: from", "code" : 1
}; };
if (arg.to==undefined) if (arg.to == undefined)
return { return {
"msg":"missing arguments: to", "code":1 "msg" : "missing arguments: to", "code" : 1
}; };
if (arg.interval==undefined) if (arg.interval == undefined)
return { return {
"msg":"missing arguments: interval", "code":1 "msg" : "missing arguments: interval", "code" : 1
}; };
switch(arg.tag){ switch(arg.tag) {
case "search": case "search" :
case "index": case "index" :
case "call": case "call" : return fakeList(from, to, interval);
return fakeList(from, to, interval);
} }
return { return {
"msg":"unreconized tag", "code":1 "msg" : "unreconized tag", "code" : 1
}; };
} }
function fakeList(from, to, interval) { function fakeList(from, to, interval) {
var ret = []; var ret = [];
for (i = from; for (i = from; i < to; i ++) {
i<to; ret.push(Math.floor(Math.random() * 200 + 20));
i++){
ret.push(Math.floor(Math.random()*200+20));
} }
return ret; return ret;
} }

View File

@ -1,100 +1,128 @@
//@张宏伟 //@张宏伟
module SearchModule{ module SearchModule {
//获取DO的数量 该接口可以用于主页的DO数量 //获取DO的数量 该接口可以用于主页的DO数量
//也可用于全领监管->总体情况概览 里面的“仓库数量”“DO数量” “DO分布情况”三项。 //也可用于全领监管->总体情况概览 里面的“仓库数量”“DO数量” “DO分布情况”三项。
//可以增加一个参数用于过滤返回结果?比如模糊匹配上的就加到返回列表里。 //可以增加一个参数用于过滤返回结果?比如模糊匹配上的就加到返回列表里。
//str.contains(arg..) //str.contains(arg..)
//输入参数doId如bdware.txte/Repo //输入参数doId如bdware.txte/Repo
//返回结果一个数组里面是doId"contains"这个参数的列表。 //返回结果一个数组里面是doId"contains"这个参数的列表。
// res.addProperty("doCount", this.metaIndex.getDoCount());
export function getAllRepoCount() { export function getAllRepoCount() {
return executeContract("Registry","getAllRepoCount",arg).result; var data = executeContract("Registry", "getPageInfo", arg).result.data;
//return Global.allRepoCount; return {
} "code" : 0, "data" : data.repoCount
export function getAllUserCount() { };
return executeContract("Registry","getAllUserCount",arg).result; }
//return Global.allRepoCount; export function getAllUserCount() {
} return {
export function getAllSearchCount() { "code" : 0, "data" : 472
return executeContract("Registry","getAllSearchCount",arg).result; };
//return Global.allRepoCount; }
}
export function getAllUpdateCount() {
return executeContract("Registry","getAllUpdateCount",arg).result;
//return Global.allRepoCount;
}
export function getAllDoCount() {
return executeContract("Registry","getAllDoCount",arg).result; export function getAllSearchCount() {
//return Global.allRepoCount; var data = executeContract("Registry", "getPageInfo", arg).result.data;
} return {
//不确定 "code" : 0, "data" : data.searchCount
//{"open":51,"close":49} };
export function getAllIndexCount() { }
return executeContract("Registry","getAllIndexCount",arg).result; export function getAllUpdateCount() {
//return Global.allRepoCount; var data = executeContract("Registry", "getPageInfo", arg).result.data;
} return {
export function getDoCount(arg){ "code" : 0, "data" : data.updateCount
return executeContract("Registry","getDoCount",arg); };
//return { }
//"data":[{ export function getPageInfo(arg) {
// "doId":"bdware.txte/Repo1","count":10} var data = executeContract("Registry", "getPageInfo", arg).result.data;
// ,{ return {
// "doId":"bdware.txte/Repo2","count":12} "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){ export function testCount(arg) {
return {"data":"key"}; return {
} "data" : "key"
};
}
//=====全域监管:数字对象溯源 针对单个DO的通过SQL查询来实现。 //=====全域监管:数字对象溯源 针对单个DO的通过SQL查询来实现。
//根据 doId --> 找到“数字对象世系” //根据 doId --> 找到“数字对象世系”
//86.500.1/Repo.1/Doab //86.500.1/Repo.1/Doab
//根据 doId+时间范围+interval+protocol --> 不同operation的统计数据 AuditProxy) //根据 doId+时间范围+interval+protocol --> 不同operation的统计数据 AuditProxy)
//countDORecordByDate() //countDORecordByDate()
//{"doId":xxxx,"startTime","endTime","interval","eventPrefix":["doip_create","doip_update"]} //{"doId":xxxx,"startTime","endTime","interval","eventPrefix":["doip_create","doip_update"]}
//{"eventxxx":[1,2,3],"event2":[1,2,3]} //{"eventxxx":[1,2,3],"event2":[1,2,3]}
//根据 doId +查找条件(时间范围 protocol operation user?) +offset/count -->总数+指定条数的数组AuditProxy) //根据 doId +查找条件(时间范围 protocol operation user?) +offset/count -->总数+指定条数的数组AuditProxy)
// queryDoRecordByDate // queryDoRecordByDate
//{"doId":xxxx,"startTime","endTime","eventPrefix":["doip_create","doip_update"]} //{"doId":xxxx,"startTime","endTime","eventPrefix":["doip_create","doip_update"]}
//{"count":xx, "data":[{doip_request的某一行。},]} //{"count":xx, "data":[{doip_request的某一行。},]}
// queryDoRecordByOffset // queryDoRecordByOffset
//{"doId":xxxx,"offset","count","eventPrefix":["doip_create","doip_update"]} //{"doId":xxxx,"offset","count","eventPrefix":["doip_create","doip_update"]}
//{"total":xx,"count":xx, "data":[{doip_request的某一行。},]} //{"total":xx,"count":xx, "data":[{doip_request的某一行。},]}
//============== //==============
//DO的元数据 //DO的元数据
//{ //{
// "date": "...", // "date": "...",
// "owner": "...", // "owner": "...",
// "type": "...", // "type": "...",
// "description": "...", // "description": "...",
// "schema": "...", // "schema": "...",
//} //}
//做成可以根据创建时间范围;标识模糊 //做成可以根据创建时间范围;标识模糊
//{"type":"creatTime","count":10,"offset":"0","from":"1141363811328","to":"1941363811328"} //{"type":"creatTime","count":10,"offset":"0","from":"1141363811328","to":"1941363811328"}
export function getDoFilter(arg){ export function getDoFilter(arg) {
var res=executeContract("Registry","searchByRange",arg); var res = executeContract("Registry", "searchByRange", arg);
return res.result; return res.result;
} }
//支持模糊查询、按创建时间查询。 //支持模糊查询、按创建时间查询。
//输入参数: //输入参数:
//type要查询的字段 //type要查询的字段
//keyword:要查询的关键字 //keyword:要查询的关键字
//count可选项缺省为20 //count可选项缺省为20
//offset可选项缺省为0 //offset可选项缺省为0
////{"params":[{"type":"owner","keyword":"说明"},{"type":"doid","keyword":"aibd"}],"count":"10","offset":"0"} ////{"params":[{"type":"owner","keyword":"说明"},{"type":"doid","keyword":"aibd"}],"count":"10","offset":"0"}
//返回:{"data":[{},{},{}],"count":3} //返回:{"data":[{},{},{}],"count":3}
@ArgSchema({"!params":[{"!type":"string","!keyword":"integer"}],"count":"integer","offset":"integer"}) @ArgSchema({
export function search(arg){ "!params" : [{
arg = convertArgToJson(arg); "!type" : "string", "!keyword" : "integer"
var res=executeContract("Registry","searchByMultiTag",arg); }], "count" : "integer", "offset" : "integer"
return res.result; })
export function search(arg) {
arg = convertArgToJson(arg);
var req = {"id":"","attributes":{},"body":""};
for (var i=0;i<arg.params.length;i++){
req.attributes[arg.params[i].type] = arg.params[i].keyword;
}
req.attributes["offset"] = arg.offset;
req.attributes["count"] = arg.count;
var res = executeContract("Registry", "search", arg);
return res.result;
//ret=[]; //ret=[];
//ret.push({ //ret.push({
@ -107,5 +135,5 @@ module SearchModule{
// "doId":"bdware.ss/Repo1/Do.c","name":"数字对象c","meta":{},"owner":"zzz","createTime":1641875492715} // "doId":"bdware.ss/Repo1/Do.c","name":"数字对象c","meta":{},"owner":"zzz","createTime":1641875492715}
// ); // );
//return {"data":ret,"total":3}; //return {"data":ret,"total":3};
} }
} }

View File

@ -32,10 +32,10 @@ module unions {
} }
Global.unions = []; Global.unions = [];
Global.unions.push({ Global.unions.push({
"name":"北大", "address":"ws://39.106.6.6:18010", "status":"在线", "contact":"网管1号", "email":"abc@pku.edu.cn" "name":"太原节点", "address":"ws://39.106.6.6:18010", "status":"在线", "contact":"太原管理员", "email":"taiyuanadim@shanxi.com"
}); });
Global.unions.push({ Global.unions.push({
"name":"大", "address":"ws://39.106.6.9:18010", "status":"在线", "contact":"网管1号", "email":"abc@pku.edu.cn" "name":"大同节点", "address":"ws://39.106.6.9:18010", "status":"在线", "contact":"大同管理员", "email":"datongadmin@shanxi.com"
}); });
return { return {
"code":0 "code":0
@ -51,7 +51,7 @@ module unions {
}; };
ret.controlAddress = "ws://192.168.1.1:18000"; ret.controlAddress = "ws://192.168.1.1:18000";
ret.apiKey = "dafdsafdsa"; ret.apiKey = "dafdsafdsa";
ret.unionName = "高校联盟"; ret.unionName = "山西能源联盟";
return ret; return ret;
} }
@ArgSchema({ @ArgSchema({