|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
class HackUserLastestCodesController < ApplicationController
|
|
|
|
|
before_action :require_login, except: [:listen_result]
|
|
|
|
|
before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :sync_code,
|
|
|
|
|
before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :sync_code, :add_notes,
|
|
|
|
|
:listen_result, :result, :submit_records, :restore_initial_code]
|
|
|
|
|
before_action :update_user_hack_status, only: [:code_debug, :code_submit]
|
|
|
|
|
#before_action :require_auth_identity, only: [:restore_initial_code, :sync_code]
|
|
|
|
|
before_action :require_auth_identity, only: [:add_notes]
|
|
|
|
|
before_action :require_manager_identity, only: [:show, :update_code, :restore_initial_code, :sync_code]
|
|
|
|
|
|
|
|
|
|
def show
|
|
|
|
@ -67,7 +67,6 @@ class HackUserLastestCodesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 提交记录详情
|
|
|
|
|
def record_detail
|
|
|
|
|
@hack_user = HackUserCode.find params[:id]
|
|
|
|
@ -109,6 +108,11 @@ class HackUserLastestCodesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def add_notes
|
|
|
|
|
@my_hack.update_attribute(:notes, params[:notes])
|
|
|
|
|
render_ok
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
def find_my_hack
|
|
|
|
|
@my_hack = HackUserLastestCode.find_by(identifier: params[:identifier])
|
|
|
|
|