完成部分metaDetail函数
This commit is contained in:
@@ -1,56 +1,100 @@
|
||||
module metaStandardDetail {
|
||||
export function getRegistryInfo(arg) {
|
||||
return {
|
||||
"code":0, "registryID":"macjw.ab", "description":"这是xx市的注册表,添加更多Registry描述"
|
||||
};
|
||||
arg = convertArgToJson(arg);
|
||||
var ret = {};
|
||||
ret.registryID = arg.registryID;
|
||||
ret.description = org.bdware.sc.registry.RegistryDB.getRegistryInfo(arg);
|
||||
ret.code = org.bdware.sc.registry.RegistryDB.getLastExecuteStatus();
|
||||
return ret;
|
||||
// return {
|
||||
// "code":0,
|
||||
// "registryID":"macjw.ab",
|
||||
// "description":"这是xx市的注册表,添加更多Registry描述"
|
||||
// };
|
||||
}
|
||||
|
||||
export function verifyRule(arg) {
|
||||
return {
|
||||
"code":0, "msg":"success"
|
||||
}
|
||||
|
||||
|
||||
|
||||
arg = convertArgToJson(arg);
|
||||
var ret = {};
|
||||
org.bdware.sc.registry.RuleExecutor.executeRule(arg);
|
||||
ret.code = org.bdware.sc.registry.RuleExecutor.getLastExecuteStatus();
|
||||
ret.msg = org.bdware.sc.registry.RuleExecutor.getLastExecuteMsg();
|
||||
return ret;
|
||||
// return {
|
||||
// "code":0,
|
||||
// "msg":"success"
|
||||
// }
|
||||
}
|
||||
|
||||
export function getFieldTypeList(arg) {
|
||||
return {
|
||||
"code":0, "data":[
|
||||
{
|
||||
"typeName":"string", "lable":"字符串", "formDesc":{
|
||||
"固定值":{
|
||||
"type":"input"
|
||||
}, "默认值":{
|
||||
"type":"input"
|
||||
}, "最小长度":{
|
||||
"type":"input"
|
||||
}, "最大长度":{
|
||||
"type":"input"
|
||||
}, "必备项":{
|
||||
"type":"select", "options":["是", "否"]
|
||||
}, }
|
||||
}, {
|
||||
"typeName":"boolean", "lable":"真假", "formDesc":{
|
||||
"固定值":{
|
||||
"type":"input"
|
||||
}, "默认值":{
|
||||
"type":"input"
|
||||
}, "必备项":{
|
||||
"type":"select", "options":["是", "否"]
|
||||
}, }
|
||||
}, ]
|
||||
"code":0,
|
||||
"data":[
|
||||
{
|
||||
"typeName":"string",
|
||||
"lable":"字符串",
|
||||
"formDesc":{
|
||||
"固定值":{
|
||||
"type":"input"
|
||||
},
|
||||
"默认值":{
|
||||
"type":"input"
|
||||
},
|
||||
"最小长度":{
|
||||
"type":"input"
|
||||
},
|
||||
"最大长度":{
|
||||
"type":"input"
|
||||
},
|
||||
"必备项":{
|
||||
"type":"select",
|
||||
"options":[
|
||||
"是",
|
||||
"否"
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
"typeName":"boolean",
|
||||
"lable":"真假",
|
||||
"formDesc":{
|
||||
"固定值":{
|
||||
"type":"input"
|
||||
},
|
||||
"默认值":{
|
||||
"type":"input"
|
||||
},
|
||||
"必备项":{
|
||||
"type":"select",
|
||||
"options":[
|
||||
"是",
|
||||
"否"
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
export function listRemoteRegistry() {
|
||||
var ret = [
|
||||
{
|
||||
"registryID":"macjw", "name":"jw市市级注册"
|
||||
}, {
|
||||
"registryID":"macjw.de.cd", "name":"jw市de县cd镇注册表"
|
||||
}
|
||||
arg = convertArgToJson(arg);
|
||||
var ret = [];
|
||||
|
||||
var ret = [{
|
||||
"registryID":"macjw",
|
||||
"name":"jw市市级注册"
|
||||
},
|
||||
{
|
||||
"registryID":"macjw.de.cd",
|
||||
"name":"jw市de县cd镇注册表"
|
||||
}
|
||||
];
|
||||
return {
|
||||
"total":10, "data":ret, "code":0
|
||||
"total":10,
|
||||
"data":ret,
|
||||
"code":0
|
||||
};
|
||||
}
|
||||
// 如果是offset+count,就按顺序,
|
||||
@@ -59,94 +103,22 @@ module metaStandardDetail {
|
||||
// updateStartDate updateEndDate
|
||||
// 如果是keyword:... 就模糊搜索
|
||||
// registryID
|
||||
//{"createStartDate":16111,"createEndDate":12222,"offset":0,"count":5}
|
||||
// {"createStartDate":1651334400000,"createEndDate":1653790428000,"offset":0,"count":2}
|
||||
|
||||
export function listMetaStandard(arg) {
|
||||
var ret = [];
|
||||
ret.push(
|
||||
{
|
||||
"name":"CO传感数据",
|
||||
"createDate":167227222,
|
||||
"updateDate":1111111,
|
||||
"creator":"xxx",
|
||||
"updater":"aabbcc",
|
||||
"registryID":"macjw.ab",
|
||||
"controlType":"private",
|
||||
"typeList":[
|
||||
"public",
|
||||
"private"
|
||||
],
|
||||
"status":"off",
|
||||
"version":"2.1",
|
||||
"doId":"ab.ccd/aaaaa-aaa",
|
||||
"desc":"元数据标准说明",
|
||||
"fields":[
|
||||
{
|
||||
"name":"owner",
|
||||
"type":"string",
|
||||
"description":"简要的说明",
|
||||
"constraint":{
|
||||
"固定值":"xxxxx",
|
||||
"最大长度":50,
|
||||
"必备项":"是"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name":"pubkey",
|
||||
"type":"string",
|
||||
"description":"pubkey简要的说明2",
|
||||
"constraint":{
|
||||
"固定值":"jjjjjjj", "最大长度":50
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"BF传感数据", "createDate":167226222, "updateDate":1111311, "creator":"xxx", "updater":"aabbcc", "registryID":"macjw", "controlType":"public", "typeList":["public", "private"], "status":"on", "version":"2.1", "doId":"ab.ccd/aabbbaa-aaa", "desc":"元数据标准说明", "fields":[
|
||||
{
|
||||
"name":"repository", "type":"string", "description":"简要的说明", "constraint":{
|
||||
"固定值":"xxx", "最大长度":50, "必备项":"是", }
|
||||
}, {
|
||||
"name":"format", "type":"boolean", "description":"简要的说明2", "constraint":{
|
||||
"必备项":"否"
|
||||
}
|
||||
}, {
|
||||
"name":"registertime", "type":"string", "description":"registertime简要的说明333333333", "constraint":{
|
||||
"固定值":"ooooo", "默认值":"hhhhhhhh", "最小长度":10, "必备项":"否", }
|
||||
}, ]
|
||||
}, {
|
||||
"name":"AA传感数据", "createDate":167227222, "updateDate":1111111, "creator":"xxx", "updater":"aabbcc", "registryID":"macjw.ab", "controlType":"private", "typeList":["public", "private"], "status":"off", "version":"2.1", "doId":"ab.ccd/adddda-aaa", "desc":"元数据标准说明", "fields":[
|
||||
{
|
||||
"name":"owner", "type":"string", "description":"简要的说明", "constraint":{
|
||||
"固定值":"xxxxx", "最大长度":50, "必备项":"是", }
|
||||
}, {
|
||||
"name":"pubkey", "type":"string", "description":"pubkey简要的说明2", "constraint":{
|
||||
"固定值":"jjjjjjj", "最大长度":50
|
||||
}
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"name":"HHH传感数据", "createDate":167227222, "updateDate":1111111, "creator":"xxx", "updater":"aabbcc", "registryID":"macjw.ac", "controlType":"private", "typeList":["public", "private"], "status":"on", "version":"2.1", "doId":"ab.ccd/aggga-aaa", "desc":"元数据标准说明", "fields":[
|
||||
{
|
||||
"name":"owner", "type":"string", "description":"简要的说明", "constraint":{
|
||||
"固定值":"xxxxx", "最大长度":50, "必备项":"是", }
|
||||
}, {
|
||||
"name":"pubkey", "type":"string", "description":"pubkey简要的说明2", "constraint":{
|
||||
"固定值":"jjjjjjj", "最大长度":50
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
return {
|
||||
"total":10, "data":ret, "code":0
|
||||
};
|
||||
arg = convertArgToJson(arg);
|
||||
var ret = org.bdware.sc.registry.RegistryDB.queryMetaStandardsByTimeAndOffset(arg);
|
||||
ret.code = org.bdware.sc.registry.RegistryDB.getLastExecuteStatus();
|
||||
return ret;
|
||||
}
|
||||
|
||||
export function updateMetaStandardDetail(arg) {
|
||||
var ret = [];
|
||||
//通知对应的远程注册表,需要更新这个关系。
|
||||
return {
|
||||
"total":10, "data":ret, "code":0
|
||||
"total":10,
|
||||
"data":ret,
|
||||
"code":0
|
||||
};
|
||||
}
|
||||
|
||||
@@ -154,11 +126,22 @@ module metaStandardDetail {
|
||||
export function listMetaStandardRelaction(arg) {
|
||||
var ret = [];
|
||||
ret.push({
|
||||
"name":"煤矿传感数据映射", "localMetaStandardDoid":"xx.xx/adfa", "remoteMetaStandardDoid":"ab.ccd/aaaaa-aaa", "createDate":167227222, "updateDate":1111111, "creator":"aabbcc", "updater":"aabbcc", "mapRule":{
|
||||
"owner":"${val.大小}", "pubkey":"function(val){}", }
|
||||
"name":"煤矿传感数据映射",
|
||||
"localMetaStandardDoid":"xx.xx/adfa",
|
||||
"remoteMetaStandardDoid":"ab.ccd/aaaaa-aaa",
|
||||
"createDate":167227222,
|
||||
"updateDate":1111111,
|
||||
"creator":"aabbcc",
|
||||
"updater":"aabbcc",
|
||||
"mapRule":{
|
||||
"owner":"${val.大小}",
|
||||
"pubkey":"function(val){}",
|
||||
}
|
||||
});
|
||||
return {
|
||||
"total":10, "data":ret, "code":0
|
||||
"total":10,
|
||||
"data":ret,
|
||||
"code":0
|
||||
};
|
||||
}
|
||||
|
||||
@@ -167,20 +150,6 @@ module metaStandardDetail {
|
||||
arg = convertArgToJson(arg);
|
||||
arg.localDataSample = org.bdware.sc.registry.RegistryDB.querySampleByMetaID(arg);
|
||||
return getMapResult(arg);
|
||||
|
||||
// return {
|
||||
// "code":0,
|
||||
// "data":{
|
||||
// "localData": {
|
||||
// "大小":"500KB", "姓名":"小东"
|
||||
// },
|
||||
// "remoteData":{
|
||||
// "size":"500000Byte", "name":"*东"
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
//TODO 返回映射格式有误
|
||||
// return {"code":1,"....."}
|
||||
}
|
||||
|
||||
//{"localDataSample":{},"mapRule":{},"remoteMetaID":"xxx"}
|
||||
|
||||
Reference in New Issue
Block a user