fix
This commit is contained in:
parent
dd4c9ca1e0
commit
01b6046d5a
|
@ -6,11 +6,12 @@ import (
|
|||
|
||||
// fs_standard_logo 标准logo
|
||||
type FsStandardLogo struct {
|
||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID
|
||||
Name *string `gorm:"default:'';" json:"name"` //
|
||||
Image *string `gorm:"default:'';" json:"image"` //
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
Status *int64 `gorm:"default:1;" json:"status"` // 状态 1正常 0删除
|
||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID
|
||||
Name *string `gorm:"default:'';" json:"name"` //
|
||||
Image *string `gorm:"default:'';" json:"image"` //
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
Status *int64 `gorm:"default:1;" json:"status"` // 状态 1正常 0删除
|
||||
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
||||
}
|
||||
type FsStandardLogoModel struct {
|
||||
db *gorm.DB
|
||||
|
|
|
@ -5,23 +5,23 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// ldap_roles 角色表
|
||||
type LdapRoles struct {
|
||||
// ldap_group 权限组表
|
||||
type LdapGroup struct {
|
||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||
Name *string `gorm:"unique_key;default:'';" json:"name"` //
|
||||
Keyword *string `gorm:"unique_key;default:'';" json:"keyword"` //
|
||||
Name *string `gorm:"default:'';" json:"name"` //
|
||||
Keyword *string `gorm:"default:'';" json:"keyword"` //
|
||||
Remark *string `gorm:"default:'';" json:"remark"` //
|
||||
Status *int64 `gorm:"default:1;" json:"status"` // 1正常, 2禁用
|
||||
Sort *int64 `gorm:"default:999;" json:"sort"` // 角色排序(排序越大权限越低, 不能查看比自己序号小的角色, 不能编辑同序号用户权限, 排序为1表示超级管理员)
|
||||
Sort *int64 `gorm:"default:999;" json:"sort"` // 分组排序(排序越大权限越低, 不能查看比自己序号小的角色, 不能编辑同序号用户权限, 排序为1表示超级管理员)
|
||||
Creator *string `gorm:"default:'';" json:"creator"` //
|
||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||
}
|
||||
type LdapRolesModel struct {
|
||||
type LdapGroupModel struct {
|
||||
db *gorm.DB
|
||||
name string
|
||||
}
|
||||
|
||||
func NewLdapRolesModel(db *gorm.DB) *LdapRolesModel {
|
||||
return &LdapRolesModel{db: db, name: "ldap_roles"}
|
||||
func NewLdapGroupModel(db *gorm.DB) *LdapGroupModel {
|
||||
return &LdapGroupModel{db: db, name: "ldap_group"}
|
||||
}
|
19
model/gmodel/ldap_group_menus_gen.go
Normal file
19
model/gmodel/ldap_group_menus_gen.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// ldap_group_menus 权限分组菜单表
|
||||
type LdapGroupMenus struct {
|
||||
MenuId *int64 `gorm:"default:0;" json:"menu_id"` //
|
||||
GroupId *int64 `gorm:"default:0;" json:"group_id"` //
|
||||
}
|
||||
type LdapGroupMenusModel struct {
|
||||
db *gorm.DB
|
||||
name string
|
||||
}
|
||||
|
||||
func NewLdapGroupMenusModel(db *gorm.DB) *LdapGroupMenusModel {
|
||||
return &LdapGroupMenusModel{db: db, name: "ldap_group_menus"}
|
||||
}
|
|
@ -1,15 +1,2 @@
|
|||
package gmodel
|
||||
|
||||
import "context"
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
|
||||
// 获取全部菜单
|
||||
func (d *LdapMenusModel) GetAll(ctx context.Context) (resp []LdapMenus, err error) {
|
||||
var menus []LdapMenus
|
||||
result := d.db.Model(&LdapMenus{}).Where("status = ?", 1).Find(&menus)
|
||||
if result.Error != nil {
|
||||
return nil, result.Error
|
||||
}
|
||||
return menus, nil
|
||||
}
|
||||
// TODO: 使用model的属性做你想做的
|
|
@ -1,19 +0,0 @@
|
|||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// ldap_role_menus 角色菜单表
|
||||
type LdapRoleMenus struct {
|
||||
MenuId *int64 `gorm:"default:0;" json:"menu_id"` //
|
||||
RoleId *int64 `gorm:"default:0;" json:"role_id"` //
|
||||
}
|
||||
type LdapRoleMenusModel struct {
|
||||
db *gorm.DB
|
||||
name string
|
||||
}
|
||||
|
||||
func NewLdapRoleMenusModel(db *gorm.DB) *LdapRoleMenusModel {
|
||||
return &LdapRoleMenusModel{db: db, name: "ldap_role_menus"}
|
||||
}
|
19
model/gmodel/ldap_user_group_gen.go
Normal file
19
model/gmodel/ldap_user_group_gen.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// ldap_user_group 用户权限分组表
|
||||
type LdapUserGroup struct {
|
||||
GroupId *int64 `gorm:"default:0;" json:"group_id"` //
|
||||
UserId *string `gorm:"default:'0';" json:"user_id"` //
|
||||
}
|
||||
type LdapUserGroupModel struct {
|
||||
db *gorm.DB
|
||||
name string
|
||||
}
|
||||
|
||||
func NewLdapUserGroupModel(db *gorm.DB) *LdapUserGroupModel {
|
||||
return &LdapUserGroupModel{db: db, name: "ldap_user_group"}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// ldap_user_roles 用户角色表
|
||||
type LdapUserRoles struct {
|
||||
RoleId *int64 `gorm:"default:0;" json:"role_id"` //
|
||||
UserId *int64 `gorm:"default:0;" json:"user_id"` //
|
||||
}
|
||||
type LdapUserRolesModel struct {
|
||||
db *gorm.DB
|
||||
name string
|
||||
}
|
||||
|
||||
func NewLdapUserRolesModel(db *gorm.DB) *LdapUserRolesModel {
|
||||
return &LdapUserRolesModel{db: db, name: "ldap_user_roles"}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// ldap_users 用户表
|
||||
type LdapUsers struct {
|
||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||
Username *string `gorm:"unique_key;default:'';" json:"username"` //
|
||||
Password *string `gorm:"default:'';" json:"password"` //
|
||||
Nickname *string `gorm:"default:'';" json:"nickname"` //
|
||||
GivenName *string `gorm:"default:'';" json:"given_name"` //
|
||||
Email *string `gorm:"unique_key;default:'';" json:"email"` //
|
||||
JobNumber *string `gorm:"default:'';" json:"job_number"` //
|
||||
Mobile *string `gorm:"unique_key;default:'';" json:"mobile"` //
|
||||
Avatar *string `gorm:"default:'';" json:"avatar"` //
|
||||
Position *string `gorm:"default:'';" json:"position"` //
|
||||
Introduction *string `gorm:"default:'';" json:"introduction"` //
|
||||
Status *int64 `gorm:"default:1;" json:"status"` // 状态:1在职, 2离职
|
||||
Creator *string `gorm:"default:'';" json:"creator"` //
|
||||
UserDn *string `gorm:"default:'';" json:"user_dn"` //
|
||||
SyncState *int64 `gorm:"default:1;" json:"sync_state"` // 同步状态:1已同步, 2未同步
|
||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||
}
|
||||
type LdapUsersModel struct {
|
||||
db *gorm.DB
|
||||
name string
|
||||
}
|
||||
|
||||
func NewLdapUsersModel(db *gorm.DB) *LdapUsersModel {
|
||||
return &LdapUsersModel{db: db, name: "ldap_users"}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
package gmodel
|
|
@ -111,11 +111,10 @@ type AllModelsGen struct {
|
|||
FsZipCode *FsZipCodeModel // fs_zip_code 邮编表
|
||||
LdapApis *LdapApisModel // ldap_apis api表
|
||||
LdapCasbinRule *LdapCasbinRuleModel // ldap_casbin_rule 权限表
|
||||
LdapGroup *LdapGroupModel // ldap_group 权限组表
|
||||
LdapGroupMenus *LdapGroupMenusModel // ldap_group_menus 权限分组菜单表
|
||||
LdapMenus *LdapMenusModel // ldap_menus 菜单表
|
||||
LdapRoleMenus *LdapRoleMenusModel // ldap_role_menus 角色菜单表
|
||||
LdapRoles *LdapRolesModel // ldap_roles 角色表
|
||||
LdapUserRoles *LdapUserRolesModel // ldap_user_roles 用户角色表
|
||||
LdapUsers *LdapUsersModel // ldap_users 用户表
|
||||
LdapUserGroup *LdapUserGroupModel // ldap_user_group 用户权限分组表
|
||||
|
||||
}
|
||||
|
||||
|
@ -228,11 +227,10 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
|||
FsZipCode: NewFsZipCodeModel(gdb),
|
||||
LdapApis: NewLdapApisModel(gdb),
|
||||
LdapCasbinRule: NewLdapCasbinRuleModel(gdb),
|
||||
LdapGroup: NewLdapGroupModel(gdb),
|
||||
LdapGroupMenus: NewLdapGroupMenusModel(gdb),
|
||||
LdapMenus: NewLdapMenusModel(gdb),
|
||||
LdapRoleMenus: NewLdapRoleMenusModel(gdb),
|
||||
LdapRoles: NewLdapRolesModel(gdb),
|
||||
LdapUserRoles: NewLdapUserRolesModel(gdb),
|
||||
LdapUsers: NewLdapUsersModel(gdb),
|
||||
LdapUserGroup: NewLdapUserGroupModel(gdb),
|
||||
}
|
||||
return models
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user