migrate from github
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
ConfigKey_First_System string = "system"
|
||||
)
|
||||
|
||||
const (
|
||||
ConfigKey_Second_Security string = "security"
|
||||
ConfigKey_Second_Database string = "database"
|
||||
ConfigKey_Second_ES string = "elasticsearch"
|
||||
)
|
||||
|
||||
const (
|
||||
ConfigKey_Third_RegisterMode string = "register_mode"
|
||||
ConfigKey_Third_Initialized string = "initialized"
|
||||
ConfigKey_Third_RegisterLimit string = "register_limit" // token_bucket_limit
|
||||
)
|
||||
@@ -0,0 +1,23 @@
|
||||
package constant
|
||||
|
||||
// system.security.register_mode
|
||||
const (
|
||||
RegisterMode_Open string = "open"
|
||||
RegisterMode_Invite string = "invite"
|
||||
)
|
||||
|
||||
// system.database.initialized
|
||||
const (
|
||||
Database_Initialized_True string = "true"
|
||||
// Database_Initialized_False string = "false"
|
||||
)
|
||||
|
||||
// system.elasticsearch.initialized
|
||||
const (
|
||||
ES_Initialized_True string = "true"
|
||||
)
|
||||
|
||||
const (
|
||||
RegisterLimit_On string = "on"
|
||||
RegisterLimit_Off string = "off"
|
||||
)
|
||||
@@ -0,0 +1,27 @@
|
||||
package constant
|
||||
|
||||
// Notification type constants.
|
||||
const (
|
||||
NotificationType_Comment = "comment"
|
||||
NotificationType_Reply = "reply"
|
||||
NotificationType_Mention = "mention"
|
||||
NotificationType_System = "system"
|
||||
)
|
||||
|
||||
// notificationTitles holds default (zh-CN) titles keyed by notification type.
|
||||
// Replace with a proper i18n lookup once multi-language support is added.
|
||||
var notificationTitles = map[string]string{
|
||||
NotificationType_Comment: "收到新评论",
|
||||
NotificationType_Reply: "回复了你的评论",
|
||||
NotificationType_Mention: "在评论中提及了你",
|
||||
NotificationType_System: "系统通知",
|
||||
}
|
||||
|
||||
// GetNotificationTitle returns the default title for the given notification type.
|
||||
// Falls back to the type string itself if the type is unrecognised.
|
||||
func GetNotificationTitle(notifType string) string {
|
||||
if title, ok := notificationTitles[notifType]; ok {
|
||||
return title
|
||||
}
|
||||
return notifType
|
||||
}
|
||||
Reference in New Issue
Block a user