format🥚 代码格式化

This commit is contained in:
zhangwenjian committed 2021-05-31 18:10:23 +08:00
1 parent a7cc943b8e
commit a54d4ba0c1
11 files changed
+10 -18

No files matched your search

+2 -2
View File
@@ -37,7 +37,7 @@ func (e SysApi) GetSysApiList(c *gin.Context) {
d := new(dto.SysApiSearch)
err := e.MakeContext(c).
MakeOrm().
Bind(d,binding.Form).
Bind(d, binding.Form).
MakeService(&s.Service).
Errors
if err != nil {
@@ -71,7 +71,7 @@ func (e SysApi) GetSysApi(c *gin.Context) {
s := new(service.SysApi)
err := e.MakeContext(c).
MakeOrm().
Bind(control,nil).
Bind(control, nil).
MakeService(&s.Service).
Errors
if err != nil {
+1 -1
View File
@@ -212,7 +212,7 @@ func (e SysDictData) GetSysDictDataAll(c *gin.Context) {
d := &dto.SysDictDataSearch{}
err := e.MakeContext(c).
MakeOrm().
Bind(d,binding.Form).
Bind(d, binding.Form).
MakeService(&s.Service).
Errors
if err != nil {
-2
View File
@@ -25,7 +25,6 @@ func (m *SysApiSearch) GetNeedSearch() interface{} {
return *m
}
type SysApiControl struct {
Id int `uri:"id" comment:"编码"` // 编码
Handle string `json:"handle" comment:"handle"`
@@ -64,7 +63,6 @@ func (s *SysApiById) GetId() interface{} {
return s.Id
}
func (s *SysApiById) Generate() dto.Control {
o := *s
return &o
+1
View File
@@ -69,6 +69,7 @@ type GetSetSysConfigReq struct {
func (s *GetSetSysConfigReq) Generate(model *models.SysConfig) {
model.ConfigValue = s.ConfigValue
}
type UpdateSetSysConfigReq map[string]string
// SysConfigByKeyReq 根据Key获取配置
-1
View File
@@ -99,7 +99,6 @@ func (s *SysDeptById) GetId() interface{} {
return s.Id
}
func (s *SysDeptById) GenerateM() (*models.SysDept, error) {
return &models.SysDept{}, nil
}
-2
View File
@@ -24,7 +24,6 @@ func (m *SysMenuSearch) GetNeedSearch() interface{} {
return *m
}
// SysMenuControl 增、改使用的结构体
type SysMenuControl struct {
MenuId int `uri:"id" comment:"编码"` // 编码
@@ -97,7 +96,6 @@ type SysMenuById struct {
common.ControlBy
}
func (s *SysMenuById) Generate() *SysMenuById {
cp := *s
return &cp
+2 -4
View File
@@ -138,16 +138,14 @@ func (e *SysConfig) UpdateSetSysConfig(c *[]dto.GetSetSysConfigReq) error {
for _, req := range m {
var data models.SysConfig
if err := e.Orm.Where("config_key = ?", req.ConfigKey).
First(&data).Error;
err != nil {
First(&data).Error; err != nil {
e.Log.Errorf("Service GetSysConfigPage error:%s", err)
return err
}
if data.ConfigValue != req.ConfigValue {
data.ConfigValue = req.ConfigValue
if err := e.Orm.Save(&data).Error;
err != nil {
if err := e.Orm.Save(&data).Error; err != nil {
e.Log.Errorf("Service GetSysConfigPage error:%s", err)
return err
}
-1
View File
@@ -1,6 +1,5 @@
package router
import (
"github.com/gin-gonic/gin"
jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
@@ -4595,7 +4595,7 @@ func _1614270163879Test(db *gorm.DB, version string) error {
"820007": "路氹填海區",
"820008": "聖方濟各堂區"
}
}` )
}`)
return db.Transaction(func(tx *gorm.DB) error {
err := tx.Migrator().AutoMigrate(models.SysChinaAreaData{})
@@ -4617,7 +4617,7 @@ func _1614270163879Test(db *gorm.DB, version string) error {
fmt.Println(k, k1, v1)
var id = 0
id, _ = pkg.StringToInt(k1)
list = append(list, models.SysChinaAreaData{PId: k, Model: common.Model{Id: id}, Name: v1.(string),ModelTime:common.ModelTime{CreatedAt: time.Now(),UpdatedAt: time.Now()}})
list = append(list, models.SysChinaAreaData{PId: k, Model: common.Model{Id: id}, Name: v1.(string), ModelTime: common.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}})
}
}
err = tx.Create(list).Error
+1 -2
View File
@@ -39,7 +39,7 @@ func LoggerToFile() gin.HandlerFunc {
}
rb, _ := ioutil.ReadAll(bf)
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(rb))
body =string(rb)
body = string(rb)
}
c.Next()
@@ -54,7 +54,6 @@ func LoggerToFile() gin.HandlerFunc {
return
}
rt, bl := c.Get("result")
var result = ""
if bl {
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
)
//权限检查中间件
// AuthCheckRole 权限检查中间件
func AuthCheckRole() gin.HandlerFunc {
return func(c *gin.Context) {
log := api.GetRequestLogger(c)