format🥚 代码格式化
This commit is contained in:
1 parent
a7cc943b8e
commit
a54d4ba0c1
8 files changed
+4
-12
No files matched your search
@@ -25,7 +25,6 @@ func (m *SysApiSearch) GetNeedSearch() interface{} {
|
|||||||
return *m
|
return *m
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type SysApiControl struct {
|
type SysApiControl struct {
|
||||||
Id int `uri:"id" comment:"编码"` // 编码
|
Id int `uri:"id" comment:"编码"` // 编码
|
||||||
Handle string `json:"handle" comment:"handle"`
|
Handle string `json:"handle" comment:"handle"`
|
||||||
@@ -64,7 +63,6 @@ func (s *SysApiById) GetId() interface{} {
|
|||||||
return s.Id
|
return s.Id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (s *SysApiById) Generate() dto.Control {
|
func (s *SysApiById) Generate() dto.Control {
|
||||||
o := *s
|
o := *s
|
||||||
return &o
|
return &o
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ type GetSetSysConfigReq struct {
|
|||||||
func (s *GetSetSysConfigReq) Generate(model *models.SysConfig) {
|
func (s *GetSetSysConfigReq) Generate(model *models.SysConfig) {
|
||||||
model.ConfigValue = s.ConfigValue
|
model.ConfigValue = s.ConfigValue
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateSetSysConfigReq map[string]string
|
type UpdateSetSysConfigReq map[string]string
|
||||||
|
|
||||||
// SysConfigByKeyReq 根据Key获取配置
|
// SysConfigByKeyReq 根据Key获取配置
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ func (s *SysDeptById) GetId() interface{} {
|
|||||||
return s.Id
|
return s.Id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (s *SysDeptById) GenerateM() (*models.SysDept, error) {
|
func (s *SysDeptById) GenerateM() (*models.SysDept, error) {
|
||||||
return &models.SysDept{}, nil
|
return &models.SysDept{}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ func (m *SysMenuSearch) GetNeedSearch() interface{} {
|
|||||||
return *m
|
return *m
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// SysMenuControl 增、改使用的结构体
|
// SysMenuControl 增、改使用的结构体
|
||||||
type SysMenuControl struct {
|
type SysMenuControl struct {
|
||||||
MenuId int `uri:"id" comment:"编码"` // 编码
|
MenuId int `uri:"id" comment:"编码"` // 编码
|
||||||
@@ -97,7 +96,6 @@ type SysMenuById struct {
|
|||||||
common.ControlBy
|
common.ControlBy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (s *SysMenuById) Generate() *SysMenuById {
|
func (s *SysMenuById) Generate() *SysMenuById {
|
||||||
cp := *s
|
cp := *s
|
||||||
return &cp
|
return &cp
|
||||||
|
|||||||
@@ -138,16 +138,14 @@ func (e *SysConfig) UpdateSetSysConfig(c *[]dto.GetSetSysConfigReq) error {
|
|||||||
for _, req := range m {
|
for _, req := range m {
|
||||||
var data models.SysConfig
|
var data models.SysConfig
|
||||||
if err := e.Orm.Where("config_key = ?", req.ConfigKey).
|
if err := e.Orm.Where("config_key = ?", req.ConfigKey).
|
||||||
First(&data).Error;
|
First(&data).Error; err != nil {
|
||||||
err != nil {
|
|
||||||
e.Log.Errorf("Service GetSysConfigPage error:%s", err)
|
e.Log.Errorf("Service GetSysConfigPage error:%s", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if data.ConfigValue != req.ConfigValue {
|
if data.ConfigValue != req.ConfigValue {
|
||||||
data.ConfigValue = req.ConfigValue
|
data.ConfigValue = req.ConfigValue
|
||||||
|
|
||||||
if err := e.Orm.Save(&data).Error;
|
if err := e.Orm.Save(&data).Error; err != nil {
|
||||||
err != nil {
|
|
||||||
e.Log.Errorf("Service GetSysConfigPage error:%s", err)
|
e.Log.Errorf("Service GetSysConfigPage error:%s", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package router
|
package router
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
|
jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ func LoggerToFile() gin.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rt, bl := c.Get("result")
|
rt, bl := c.Get("result")
|
||||||
var result = ""
|
var result = ""
|
||||||
if bl {
|
if bl {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
|
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
|
||||||
)
|
)
|
||||||
|
|
||||||
//权限检查中间件
|
// AuthCheckRole 权限检查中间件
|
||||||
func AuthCheckRole() gin.HandlerFunc {
|
func AuthCheckRole() gin.HandlerFunc {
|
||||||
return func(c *gin.Context) {
|
return func(c *gin.Context) {
|
||||||
log := api.GetRequestLogger(c)
|
log := api.GetRequestLogger(c)
|
||||||
|
|||||||
Reference in new issue
Block a user