56 lines
2.3 KiB
Go
56 lines
2.3 KiB
Go
package client
|
||
|
||
// notification_templates.go - 6 个通知模板构造函数 (spec §8)
|
||
import "fmt"
|
||
|
||
const (
|
||
TemplateReportAutoHiddenNotice = "report_auto_hidden_notice"
|
||
TemplateReportResolved = "report_resolved"
|
||
TemplateReportTakedownNotice = "report_takedown_notice"
|
||
TemplateReportBanNotice = "report_ban_notice"
|
||
TemplateReportWarnNotice = "report_warn_notice"
|
||
TemplateFeedbackReplied = "feedback_replied"
|
||
)
|
||
|
||
// BuildReportAutoHiddenNotice 举报达到阈值触发自动隐藏(被举报方)
|
||
func BuildReportAutoHiddenNotice(targetType string, targetID int64) (title, content, tplCode string) {
|
||
return "您的内容已被自动隐藏",
|
||
fmt.Sprintf("您发布的%s(ID: %d)已被系统自动隐藏。如有异议请联系客服。", targetType, targetID),
|
||
TemplateReportAutoHiddenNotice
|
||
}
|
||
|
||
// BuildReportResolved 举报状态变更为 resolved/dismissed(举报人)
|
||
func BuildReportResolved(action, reason string) (title, content, tplCode string) {
|
||
return "您的举报已处理",
|
||
fmt.Sprintf("您的举报已处理:%s。%s", action, reason),
|
||
TemplateReportResolved
|
||
}
|
||
|
||
// BuildReportTakedownNotice 举报成立 + takedown(被举报方)
|
||
func BuildReportTakedownNotice(targetType string, targetID int64, reason string) (title, content, tplCode string) {
|
||
return "您的内容已被下架",
|
||
fmt.Sprintf("您发布的%s(ID: %d)因%s已被下架。", targetType, targetID, reason),
|
||
TemplateReportTakedownNotice
|
||
}
|
||
|
||
// BuildReportBanNotice 举报成立 + ban(被举报用户,站内信 + 短信)
|
||
func BuildReportBanNotice(reason string) (title, content, tplCode string) {
|
||
return "您的账号已被封禁",
|
||
fmt.Sprintf("您的账号因%s已被封禁,如有异议请联系客服。", reason),
|
||
TemplateReportBanNotice
|
||
}
|
||
|
||
// BuildReportWarnNotice 举报成立 + warn(被举报用户)
|
||
func BuildReportWarnNotice(reason string) (title, content, tplCode string) {
|
||
return "您的账号已被警告",
|
||
fmt.Sprintf("您的账号因%s已被警告,请遵守社区规范。", reason),
|
||
TemplateReportWarnNotice
|
||
}
|
||
|
||
// BuildFeedbackReplied 反馈被回复(反馈人)
|
||
func BuildFeedbackReplied(title, replyContent string) (titleOut, contentOut, tplCode string) {
|
||
return "您的反馈已回复",
|
||
fmt.Sprintf("您的反馈「%s」已被回复:%s", title, replyContent),
|
||
TemplateFeedbackReplied
|
||
}
|