mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 12:45:46 +08:00
新增:token转账列表新增分页参数
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user