upgrade github.com/alimy/cfg => v0.4.0

pull/339/head
Michael Li 1 year ago
parent 0f48ac253c
commit 05bad5997f
No known key found for this signature in database

@ -5,7 +5,7 @@ go 1.20
require ( require (
github.com/Masterminds/semver/v3 v3.2.1 github.com/Masterminds/semver/v3 v3.2.1
github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868 github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868
github.com/alimy/cfg v0.3.0 github.com/alimy/cfg v0.4.0
github.com/alimy/mir/v4 v4.0.0-rc.1 github.com/alimy/mir/v4 v4.0.0-rc.1
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
github.com/allegro/bigcache/v3 v3.1.0 github.com/allegro/bigcache/v3 v3.1.0

@ -123,8 +123,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0=
github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk=
github.com/alimy/cfg v0.3.0 h1:9xgA0QWVCPSq9fFNRcYahVCAX22IL9ts2wrTQPfAStY= github.com/alimy/cfg v0.4.0 h1:SslKPndmxRViT1ePWLmNsEq7okYP0GVeuowQlRWZPkw=
github.com/alimy/cfg v0.3.0/go.mod h1:rOxbasTH2srl6StAjNF5Vyi8bfrdkl3fLGmOYtSw81c= github.com/alimy/cfg v0.4.0/go.mod h1:rOxbasTH2srl6StAjNF5Vyi8bfrdkl3fLGmOYtSw81c=
github.com/alimy/mir/v4 v4.0.0-rc.1 h1:x9rKbD6I4INqwvgmSI4Vbswff66ANDnPmCySMLzEV4w= github.com/alimy/mir/v4 v4.0.0-rc.1 h1:x9rKbD6I4INqwvgmSI4Vbswff66ANDnPmCySMLzEV4w=
github.com/alimy/mir/v4 v4.0.0-rc.1/go.mod h1:d58dBvw2KImcVbAUANrciEV/of0arMNsI9c/5UNCMMc= github.com/alimy/mir/v4 v4.0.0-rc.1/go.mod h1:d58dBvw2KImcVbAUANrciEV/of0arMNsI9c/5UNCMMc=
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible h1:KpbJFXwhVeuxNtBJ74MCGbIoaBok2uZvkD7QXp2+Wis= github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible h1:KpbJFXwhVeuxNtBJ74MCGbIoaBok2uZvkD7QXp2+Wis=

@ -30,9 +30,9 @@ func DataService() core.DataService {
var v core.VersionInfo var v core.VersionInfo
if cfg.If("Gorm") { if cfg.If("Gorm") {
ds, v = jinzhu.NewDataService() ds, v = jinzhu.NewDataService()
} else if cfg.If("Sqlx") && cfg.If("MySQL") { } else if cfg.All("Sqlx", "MySQL") {
ds, v = sakila.NewDataService() ds, v = sakila.NewDataService()
} else if cfg.If("Sqlx") && (cfg.If("Postgres") || cfg.If("PostgreSQL")) { } else if cfg.If("Sqlx") && cfg.Any("Postgres", "PostgreSQL") {
ds, v = slonik.NewDataService() ds, v = slonik.NewDataService()
} else { } else {
// default use gorm as orm for sql database // default use gorm as orm for sql database
@ -93,9 +93,9 @@ func TweetSearchService() core.TweetSearchService {
func newAuthorizationManageService() (s core.AuthorizationManageService) { func newAuthorizationManageService() (s core.AuthorizationManageService) {
if cfg.If("Gorm") { if cfg.If("Gorm") {
s = jinzhu.NewAuthorizationManageService() s = jinzhu.NewAuthorizationManageService()
} else if cfg.If("Sqlx") && cfg.If("MySQL") { } else if cfg.All("Sqlx", "MySQL") {
s = sakila.NewAuthorizationManageService() s = sakila.NewAuthorizationManageService()
} else if cfg.If("Sqlx") && (cfg.If("Postgres") || cfg.If("PostgreSQL")) { } else if cfg.If("Sqlx") && cfg.Any("Postgres", "PostgreSQL") {
s = slonik.NewAuthorizationManageService() s = slonik.NewAuthorizationManageService()
} else { } else {
s = jinzhu.NewAuthorizationManageService() s = jinzhu.NewAuthorizationManageService()

Loading…
Cancel
Save