dev_daiao
daiao 5 years ago
parent 1744102a5b
commit d1e6770428

@ -68,6 +68,7 @@ class HackUserLastestCodesController < ApplicationController
# 提交记录详情
def record_detail
@hack_user = HackUserCode.find params[:id]
@my_hack = @hack_user.hack_user_lastest_code
end
# 接收中间件返回结果接口

@ -1,6 +1,7 @@
class HackUserCode < ApplicationRecord
# 用户编程题的信息
belongs_to :hack
belongs_to :hack_user_lastest_code
scope :created_order, ->{ order("created_at desc")}
end

@ -1,4 +1,8 @@
json.(@hack_user, :id, :status, :error_line, :error_msg, :expected_output,
:input, :output, :execute_time, :execute_memory, :created_at, :code)
json.language @hack_user.hack.language
json.name @hack_user.hack.name
json.name @hack_user.hack.name
json.myproblem_identifier @my_hack.identifier
json.user do
json.partial! 'users/user', user: current_user
end
Loading…
Cancel
Save