feat 初始化
This commit is contained in:
120
template/notice/notice.go
Normal file
120
template/notice/notice.go
Normal file
@@ -0,0 +1,120 @@
|
||||
package notice
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.hlsq.asia/alex/proto/topic"
|
||||
)
|
||||
|
||||
// GetOnlineMatchNoticeStart 在线比赛开始通知
|
||||
// lang 语言
|
||||
func GetOnlineMatchNoticeStart(lang ...TemplateNoticeLang) topic.TemplateNoticeData {
|
||||
if len(lang) != 0 {
|
||||
defaultLang = lang[0]
|
||||
}
|
||||
|
||||
return noticeTemplate[onlineMatchNoticeStart][defaultLang]
|
||||
}
|
||||
|
||||
// GetTournamentMatchRemind 比赛提醒
|
||||
// name 锦标赛名称
|
||||
// wheel 锦标赛轮次
|
||||
// sn 锦标赛sn
|
||||
// channel 频道名称
|
||||
func GetTournamentMatchRemind(name string, wheel int32, sn int64, channelName string,
|
||||
lang ...TemplateNoticeLang) topic.TemplateNoticeData {
|
||||
if len(lang) != 0 {
|
||||
defaultLang = lang[0]
|
||||
}
|
||||
|
||||
data := noticeTemplate[tournamentMatchRemind][defaultLang]
|
||||
data.Msg = fmt.Sprintf(data.Msg, name, wheel)
|
||||
data.CustomParam = fmt.Sprintf(data.CustomParam, sn, channelName)
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
// GetTournamentMatchScoreAnnouncementPromoted 成绩公告-晋级决赛
|
||||
// name 锦标赛名称
|
||||
// ranking 排名
|
||||
// sn 锦标赛sn
|
||||
// channel 频道名称
|
||||
func GetTournamentMatchScoreAnnouncementPromoted(name string, ranking int32, sn int64, channelName string,
|
||||
lang ...TemplateNoticeLang) topic.TemplateNoticeData {
|
||||
if len(lang) != 0 {
|
||||
defaultLang = lang[0]
|
||||
}
|
||||
|
||||
data := noticeTemplate[tournamentMatchScoreAnnouncementPromoted][defaultLang]
|
||||
data.Msg = fmt.Sprintf(data.Msg, name, ranking)
|
||||
data.CustomParam = fmt.Sprintf(data.CustomParam, sn, channelName)
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
// GetTournamentMatchScoreAnnouncementNotPromoted 成绩公告-未晋级决赛
|
||||
// name 锦标赛名称
|
||||
// sn 锦标赛sn
|
||||
// channel 频道名称
|
||||
func GetTournamentMatchScoreAnnouncementNotPromoted(name string, sn int64, channelName string,
|
||||
lang ...TemplateNoticeLang) topic.TemplateNoticeData {
|
||||
if len(lang) != 0 {
|
||||
defaultLang = lang[0]
|
||||
}
|
||||
|
||||
data := noticeTemplate[tournamentMatchScoreAnnouncementNotPromoted][defaultLang]
|
||||
data.Msg = fmt.Sprintf(data.Msg, name)
|
||||
data.CustomParam = fmt.Sprintf(data.CustomParam, sn, channelName)
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
// GetTournamentMatchScoreAnnouncementFinalEnd 成绩公告-决赛结束后
|
||||
// name 锦标赛名称
|
||||
// ranking 排名
|
||||
// sn 锦标赛sn
|
||||
// channel 频道名称
|
||||
func GetTournamentMatchScoreAnnouncementFinalEnd(name string, ranking int32, sn int64, channelName string,
|
||||
lang ...TemplateNoticeLang) topic.TemplateNoticeData {
|
||||
if len(lang) != 0 {
|
||||
defaultLang = lang[0]
|
||||
}
|
||||
|
||||
data := noticeTemplate[tournamentMatchScoreAnnouncementFinalEnd][defaultLang]
|
||||
data.Msg = fmt.Sprintf(data.Msg, name, ranking)
|
||||
data.CustomParam = fmt.Sprintf(data.CustomParam, sn, channelName)
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
// GetTournamentMatchRewardDistribute 奖励发放
|
||||
// name 锦标赛名称
|
||||
// month 月份
|
||||
// day 日
|
||||
// sn 锦标赛sn
|
||||
// channel 频道名称
|
||||
func GetTournamentMatchRewardDistribute(name string, month, day int32, sn int64, channelName string,
|
||||
lang ...TemplateNoticeLang) topic.TemplateNoticeData {
|
||||
if len(lang) != 0 {
|
||||
defaultLang = lang[0]
|
||||
}
|
||||
|
||||
data := noticeTemplate[tournamentMatchRewardDistribute][defaultLang]
|
||||
data.Msg = fmt.Sprintf(data.Msg, name, month, day)
|
||||
data.CustomParam = fmt.Sprintf(data.CustomParam, sn, channelName)
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
// GetTournamentMatchViolateNotice 违规通报
|
||||
// name 锦标赛名称
|
||||
// wheel 锦标赛轮次
|
||||
func GetTournamentMatchViolateNotice(name string, wheel int32, lang ...TemplateNoticeLang) topic.TemplateNoticeData {
|
||||
if len(lang) != 0 {
|
||||
defaultLang = lang[0]
|
||||
}
|
||||
|
||||
data := noticeTemplate[tournamentMatchViolateNotice][defaultLang]
|
||||
data.Msg = fmt.Sprintf(data.Msg, name, wheel)
|
||||
|
||||
return data
|
||||
}
|
||||
Reference in New Issue
Block a user