getPreviewMapResult
This commit is contained in:
@@ -53,27 +53,54 @@ module metaStandardDetail {
|
||||
"total":10, "data":ret, "code":0
|
||||
};
|
||||
}
|
||||
//{如果是offset+count,就按顺序,
|
||||
// 如果是offset+count,就按顺序,
|
||||
// controlType=过滤
|
||||
// createStartDate createEndDate
|
||||
// updateStartDate updateEndDate
|
||||
// 如果是keyword:... 就模糊搜索}
|
||||
// 如果是keyword:... 就模糊搜索
|
||||
// registryID
|
||||
//{"createStartDate":16111,"createEndDate":12222,"offset":0,"count":5}
|
||||
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":[
|
||||
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":"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":{
|
||||
@@ -137,29 +164,36 @@ module metaStandardDetail {
|
||||
|
||||
//{"localMetaID":"xxx","mapRule":{},"remoteMetaID":"xxx"}
|
||||
export function getPreviewMapResult(arg) {
|
||||
return {
|
||||
"code":0, data:{
|
||||
"localData":{
|
||||
"大小":"500KB", "姓名":"小东"
|
||||
}, "remoteData":{
|
||||
"size":"500000Byte", "name":"*东"
|
||||
}
|
||||
}
|
||||
};
|
||||
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,"....."}
|
||||
}
|
||||
function convertArgToJson(arg) {
|
||||
if (typeof(arg)=='string') return JSON.parse(arg);
|
||||
return arg;
|
||||
}
|
||||
|
||||
//{"localDataSample":{},"mapRule":{},"remoteMetaID":"xxx"}
|
||||
export function getMapResult(arg) {
|
||||
arg = convertArgToJson(arg);
|
||||
var ret = {
|
||||
};
|
||||
var ret = {};
|
||||
ret.data = org.bdware.sc.registry.RuleExecutor.executeRule(arg);
|
||||
ret.code = org.bdware.sc.registry.RuleExecutor.getLastExecuteStatus();
|
||||
return ret;
|
||||
}
|
||||
|
||||
function convertArgToJson(arg) {
|
||||
if (typeof(arg)=='string') return JSON.parse(arg);
|
||||
return arg;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user