From 1754579a93e433e508ce3b6a5147d16bc2f3e5ad Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 30 May 2019 14:19:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BE=9Bzip=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/myshixun.rb | 3 ++- app/services/games_service.rb | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/models/myshixun.rb b/app/models/myshixun.rb index 774caad9..b5e9df62 100644 --- a/app/models/myshixun.rb +++ b/app/models/myshixun.rb @@ -15,7 +15,8 @@ class Myshixun < ActiveRecord::Base belongs_to :user validates_uniqueness_of :shixun_id, :scope => :user_id, :message => "error" # validates :shixun_id, :uniqueness => {:scope => :user_id, :message => "不能被重复开启"} - scope :min, lambda { select([:id, :shixun_id, :identifier, :gpid, :status, :user_id, :commit_id, :modify_time, :reset_time, :system_tip]) } + scope :min, lambda { select([:id, :shixun_id, :identifier, :gpid, :status, :user_id, :commit_id, :modify_time, :reset_time, + :system_tip, :gpid]) } scope :finished, lambda{where(status: 1)} def output_times diff --git a/app/services/games_service.rb b/app/services/games_service.rb index 630d0848..f09e2dcf 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -89,14 +89,17 @@ class GamesService end url = service_host +":#{res['port']}/vnc_lite.html" Rails.logger.info("66666666sssssss#{url}") - container = container.merge(:vnc_url => url, :test => "666") + container = container.merge(:vnc_url => url) Rails.logger.info("777777666sssssss#{container}") rescue Exception => e Rails.logger.error(e.message) end - end + if myshixun_manager + zip_path = Gitlab.endpoint.to_s + "/projects/" + myshixun.gpid.to_s + "/repository/archive?&private_token=" + Gitlab.private_token.to_s + container = container.merge(:zip_path => zip_path) + end # 区分选择题和编程题,st:0编程题; if st == 0