提交 8528e2b7 编写于 作者: D dhb52 提交者: songzhibin97

banckend style-fix

上级 5205db24
......@@ -6,8 +6,8 @@ import (
)
type ApiGroup struct {
SystemApiGroup system.ApiGroup
ExampleApiGroup example.ApiGroup
SystemApiGroup system.ApiGroup
ExampleApiGroup example.ApiGroup
}
var ApiGroupApp = new(ApiGroup)
package example
import (
"os"
"strings"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/example"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"os"
"strings"
)
type ExcelApi struct{}
......
......@@ -3,15 +3,16 @@ package system
import (
"errors"
"fmt"
"net/url"
"os"
"strings"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"net/url"
"os"
"strings"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
......@@ -79,7 +80,7 @@ func (autoApi *AutoCodeApi) CreateTemp(c *gin.Context) {
a.PackageT = caser.String(a.Package)
err := autoCodeService.CreateTemp(a, apiIds...)
if err != nil {
if errors.Is(err, system.AutoMoveErr) {
if errors.Is(err, system.ErrAutoMove) {
c.Writer.Header().Add("success", "true")
c.Writer.Header().Add("msg", url.QueryEscape(err.Error()))
} else {
......
......@@ -56,5 +56,4 @@ func (i *DBApi) CheckDB(c *gin.Context) {
}
global.GVA_LOG.Info(message)
response.OkWithDetailed(gin.H{"needInit": needInit}, message, c)
return
}
......@@ -31,10 +31,8 @@ func (g *_gorm) Config() *gorm.Config {
switch global.GVA_CONFIG.System.DbType {
case "mysql":
logMode = &global.GVA_CONFIG.Mysql
break
case "pgsql":
logMode = &global.GVA_CONFIG.Pgsql
break
default:
logMode = &global.GVA_CONFIG.Mysql
}
......
......@@ -8,6 +8,6 @@ type SysAutoHistory struct {
// GetById Find by id structure
type RollBack struct {
ID int `json:"id" form:"id"` // 主键ID
ID int `json:"id" form:"id"` // 主键ID
DeleteTable bool `json:"deleteTable" form:"deleteTable"` // 是否删除表
}
......@@ -2,9 +2,10 @@ package system
import (
"errors"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"go/token"
"strings"
"github.com/flipped-aurora/gin-vue-admin/server/global"
)
// AutoCodeStruct 初始版本自动化代码工具
......@@ -61,7 +62,7 @@ type Field struct {
Clearable bool `json:"clearable"` // 是否可清空
}
var AutoMoveErr error = errors.New("创建代码成功并移动文件成功")
var ErrAutoMove error = errors.New("创建代码成功并移动文件成功")
type SysAutoCode struct {
global.GVA_MODEL
......
......@@ -6,8 +6,8 @@ import (
)
type RouterGroup struct {
System system.RouterGroup
Example example.RouterGroup
System system.RouterGroup
Example example.RouterGroup
}
var RouterGroupApp = new(RouterGroup)
......@@ -360,7 +360,7 @@ func (autoCodeService *AutoCodeService) CreateTemp(autoCode system.AutoCodeStruc
return err
}
if autoCode.AutoMoveFile {
return system.AutoMoveErr
return system.ErrAutoMove
}
return nil
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册