json.count @count json.libraries do json.array! @libraries.each do |library| json.extract! library, :id, :title, :content, :author_name, :author_school_name, :status, :visited_count json.cover_url library.cover_id.present? ? download_url(library.cover) : nil json.praise_count library.praise_tread_cache&.praise_num || 0 json.download_count @download_count_map.fetch(library.id, 0) json.published_at library.display_published_at json.created_at library.display_created_at json.tags library.library_tags.map(&:name) end end