Merge branch 'x/gorm' into x/sqlx

r/paopao-ce-plus
Michael Li 2 years ago
commit 430df7a15f
No known key found for this signature in database

@ -42,7 +42,7 @@ var (
TweetSearchSetting *tweetSearchConf TweetSearchSetting *tweetSearchConf
ZincSetting *zincConf ZincSetting *zincConf
MeiliSetting *meiliConf MeiliSetting *meiliConf
ObjectStorage *objectStorageS ObjectStorage *objectStorageConf
AliOSSSetting *aliOSSConf AliOSSSetting *aliOSSConf
COSSetting *cosConf COSSetting *cosConf
HuaweiOBSSetting *huaweiOBSConf HuaweiOBSSetting *huaweiOBSConf

@ -166,7 +166,7 @@ type sqlite3Conf struct {
Path string Path string
} }
type objectStorageS struct { type objectStorageConf struct {
RetainInDays int RetainInDays int
TempDir string TempDir string
} }
@ -296,6 +296,35 @@ func (s *databaseConf) logLevel() logger.LogLevel {
} }
} }
func (s *databaseConf) TableNames() (res TableNameMap) {
tableNames := []string{
TableAnouncement,
TableAnouncementContent,
TableAttachment,
TableCaptcha,
TableComment,
TableCommentContent,
TableCommentReply,
TableContact,
TableContactGroup,
TableMessage,
TablePost,
TablePostAttachmentBill,
TablePostCollection,
TablePostContent,
TablePostStar,
TableTag,
TableUser,
TableWalletRecharge,
TableWalletStatement,
}
res = make(TableNameMap, len(tableNames))
for _, name := range tableNames {
res[name] = s.TablePrefix + name
}
return
}
func (s *loggerConf) logLevel() logrus.Level { func (s *loggerConf) logLevel() logrus.Level {
switch strings.ToLower(s.Level) { switch strings.ToLower(s.Level) {
case "panic": case "panic":
@ -343,7 +372,7 @@ func (s *loggerMeiliConf) maxLogBuffer() int {
return s.MaxLogBuffer return s.MaxLogBuffer
} }
func (s *objectStorageS) TempDirSlash() string { func (s *objectStorageConf) TempDirSlash() string {
return strings.Trim(s.TempDir, " /") + "/" return strings.Trim(s.TempDir, " /") + "/"
} }

Loading…
Cancel
Save