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.

Commitc2ac6e3

Browse files
author
mydearxym
committed
chore: resolve conflict
1 parentb64138c commitc2ac6e3

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

‎lib/groupher_server/cms/delegates/article_curd.ex‎

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,30 @@ defmodule GroupherServer.CMS.Delegate.ArticleCURD do
9595
end
9696
end
9797

98+
@doc"""
99+
notify(email) admin about new content
100+
NOTE: this method should NOT be pravite, because this method
101+
will be called outside this module
102+
"""
103+
defnotify_admin_new_content(%{id:id}=result)do
104+
target=result.__struct__
105+
preload=[:origial_community,author::user]
106+
107+
with{:ok,content}<-ORM.find(target,id,preload:preload)do
108+
info=%{
109+
id:content.id,
110+
title:content.title,
111+
digest:Map.get(content,:digest,content.title),
112+
author_name:content.author.user.nickname,
113+
community_raw:content.origial_community.raw,
114+
type:
115+
result.__struct__|>to_string|>String.split(".")|>List.last()|>String.downcase()
116+
}
117+
118+
Email.notify_admin(info,:new_content)
119+
end
120+
end
121+
98122
@doc"""
99123
update a content(post/job ...)
100124
"""
@@ -478,23 +502,4 @@ defmodule GroupherServer.CMS.Delegate.ArticleCURD do
478502
|>Repo.update()
479503
end
480504
end
481-
482-
defpnotify_admin_new_content(%{id:id}=result)do
483-
target=result.__struct__
484-
preload=[:origial_community,author::user]
485-
486-
with{:ok,content}<-ORM.find(target,id,preload:preload)do
487-
info=%{
488-
id:content.id,
489-
title:content.title,
490-
digest:Map.get(content,:digest,content.title),
491-
author_name:content.author.user.nickname,
492-
community_raw:content.origial_community.raw,
493-
type:
494-
result.__struct__|>to_string|>String.split(".")|>List.last()|>String.downcase()
495-
}
496-
497-
Email.notify_admin(info,:new_content)
498-
end
499-
end
500505
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp