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.

Commitdb723ec

Browse files
authored
refactor(config): rename article_xxx -> xxx (#380)
* refactor(config): rename article_threads -> threads* refactor(config): rename supported_emotions -> emotions* chore: clean up unused warnings* chore: enhance active_at tests
1 parent690bf55 commitdb723ec

File tree

37 files changed

+59
-70
lines changed

37 files changed

+59
-70
lines changed

‎config/config.exs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ config :groupher_server, :customization,
6262

6363
config:groupher_server,:article,
6464
# NOTE: do not change unless you know what you are doing
65-
article_threads:[:post,:job,:repo],
65+
threads:[:post,:job,:repo],
6666
# in this period, paged articles will sort front if non-article-author commented
6767
# 在此时间段内,一旦有非文章作者的用户评论,该文章就会排到前面
6868
active_period_days:%{
@@ -73,7 +73,7 @@ config :groupher_server, :article,
7373

7474
# NOTE: if you want to add/remove emotion, just edit the list below
7575
# and migrate the field to table "articles_users_emotions"
76-
supported_emotions:[
76+
emotions:[
7777
:upvote,
7878
:downvote,
7979
:beer,
@@ -86,7 +86,7 @@ config :groupher_server, :article,
8686
],
8787
# NOTE: if you want to add/remove emotion, just edit the list below
8888
# and migrate the field to table "articles_comments_users_emotions"
89-
comment_supported_emotions:[
89+
comment_emotions:[
9090
:downvote,
9191
:beer,
9292
:heart,

‎lib/groupher_server/accounts/delegates/collect_folder.ex‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ defmodule GroupherServer.Accounts.Delegate.CollectFolder do
2424
# @max_article_count_per_collect_folder 300
2525

2626
@default_metaEmbeds.CollectFolderMeta.default_meta()
27-
@article_threadsget_config(:article,:article_threads)
27+
@article_threadsget_config(:article,:threads)
2828

2929
@doc"""
3030
list a user's not-private collect folders

‎lib/groupher_server/accounts/delegates/upvoted_articles.ex‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defmodule GroupherServer.Accounts.Delegate.UpvotedArticles do
1111
aliasGroupherServer.CMS
1212
aliasCMS.{ArticleUpvote}
1313

14-
@article_threadsget_config(:article,:article_threads)
14+
@article_threadsget_config(:article,:threads)
1515

1616
@doc"""
1717
get paged upvoted articles

‎lib/groupher_server/accounts/embeds/collect_folder_meta.ex‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule GroupherServer.Accounts.Embeds.CollectFolderMeta.Macros do
1212
"""
1313
importHelper.Utils,only:[get_config:2]
1414

15-
@article_threadsget_config(:article,:article_threads)
15+
@article_threadsget_config(:article,:threads)
1616

1717
defmacrothreads_fields()do
1818
@article_threads
@@ -34,7 +34,7 @@ defmodule GroupherServer.Accounts.Embeds.CollectFolderMeta do
3434
importGroupherServer.Accounts.Embeds.CollectFolderMeta.Macros
3535
importHelper.Utils,only:[get_config:2]
3636

37-
@article_threadsget_config(:article,:article_threads)
37+
@article_threadsget_config(:article,:threads)
3838

3939
@optional_fieldsEnum.map(@article_threads,&:"#{&1}_count")++
4040
Enum.map(@article_threads,&:"has_#{&1}")

‎lib/groupher_server/accounts/embeds/user_meta.ex‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ defmodule GroupherServer.Accounts.Embeds.UserMeta.Macro do
33

44
importHelper.Utils,only:[get_config:2]
55

6-
@article_threadsget_config(:article,:article_threads)
6+
@article_threadsget_config(:article,:threads)
77

88
defmacropublished_article_count_fields()do
99
@article_threads
@@ -26,7 +26,7 @@ defmodule GroupherServer.Accounts.Embeds.UserMeta do
2626
importGroupherServer.Accounts.Embeds.UserMeta.Macro
2727
importHelper.Utils,only:[get_config:2]
2828

29-
@article_threadsget_config(:article,:article_threads)
29+
@article_threadsget_config(:article,:threads)
3030

3131
@general_options%{
3232
reported_count:0,

‎lib/groupher_server/cms/abuse_report.ex‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defmodule GroupherServer.CMS.AbuseReport do
1313
aliasGroupherServer.{Accounts,CMS}
1414
aliasCMS.{ArticleComment,Embeds}
1515

16-
@article_threadsget_config(:article,:article_threads)
16+
@article_threadsget_config(:article,:threads)
1717

1818
# @required_fields ~w(article_comment_id user_id recived_user_id)a
1919
@optional_fields~w(article_comment_id account_id operate_user_id deal_with report_cases_count)a

‎lib/groupher_server/cms/article_collect.ex‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule GroupherServer.CMS.ArticleCollect do
1212
aliasGroupherServer.Accounts
1313
aliasAccounts.{User,CollectFolder}
1414

15-
@article_threadsget_config(:article,:article_threads)
15+
@article_threadsget_config(:article,:threads)
1616

1717
@required_fields~w(user_id)a
1818
@optional_fields~w(thread)a

‎lib/groupher_server/cms/article_comment.ex‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule GroupherServer.CMS.ArticleComment do
1414
aliasCMS.{Embeds,ArticleCommentUpvote}
1515

1616
# alias Helper.HTML
17-
@article_threadsget_config(:article,:article_threads)
17+
@article_threadsget_config(:article,:threads)
1818

1919
@required_fields~w(body_html author_id)a
2020
@optional_fields~w(reply_to_id replies_count is_folded is_deleted floor is_article_author thread)a

‎lib/groupher_server/cms/article_comment_user_emotion.ex‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmoduleGroupherServer.CMS.ArticleCommentUserEmotion.Macrosdo
22
importHelper.Utils,only:[get_config:2]
33

4-
@supported_emotionsget_config(:article,:comment_supported_emotions)
4+
@supported_emotionsget_config(:article,:comment_emotions)
55

66
defmacroemotion_fields()do
77
@supported_emotions
@@ -25,7 +25,7 @@ defmodule GroupherServer.CMS.ArticleCommentUserEmotion do
2525
aliasGroupherServer.{Accounts,CMS}
2626
aliasCMS.ArticleComment
2727

28-
@supported_emotionsget_config(:article,:comment_supported_emotions)
28+
@supported_emotionsget_config(:article,:comment_emotions)
2929

3030
@required_fields~w(article_comment_id user_id recived_user_id)a
3131
@optional_fieldsEnum.map(@supported_emotions,&:"#{&1}")

‎lib/groupher_server/cms/article_pinned_comment.ex‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule GroupherServer.CMS.ArticlePinnedComment do
1414
aliasCMS.ArticleComment
1515

1616
# alias Helper.HTML
17-
@article_threadsget_config(:article,:article_threads)
17+
@article_threadsget_config(:article,:threads)
1818

1919
@required_fields~w(article_comment_id)a
2020
# @optional_fields ~w(post_id job_id repo_id)a

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp