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.

Commit1edd9d2

Browse files
committed
refactor(article-reaction): remove support_thread concept
1 parenta424b36 commit1edd9d2

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

‎lib/groupher_server/accounts/collect_folder.ex‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ defmodule GroupherServer.Accounts.CollectFolder do
1212
@required_fields~w(user_id title)a
1313
@optional_fields~w(index total_count private desc last_updated)a
1414

15-
@supported_threads[:post,:job,:repo]
16-
17-
defsupported_threads,do:@supported_threads
18-
1915
@typet::%CollectFolder{}
2016
schema"collect_folders"do
2117
belongs_to(:user,User,foreign_key::user_id)

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ defmodule GroupherServer.Accounts.Embeds.CollectFolderMeta.Macros do
1010
field(:has_repo, :boolean, default: false)
1111
field(:repo_count, :integer, default: 0)
1212
"""
13-
aliasGroupherServer.Accounts.CollectFolder
13+
importHelper.Utils,only:[get_config:2]
1414

15-
@supported_threadsCollectFolder.supported_threads()
15+
@article_threadsget_config(:article,:article_threads)
1616

1717
defmacrothreads_fields()do
18-
@supported_threads
18+
@article_threads
1919
|>Enum.map(fnthread->
2020
quotedo
2121
field(unquote(:"has_#{thread}"),:boolean,default:false)
@@ -27,21 +27,20 @@ end
2727

2828
defmoduleGroupherServer.Accounts.Embeds.CollectFolderMetado
2929
@moduledoc"""
30-
general article meta info forarticle-like content, like @supported_threads
30+
general article meta info forarticles
3131
"""
3232
useEcto.Schema
3333
importEcto.Changeset
3434
importGroupherServer.Accounts.Embeds.CollectFolderMeta.Macros
35+
importHelper.Utils,only:[get_config:2]
3536

36-
aliasGroupherServer.Accounts.CollectFolder
37+
@article_threadsget_config(:article,:article_threads)
3738

38-
@supported_threadsCollectFolder.supported_threads()
39-
40-
@optional_fieldsEnum.map(@supported_threads,&:"#{&1}_count")++
41-
Enum.map(@supported_threads,&:"has_#{&1}")
39+
@optional_fieldsEnum.map(@article_threads,&:"#{&1}_count")++
40+
Enum.map(@article_threads,&:"has_#{&1}")
4241

4342
defdefault_meta()do
44-
@supported_threads
43+
@article_threads
4544
|>Enum.reduce([],fnthread,acc->acc++["#{thread}_count":0,"has_#{thread}":false]end)
4645
|>Enum.into(%{})
4746
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp