mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-20 19:55:56 +08:00
新增:疑修悬赏金额验证
This commit is contained in:
@@ -45,4 +45,9 @@ module Api::V1::Issues::Concerns::Checkable
|
||||
def check_parent_journal(parent_id)
|
||||
raise ApplicationService::Error, "ParentJournal不存在!" unless Journal.find_by_id(parent_id).present?
|
||||
end
|
||||
|
||||
def check_blockchain_token_num(user_id, project_id, blockchain_token_num)
|
||||
left_blockchain_token_num = Blockchain::BalanceQueryOneProject.call({"user_id": user_id, "project_id": project_id}) rescue 0
|
||||
raise ApplicationService::Error, "项目Token不足。" if blockchain_token_num > left_blockchain_token_num
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user