json.images do json.array! @images do |image| json.path image.link json.image_url Util::FileManage.source_disk_file_url(image) end end json.shixuns do json.array! @shixuns do |shixun| json.id shixun.id json.identifier shixun.identifier json.name shixun.name json.status shixun.status json.power (current_user.shixun_permission(shixun)) # 现在首页只显示已发布的实训 # REDO: 局部缓存 json.tag_name @tag_name_map&.fetch(shixun.id, nil) || shixun.tag_repertoires.first.try(:name) json.myshixuns_count shixun.myshixuns_count json.stu_num shixun.myshixuns_count json.score_info shixun.averge_star json.challenges_count shixun.challenges_count #json.exp shixun.all_score json.level level_to_s(shixun.trainee) json.pic Util::FileManage.source_disk_file_url(shixun, '_weapp') end end json.subjects do json.partial! 'subjects/subject', locals: { subjects: @subjects } end