feat: change seach arg

This commit is contained in:
zhaoweijie 2023-08-28 18:16:09 +08:00
parent 635dcb0d48
commit b0b3274a53

View File

@ -68,15 +68,15 @@ module ShanxiRegistry{
return executeContract("ShanxiRegistry","getRelationInfo",arg).result;
}
@ArgSchema({
"!params" : [{
"!type" : "string", "!keyword" : "integer"
"!searchCondition" : [{
"!type" : "string", "!value" : "integer"
}], "count" : "integer", "offset" : "integer"
})
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;
for (var i=0;i<arg.searchCondition.length;i++){
req.attributes[arg.searchCondition[i].type] = arg.searchCondition[i].value;
}
req.attributes["offset"] = arg.offset;
req.attributes["count"] = arg.count;