|
|
@ -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()
|
|
|
|