mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 02:04:09 +00:00
format🥚 代码格式化
This commit is contained in:
@@ -16,8 +16,8 @@ type SysApiSearch struct {
|
||||
}
|
||||
|
||||
type SysApiOrder struct {
|
||||
TitleOrder string `search:"type:order;column:title;table:sys_api" form:"titleOrder"`
|
||||
PathOrder string `search:"type:order;column:path;table:sys_api" form:"pathOrder"`
|
||||
TitleOrder string `search:"type:order;column:title;table:sys_api" form:"titleOrder"`
|
||||
PathOrder string `search:"type:order;column:path;table:sys_api" form:"pathOrder"`
|
||||
CreatedAtOrder string `search:"type:order;column:created_at;table:sys_api" form:"createdAtOrder"`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -72,4 +70,4 @@ func (s *SysApiById) Generate() dto.Control {
|
||||
|
||||
func (s *SysApiById) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.SysApi{}, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ func (s *SysConfigControl) GetId() interface{} {
|
||||
|
||||
// GetSetSysConfigReq 增、改使用的结构体
|
||||
type GetSetSysConfigReq struct {
|
||||
ConfigKey string `json:"configKey" comment:""`
|
||||
ConfigKey string `json:"configKey" comment:""`
|
||||
ConfigValue string `json:"configValue" comment:""`
|
||||
}
|
||||
|
||||
@@ -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获取配置
|
||||
@@ -98,4 +99,4 @@ func (s *SysConfigById) GetId() interface{} {
|
||||
return s.Ids
|
||||
}
|
||||
return s.Id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,6 @@ func (s *SysDeptById) GetId() interface{} {
|
||||
return s.Id
|
||||
}
|
||||
|
||||
|
||||
func (s *SysDeptById) GenerateM() (*models.SysDept, error) {
|
||||
return &models.SysDept{}, nil
|
||||
}
|
||||
@@ -108,4 +107,4 @@ type DeptLabel struct {
|
||||
Id int `gorm:"-" json:"id"`
|
||||
Label string `gorm:"-" json:"label"`
|
||||
Children []DeptLabel `gorm:"-" json:"children"`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,4 +106,4 @@ func (s *SysDictDataById) Generate() dto.Control {
|
||||
|
||||
func (s *SysDictDataById) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.SysDictData{}, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,4 +83,4 @@ func (s *SysDictTypeById) GetId() interface{} {
|
||||
|
||||
func (s *SysDictTypeById) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.SysDictType{}, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,4 +115,4 @@ func (s *SysLoginLogById) Generate() *SysLoginLogById {
|
||||
|
||||
func (s *SysLoginLogById) GenerateM() (*models.SysLoginLog, error) {
|
||||
return &models.SysLoginLog{}, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -128,4 +126,4 @@ type MenuRole struct {
|
||||
|
||||
type SelectRole struct {
|
||||
RoleId int `uri:"roleId"`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,4 +120,4 @@ func (s *SysOperaLogById) Bind(ctx *gin.Context) error {
|
||||
|
||||
func (s *SysOperaLogById) SetUpdateBy(id int) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ type SysRoleOrder struct {
|
||||
RoleIdOrder string `search:"type:order;column:role_id;table:sys_role" form:"roleIdOrder"`
|
||||
RoleNameOrder string `search:"type:order;column:role_name;table:sys_role" form:"roleNameOrder"`
|
||||
RoleSortOrder string `search:"type:order;column:role_sort;table:sys_role" form:"usernameOrder"`
|
||||
StatusOrder string `search:"type:order;column:status;table:sys_role" form:"statusOrder"`
|
||||
StatusOrder string `search:"type:order;column:status;table:sys_role" form:"statusOrder"`
|
||||
CreatedAtOrder string `search:"type:order;column:created_at;table:sys_role" form:"createdAtOrder"`
|
||||
}
|
||||
|
||||
@@ -147,4 +147,4 @@ type RoleDataScopeReq struct {
|
||||
|
||||
type DeptIdList struct {
|
||||
DeptId int `json:"DeptId"`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,4 +89,4 @@ func (s *SysSettingById) Bind(ctx *gin.Context) error {
|
||||
|
||||
func (s *SysSettingById) GenerateM() (*models.SysSetting, error) {
|
||||
return &models.SysSetting{}, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ type SysUserSearch struct {
|
||||
type SysUserOrder struct {
|
||||
UserIdOrder string `search:"type:order;column:user_id;table:sys_user" form:"userIdOrder"`
|
||||
UsernameOrder string `search:"type:order;column:username;table:sys_user" form:"usernameOrder"`
|
||||
StatusOrder string `search:"type:order;column:status;table:sys_user" form:"statusOrder"`
|
||||
StatusOrder string `search:"type:order;column:status;table:sys_user" form:"statusOrder"`
|
||||
CreatedAtOrder string `search:"type:order;column:created_at;table:sys_user" form:"createdAtOrder"`
|
||||
}
|
||||
|
||||
@@ -93,4 +93,4 @@ func (s *SysUserById) GenerateM() (common.ActiveRecord, error) {
|
||||
type PassWord struct {
|
||||
NewPassword string `json:"newPassword" binding:"required"`
|
||||
OldPassword string `json:"oldPassword" binding:"required"`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,4 +107,4 @@ func (e *SysApi) RemoveSysApi(d *dto.SysApiById, p *actions.DataPermission) erro
|
||||
return errors.New("无权删除该数据")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -188,4 +186,4 @@ func (e *SysConfig) GetSysConfigByKEY(c *dto.SysConfigByKeyReq) error {
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,4 +282,4 @@ func digitDeptLabel(deptList *[]models.SysDept, dept dto.DeptLabel) dto.DeptLabe
|
||||
}
|
||||
dept.Children = min
|
||||
return dept
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,4 +118,4 @@ func (e *SysDictData) GetAll(c *dto.SysDictDataSearch, list *[]models.SysDictDat
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,4 +116,4 @@ func (e *SysDictType) GetAll(c *dto.SysDictTypeSearch, list *[]models.SysDictTyp
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package service
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/app/admin/service/dto"
|
||||
cDto "go-admin/common/dto"
|
||||
@@ -97,4 +97,4 @@ func (e *SysOperaLog) RemoveSysOperaLog(d *dto.SysOperaLogById) error {
|
||||
return errors.New("无权删除该数据")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,4 +103,4 @@ func (e *SysPost) RemoveSysPost(d *dto.SysPostById) error {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,4 +224,4 @@ func (e *SysRole) UpdateDataScope(c *models.SysRole) (err error) {
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,4 +110,4 @@ func (e *SysRoleMenu) GetIDS(tx *gorm.DB, roleName string) ([]models.MenuPath, e
|
||||
return nil, err
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,4 +49,4 @@ func (e *SysSetting) UpdateSysSetting(c *models.SysSetting) error {
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,4 +176,4 @@ func (e *SysUser) GetSysUserProfile(c *dto.SysUserById, user *models.SysUser, ro
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user