diff --git a/model/gmodel/fs_standard_logo_gen.go b/model/gmodel/fs_standard_logo_gen.go index 0c36725d..1d57b56b 100644 --- a/model/gmodel/fs_standard_logo_gen.go +++ b/model/gmodel/fs_standard_logo_gen.go @@ -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 diff --git a/model/gmodel/ldap_roles_gen.go b/model/gmodel/ldap_group_gen.go similarity index 65% rename from model/gmodel/ldap_roles_gen.go rename to model/gmodel/ldap_group_gen.go index 4f72bbf3..1b147b21 100644 --- a/model/gmodel/ldap_roles_gen.go +++ b/model/gmodel/ldap_group_gen.go @@ -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"} } diff --git a/model/gmodel/ldap_role_menus_logic.go b/model/gmodel/ldap_group_logic.go similarity index 100% rename from model/gmodel/ldap_role_menus_logic.go rename to model/gmodel/ldap_group_logic.go diff --git a/model/gmodel/ldap_group_menus_gen.go b/model/gmodel/ldap_group_menus_gen.go new file mode 100644 index 00000000..fd3a4a1d --- /dev/null +++ b/model/gmodel/ldap_group_menus_gen.go @@ -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"} +} diff --git a/model/gmodel/ldap_roles_logic.go b/model/gmodel/ldap_group_menus_logic.go similarity index 100% rename from model/gmodel/ldap_roles_logic.go rename to model/gmodel/ldap_group_menus_logic.go diff --git a/model/gmodel/ldap_menus_logic.go b/model/gmodel/ldap_menus_logic.go index 17085f00..e68225aa 100644 --- a/model/gmodel/ldap_menus_logic.go +++ b/model/gmodel/ldap_menus_logic.go @@ -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的属性做你想做的 \ No newline at end of file diff --git a/model/gmodel/ldap_role_menus_gen.go b/model/gmodel/ldap_role_menus_gen.go deleted file mode 100644 index 3f0e8b4f..00000000 --- a/model/gmodel/ldap_role_menus_gen.go +++ /dev/null @@ -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"} -} diff --git a/model/gmodel/ldap_user_group_gen.go b/model/gmodel/ldap_user_group_gen.go new file mode 100644 index 00000000..bef006ec --- /dev/null +++ b/model/gmodel/ldap_user_group_gen.go @@ -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"} +} diff --git a/model/gmodel/ldap_user_roles_logic.go b/model/gmodel/ldap_user_group_logic.go similarity index 100% rename from model/gmodel/ldap_user_roles_logic.go rename to model/gmodel/ldap_user_group_logic.go diff --git a/model/gmodel/ldap_user_roles_gen.go b/model/gmodel/ldap_user_roles_gen.go deleted file mode 100644 index 08bae9bc..00000000 --- a/model/gmodel/ldap_user_roles_gen.go +++ /dev/null @@ -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"} -} diff --git a/model/gmodel/ldap_users_gen.go b/model/gmodel/ldap_users_gen.go deleted file mode 100644 index 25f1a7cb..00000000 --- a/model/gmodel/ldap_users_gen.go +++ /dev/null @@ -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"} -} diff --git a/model/gmodel/ldap_users_logic.go b/model/gmodel/ldap_users_logic.go deleted file mode 100644 index f35dfc56..00000000 --- a/model/gmodel/ldap_users_logic.go +++ /dev/null @@ -1 +0,0 @@ -package gmodel diff --git a/model/gmodel/var_gen.go b/model/gmodel/var_gen.go index ab1f59db..9c1449cb 100644 --- a/model/gmodel/var_gen.go +++ b/model/gmodel/var_gen.go @@ -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 }