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