新增:token转账列表新增分页参数

This commit is contained in:
2023-03-10 09:22:13 +08:00
parent 8f680fd7c3
commit 841126c0fc
4 changed files with 10 additions and 8 deletions

View File

@@ -8,17 +8,19 @@ class ApplicationQuery
end
# find all the repos that a user has tokens
def find_repo_with_token(user_id)
def find_repo_with_token(user_id, page=1, limit=10)
params = {
"request-type": "query user balance of all repos",
"username": user_id.to_s
"request-type": "query user balance of all repos by page",
"username": user_id.to_s,
"page": page.to_i,
"page_num": limit.to_i
}.to_json
resp_body = Blockchain::InvokeBlockchainApi.call(params)
if resp_body['status'] != 0
raise "区块链接口请求失败."
else
token_list = resp_body['UserBalanceList'].nil? ? [] : resp_body['UserBalanceList']
return token_list
return token_list, resp_body['total_count']
end
end