remove find_by_project_id and change the obtain method of blockchain attributes
This commit is contained in:
parent
d3c3280470
commit
28951b11bf
app
|
@ -57,7 +57,6 @@ module Mobile
|
|||
requires :repo_url, type: String
|
||||
end
|
||||
post 'join' do
|
||||
Rails.logger.info("!!!!!!!!!!in the join service")
|
||||
authenticate!
|
||||
# 根据repo_git_url找到repository对应的项目
|
||||
rs = RepositoriesService.new
|
||||
|
@ -66,7 +65,7 @@ module Mobile
|
|||
blockchain = Blockchain.find_by_project_id(project.id)
|
||||
if blockchain
|
||||
Rails.logger.info("!!!!!!!!!find the project's blockchain info")
|
||||
{status:status, port:blockchain.port, enode:blockchain.enode}
|
||||
{status:status, genesis_content:blockchain["genesis_content"], network_id:blockchain["network_id"], connect_ip:blockchain["connect_ip"], port:blockchain["port"], enode:blockchain["enode"]}
|
||||
else
|
||||
Rails.logger.info("!!!!!!!!!not find the project's blockchain info")
|
||||
{status:-1, message: '数据库有问题,blockchain信息不存在'}
|
||||
|
|
|
@ -3,10 +3,10 @@ class Blockchain < ActiveRecord::Base
|
|||
has_one :project, :dependent => :destroy
|
||||
|
||||
# 根据项目id查找对应区块链配置信息
|
||||
# add by zxh
|
||||
def self.find_by_project_id project_id
|
||||
blockchain = where(:project_id => project_id)
|
||||
blockchain
|
||||
end
|
||||
# # add by zxh
|
||||
# def self.find_by_project_id project_id
|
||||
# blockchain = where(:project_id => project_id)
|
||||
# blockchain
|
||||
# end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue