Skip to content

Commit

Permalink
fix: swagger api请求问题
Browse files Browse the repository at this point in the history
  • Loading branch information
2637309949 committed Aug 9, 2021
1 parent ad24bdd commit 31e46e8
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 30 deletions.
42 changes: 21 additions & 21 deletions cmd/dolphin/template/dist/assets.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/scene/api/xlsx.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions platform/api/app.dolphin.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ func (dol *Dolphin) migration(name string, db *xorm.Engine) error {

items := dol.Manager.ModelSet().ByName(name)
for i := range items {
m := items[i]
if viper.GetString("app.mode") == "debug" {
logrus.Infof("Sync Model[%v]:%v", name, m.TableName())
if IsDebugging() {
logrus.Infof("Sync Model[%v]:%v", name, items[i].TableName())
}
err = db.Sync2(m)
err = db.Sync2(items[i])
if err != nil {
return err
}
tableInfo, err := db.TableInfo(m)
tableInfo, err := db.TableInfo(items[i])
if err != nil {
return err
}
Expand Down
5 changes: 5 additions & 0 deletions platform/api/app.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion platform/api/app.http.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (gh *restful) Handle(httpMethod, absolutePath string, handlerFuncs ...Handl

// DebugPrintRoute defined TODO
func DebugPrintRoute(httpMethod, absolutePath, _ string, _ int) {
if viper.GetString("app.mode") != "release" {
if IsDebugging() {
logrus.Infof("%-6s %-25s ", httpMethod, absolutePath)
}
}
Expand Down
2 changes: 1 addition & 1 deletion platform/api/app.logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func InitTracker() {
func createXLogger() interface{} {
xlogger := &XLogger{Logger: logrus.StandardLogger()}
xlogger.SetLevel(log.DEFAULT_LOG_LEVEL)
xlogger.ShowSQL(viper.GetString("app.mode") == "debug")
xlogger.ShowSQL(IsDebugging())
return xlogger
}

Expand Down

0 comments on commit 31e46e8

Please sign in to comment.