diff --git a/app/api/mobile/apis/blockchains.rb b/app/api/mobile/apis/blockchains.rb index be378b2d0..8b0836345 100644 --- a/app/api/mobile/apis/blockchains.rb +++ b/app/api/mobile/apis/blockchains.rb @@ -57,6 +57,7 @@ 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 @@ -64,9 +65,10 @@ module Mobile if project blockchain = Blockchain.find_by_project_id(project.id) if blockchain - Rails.logger.info("!!!!!!!this is the return values") + Rails.logger.info("!!!!!!!!!find the project's blockchain info") {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信息不存在'} end else diff --git a/app/services/repositories_service.rb b/app/services/repositories_service.rb index 5ec84d286..c62b1570e 100644 --- a/app/services/repositories_service.rb +++ b/app/services/repositories_service.rb @@ -55,16 +55,21 @@ class RepositoriesService owner = User.find_by_login(owner_name) if owner + Rails.logger.info("!!!!!!!!!!find the owner") projects = Project.find_all_by_user_id(owner.id) if projects.length <= 0 return status, nil else + Rails.logger.info("!!!!!!!!!!!!!find the owner's projects") projects.each do |project| gpid = project.gpid if gpid + Rails.logger.info("!!!!!!!!!!This project has gpid") http_url_to_repo = Gitlab.client.project(gpid).try(:http_url_to_repo) if http_url_to_repo + Rails.logger.info("!!!!!!!!!!!find the repo_url for this gpid") if repo_url == http_url_to_repo + Rails.logger.info("!!!!!!!!!!!!repo_url equals") status = 0 return status, project # 表示找到了 end