2022-04-19 01:26:59 +00:00
|
|
|
|
module RepoDetail{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getControlProxyConfig(){
|
2022-04-20 04:00:37 +00:00
|
|
|
|
return org.bdware.sc.controlproxy.RepoProxy.getConfig();
|
2022-04-19 01:26:59 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//@wyq 通过DOIP请求
|
|
|
|
|
export function getAuditRule(arg){
|
|
|
|
|
// {"repoId":"xxx"}
|
|
|
|
|
var ret = [];
|
|
|
|
|
ret.push({"displayName":"原始数据存证","desc":"原始数据存证到指定数据库,哈希数据存证","type":2});
|
|
|
|
|
ret.push({"displayName":"哈希数据存证","desc":"仅哈希数据存证","type":1});
|
|
|
|
|
ret.push({"displayName":"不存证","desc":"不存证","type":0 });
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
//@wyq TODO TODO
|
|
|
|
|
// 这个通过DOIPUtil,去调用
|
|
|
|
|
// DOIP的接口。
|
2022-04-20 04:00:37 +00:00
|
|
|
|
@Description("{\"doId\":\"macjw.ab/repofile\"}");
|
2022-04-19 01:26:59 +00:00
|
|
|
|
export function getDoAuditRule(arg){
|
2022-04-20 04:00:37 +00:00
|
|
|
|
arg = convertArgToJson(arg);
|
|
|
|
|
if(arg.count==undefined) arg.count=10;
|
|
|
|
|
if(arg.offset==undefined) arg.offset=0;
|
|
|
|
|
return org.bdware.sc.controlproxy.RepoProxy.getDoAuditRule(arg);
|
2022-04-19 01:26:59 +00:00
|
|
|
|
}
|
|
|
|
|
//@wyq
|
|
|
|
|
export function setDoAuditRule(arg){
|
|
|
|
|
///arg={"doIdList":["dd","ddd.xx/xxx",...],"type":1}
|
|
|
|
|
arg = convertArgToJson(arg);
|
|
|
|
|
if(arg.count==undefined) arg.count=10;
|
|
|
|
|
if(arg.offset==undefined) arg.offset=0;
|
|
|
|
|
return {"msg":"success","code":0};
|
|
|
|
|
}
|
|
|
|
|
//宏伟
|
|
|
|
|
//如果有指定repo,那就是指定repo的DOlist。
|
|
|
|
|
//如果没指定repo,那就是全部的。
|
|
|
|
|
//这是search engine的接口,为什么还没接上??
|
|
|
|
|
//TODO TODO
|
|
|
|
|
export function getDoList(arg){
|
2022-04-20 04:00:37 +00:00
|
|
|
|
print("GetDOList===========");
|
|
|
|
|
var ret = executeContract("SearchEngine","getDoList",arg);
|
|
|
|
|
return ret.result;
|
|
|
|
|
}
|
|
|
|
|
export function getDoList2(arg){
|
2022-04-19 01:26:59 +00:00
|
|
|
|
arg = convertArgToJson(arg);
|
|
|
|
|
//if (arg.doId == null)
|
|
|
|
|
// return {
|
|
|
|
|
// "msg":"missing arguments doId", "code":1, params: arg
|
|
|
|
|
// };
|
|
|
|
|
//if (arg.count>1000)
|
|
|
|
|
// return {
|
|
|
|
|
// "msg":"request to much!", "code":1
|
|
|
|
|
// };
|
|
|
|
|
var ret = [];
|
|
|
|
|
if(arg.count==undefined) arg.count=10;
|
|
|
|
|
if(arg.offset==undefined) arg.offset=0;
|
|
|
|
|
for (var i=arg.offset; i<arg.offset/1.0+arg.count/1.0;i++){
|
|
|
|
|
var fakeDo = {
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
fakeDo.doId="bdware.ss/Repo1/abc"+i;
|
|
|
|
|
fakeDo.originalData={doid:fakeDo.doId,info:"ddddd", tag: ["aaa", "bbb", "ccc"]}
|
|
|
|
|
fakeDo.enableIndex = true
|
|
|
|
|
ret.push(fakeDo);
|
|
|
|
|
}
|
|
|
|
|
return {data: ret, total: 100};
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
export function getRepoTopology(arg){
|
|
|
|
|
arg = convertArgToJson(arg);
|
|
|
|
|
if (arg.doId == null)
|
|
|
|
|
return {
|
|
|
|
|
"msg":"missing arguments doId", "code":1};
|
|
|
|
|
var nodeList = [];
|
|
|
|
|
nodeList.push({
|
|
|
|
|
"name":"小店区仓库","doId":"bdware.ss.ab/Repo1","previousNode":["bdware.ss/Gateway1","bdware.ss/Gateway2"]}
|
|
|
|
|
);
|
|
|
|
|
nodeList.push({
|
|
|
|
|
"name":"太原内部共享网关","doId":"bdware.ss/Gateway1","previousNode":["bdware/Gateway1", "bdware/Gateway2"]}
|
|
|
|
|
);
|
|
|
|
|
nodeList.push({
|
|
|
|
|
"name":"太原对外开放网关","doId":"bdware.ss/Gateway2", "previousNode":["bdware/Gateway1"]}
|
|
|
|
|
);
|
|
|
|
|
nodeList.push({
|
|
|
|
|
"name":"山西内部共享网关","doId":"bdware/Gateway1"}
|
|
|
|
|
);
|
|
|
|
|
nodeList.push({
|
|
|
|
|
"name":"山西内部共享网关2","doId":"bdware/Gateway2"}
|
|
|
|
|
);
|
|
|
|
|
return nodeList;
|
|
|
|
|
}
|
|
|
|
|
//指标1 获取某个repo的DO数量。
|
|
|
|
|
//使用search.yjs里的getDoCount
|
|
|
|
|
//指标2 获取某个repo的操作次数。使用search.yjs中的
|
|
|
|
|
//countRecordByDate
|
|
|
|
|
//参数格式为:
|
|
|
|
|
//{"repoId":"xxx.xxx/xxx","startTime":1641454745128, "endTime":1641454746128,"interval":5000, "eventPrefix":["abc"]}"
|
|
|
|
|
//比如,查询总搜索次数,参数格式为:eventPrefix:["doip_search"]
|
|
|
|
|
//查询调用统计,参数格式为eventPrefix:[""],然后interval/startTime/fromTime传对了就行。
|
|
|
|
|
//索引统计,暂时还没有。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getStaticIndex(arg){
|
|
|
|
|
arg = convertArgToJson(arg);
|
|
|
|
|
if (arg.from==undefined)
|
|
|
|
|
return {
|
|
|
|
|
"msg":"missing arguments: from", "code":1};
|
|
|
|
|
if (arg.to==undefined)
|
|
|
|
|
return {
|
|
|
|
|
"msg":"missing arguments: to", "code":1};
|
|
|
|
|
if (arg.interval==undefined)
|
|
|
|
|
return {
|
|
|
|
|
"msg":"missing arguments: interval", "code":1};
|
|
|
|
|
switch(arg.tag){
|
|
|
|
|
case "search":
|
|
|
|
|
case "index":
|
|
|
|
|
case "call":
|
|
|
|
|
return fakeList(from, to, interval);
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
"msg":"unreconized tag", "code":1};
|
|
|
|
|
}
|
|
|
|
|
function fakeList(from, to, interval){
|
|
|
|
|
var ret =[];
|
|
|
|
|
for (i=from;i<to;i++){
|
|
|
|
|
ret.push(Math.floor(Math.random()*200+20));
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|