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.

Commit5c5e1d2

Browse files
committed
chore: add blackhole
1 parent80060b6 commit5c5e1d2

File tree

4 files changed

+92
-2
lines changed

4 files changed

+92
-2
lines changed

‎lib/groupher_server/cms/delegates/Seeds/categories.ex‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defmodule GroupherServer.CMS.Delegate.Seeds.Categories do
4545
index:7
4646
},
4747
%{
48-
# blackhole, Feedback
48+
# blackhole, Feedback, dev
4949
title:"站务",
5050
raw:"feedback",
5151
index:8

‎lib/groupher_server/cms/delegates/Seeds/tags.ex‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,66 @@ defmodule GroupherServer.CMS.Delegate.Seeds.Tags do
293293

294294
## 首页 end
295295

296+
## Blackhole
297+
defget(_,:post,:blackhole)do
298+
[
299+
%{
300+
title:"传单",
301+
raw:"flyers"
302+
},
303+
%{
304+
title:"标题党",
305+
raw:"clickbait"
306+
},
307+
%{
308+
title:"封闭平台",
309+
raw:"ugly"
310+
},
311+
%{
312+
title:"盗版 & 侵权",
313+
raw:"pirate"
314+
},
315+
%{
316+
title:"水贴",
317+
raw:"cheat"
318+
},
319+
%{
320+
title:"无法无天",
321+
raw:"law"
322+
},
323+
%{
324+
title:"其他",
325+
raw:"others"
326+
}
327+
]
328+
|>Enum.map(fnattr->Map.merge(%{thread::post,color:random_color()},attr)end)
329+
end
330+
331+
## Blackhole
332+
defget(_,:account,:blackhole)do
333+
[
334+
%{
335+
title:"发传单",
336+
raw:"flyers"
337+
},
338+
%{
339+
title:"负能量",
340+
raw:"negative"
341+
},
342+
%{
343+
title:"滥用权限",
344+
raw:"ugly"
345+
},
346+
%{
347+
title:"无法无天",
348+
raw:"law"
349+
}
350+
]
351+
|>Enum.map(fnattr->Map.merge(%{thread::account,color:random_color()},attr)end)
352+
end
353+
354+
## Blackhole end
355+
296356
## 城市
297357
defget(_,:post,:city)do
298358
[

‎lib/groupher_server/cms/delegates/Seeds/threads.ex‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ defmodule GroupherServer.CMS.Delegate.Seeds.Threads do
4242
index:1
4343
},
4444
%{
45-
title:"用户",
45+
title:"账户",
4646
raw:"account",
4747
index:2
4848
}
@@ -64,6 +64,26 @@ defmodule GroupherServer.CMS.Delegate.Seeds.Threads do
6464
]
6565
end
6666

67+
defget(:dev)do
68+
[
69+
%{
70+
title:"帖子",
71+
raw:"post",
72+
index:1
73+
},
74+
%{
75+
title:"工作",
76+
raw:"job",
77+
index:2
78+
},
79+
%{
80+
title:"作品",
81+
raw:"works",
82+
index:3
83+
}
84+
]
85+
end
86+
6787
defget(:makers)do
6888
[
6989
%{

‎test/groupher_server/seeds/community_seed_test.exs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,17 @@ defmodule GroupherServer.Test.Seeds.CommunitySeed do
3333
end
3434

3535
# 黑洞,Feedback,Makers, 广告墙, 求助,外包合作
36+
@tag:wip
3637
test"blackhole community"do
38+
{:ok,community}=CMS.seed_community(:blackhole)
39+
{:ok,found}=ORM.find(Community,community.id,preload:[threads::thread])
40+
41+
assertcommunity.title=="黑洞"
42+
assertcommunity.raw=="blackhole"
43+
assertfound.threads|>length==2
44+
45+
threads=found.threads|>Enum.map(&&1.thread.title)
46+
assertthreads==["帖子","账户"]
3747
end
3848

3949
test"Feedback community"do

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp