add: glcc news management and api data

This commit is contained in:
2022-04-07 16:13:32 +08:00
parent fde01e62ef
commit 8aa935ad5c
13 changed files with 190 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
json.(glcc_news, :id, :title, :url, :uuid)
request_memo = Forum::Memos::GetService.call(glcc_news&.uuid)
json.visits request_memo.nil? ? 0 : request_memo["memo"]["viewed_count"]
json.created_time request_memo.nil? ? format_time(Time.now) : request_memo["memo"]["published_time"]

View File

@@ -17,6 +17,8 @@ json.topics do
json.partial! "excellent_project", locals: {excellent_project: topic}
when "Topic::ExperienceForum"
json.partial! "experience_forum", locals: {experience_forum: topic}
when "Topic::GlccNews"
json.partial! "glcc_news", locals: {glcc_news: topic}
when "Topic::PinnedForum"
json.partial! "pinned_forum", locals: {pinned_forum: topic}
else
@@ -39,6 +41,8 @@ json.topics do
json.partial! "excellent_project", locals: {excellent_project: topic}
when "Topic::ExperienceForum"
json.partial! "experience_forum", locals: {experience_forum: topic}
when "Topic::GlccNews"
json.partial! "glcc_news", locals: {glcc_news: topic}
when "Topic::PinnedForum"
json.partial! "pinned_forum", locals: {pinned_forum: topic}
else