Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

refactor(article-comments): GQ workflow enhance && re-org#325

Merged
mydearxym merged 21 commits intodevfromcomments-gq-workflow-reorg
Apr 24, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
21 commits
Select commitHold shift + click to select a range
8cef099
chore(article-comments): clean up unused vars
mydearxymApr 20, 2021
25250ee
test(article-comments): add floor & isPined test
mydearxymApr 20, 2021
124c739
test(article-comments): upvotes count test
mydearxymApr 20, 2021
e5eb04f
test(article-comments): basic emotions test flow
mydearxymApr 20, 2021
c7c989b
test(article-comments): improve emotion test
mydearxymApr 21, 2021
3549448
test(article-comments): author flag & basic meta
mydearxymApr 21, 2021
5fbb83f
test(article-comments): replyTo info make right
mydearxymApr 21, 2021
63dd85b
fix(article-comments): emotion perfermence issue
mydearxymApr 21, 2021
967edd4
feat(article-comments): view has upvoted using dataloader
mydearxymApr 21, 2021
36aafc0
refactor(article-comments): rules for delete workflow
mydearxymApr 22, 2021
20996f1
refactor(article-comments): rules for delete workflow && fix tests
mydearxymApr 22, 2021
d3c6c0c
refactor(article-comments): add article_comments_participators_count
mydearxymApr 22, 2021
8500164
refactor(article-comments): list mode wip
mydearxymApr 23, 2021
b166c45
refactor(article-comments): timeline mode done
mydearxymApr 23, 2021
f939ed1
refactor(article-comments): re-org wip
mydearxymApr 23, 2021
d5d316e
refactor(article-comments): re-org wip
mydearxymApr 23, 2021
18858b0
refactor(article-comments): improve replies test
mydearxymApr 23, 2021
04d3680
fix(article-comments): replies edge case & add is_reply_to_others flag
mydearxymApr 24, 2021
fee3ed7
refactor(article-comments): add list_article_comments_participators
mydearxymApr 24, 2021
4eac5ff
refactor(article-comments): helper for raise custom error
mydearxymApr 24, 2021
e241820
refactor(article-comments): clean up
mydearxymApr 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletionslib/groupher_server/cms/article_comment.ex
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ defmodule GroupherServer.CMS.ArticleComment do
# 每篇文章最多含有置顶评论的条数
@pined_comment_limit 10

@doc "latest participators stores in articlecomment_participators field"
@doc "latest participators stores in articlearticle_comment_participators field"
def max_participator_count(), do: @max_participator_count
@doc "latest replies stores in article_comment replies field, used for frontend display"
def max_parent_replies_count(), do: @max_parent_replies_count
Expand All@@ -52,8 +52,6 @@ defmodule GroupherServer.CMS.ArticleComment do
@type t :: %ArticleComment{}
schema "articles_comments" do
field(:body_html, :string)
field(:replies_count, :integer, default: 0)

# 是否被折叠
field(:is_folded, :boolean, default: false)
# 是否被举报
Expand All@@ -76,6 +74,8 @@ defmodule GroupherServer.CMS.ArticleComment do
belongs_to(:reply_to, ArticleComment, foreign_key: :reply_to_id)

embeds_many(:replies, ArticleComment, on_replace: :delete)
field(:replies_count, :integer, default: 0)

embeds_one(:emotions, Embeds.ArticleCommentEmotion, on_replace: :update)
embeds_one(:meta, Embeds.ArticleCommentMeta, on_replace: :update)

Expand Down
13 changes: 8 additions & 5 deletionslib/groupher_server/cms/cms.ex
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,8 +109,9 @@ defmodule GroupherServer.CMS do
defdelegate unset_community(community, thread, content_id), to: ArticleOperation

# Comment CURD
defdelegate list_article_comments(thread, article_id, filters), to: ArticleComment
defdelegate list_article_comments(thread, article_id, filters, user), to: ArticleComment
defdelegate list_article_comments(thread, article_id, filters, mode), to: ArticleComment
defdelegate list_article_comments(thread, article_id, filters, mode, user), to: ArticleComment

defdelegate list_folded_article_comments(thread, article_id, filters), to: ArticleComment
defdelegate list_folded_article_comments(thread, article_id, filters, user), to: ArticleComment
defdelegate list_reported_article_comments(thread, article_id, filters), to: ArticleComment
Expand All@@ -119,9 +120,8 @@ defmodule GroupherServer.CMS do
to: ArticleComment

defdelegate list_comment_replies(comment_id, filters), to: ArticleComment

defdelegate list_comments(thread, content_id, filters), to: CommentCURD
defdelegate list_comments_participators(thread, content_id, filters), to: CommentCURD
defdelegate list_comment_replies(comment_id, filters, user), to: ArticleComment
defdelegate list_article_comments_participators(thread, content_id, filters), to: ArticleComment

defdelegate create_article_comment(thread, article_id, args, user), to: ArticleComment
defdelegate upvote_article_comment(comment_id, user), to: ArticleComment
Expand All@@ -144,6 +144,9 @@ defmodule GroupherServer.CMS do
defdelegate list_replies(thread, comment, user), to: CommentCURD
defdelegate reply_comment(thread, comment, args, user), to: CommentCURD

defdelegate list_comments(thread, content_id, filters), to: CommentCURD
defdelegate list_comments_participators(thread, content_id, filters), to: CommentCURD

# report
defdelegate create_report(type, content_id, args, user), to: AbuseReport

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp