fix
This commit is contained in:
16
model/gmodel/ldap_user_gen.go
Normal file
16
model/gmodel/ldap_user_gen.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// ldap_user ldap_用户id递增表
|
||||
type LdapUser struct {
|
||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||
}
|
||||
type LdapUserModel struct {
|
||||
db *gorm.DB
|
||||
name string
|
||||
}
|
||||
|
||||
func NewLdapUserModel(db *gorm.DB) *LdapUserModel { return &LdapUserModel{db: db, name: "ldap_user"} }
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
// ldap_user_group 用户权限分组表
|
||||
type LdapUserGroup struct {
|
||||
GroupId *int64 `gorm:"default:0;" json:"group_id"` //
|
||||
UserId *string `gorm:"default:'0';" json:"user_id"` //
|
||||
GroupId *int64 `gorm:"default:0;" json:"group_id"` //
|
||||
UserId *int64 `gorm:"default:0;" json:"user_id"` //
|
||||
}
|
||||
type LdapUserGroupModel struct {
|
||||
db *gorm.DB
|
||||
|
||||
8
model/gmodel/ldap_user_logic.go
Normal file
8
model/gmodel/ldap_user_logic.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package gmodel
|
||||
|
||||
import "context"
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
func (u *LdapUserModel) Create(ctx context.Context, data *LdapUser) error {
|
||||
return u.db.WithContext(ctx).Model(&LdapUser{}).Create(&data).Error
|
||||
}
|
||||
@@ -114,6 +114,7 @@ type AllModelsGen struct {
|
||||
LdapGroup *LdapGroupModel // ldap_group 权限组表
|
||||
LdapGroupMenus *LdapGroupMenusModel // ldap_group_menus 权限分组菜单表
|
||||
LdapMenus *LdapMenusModel // ldap_menus 菜单表
|
||||
LdapUser *LdapUserModel // ldap_user ldap_用户id递增表
|
||||
LdapUserGroup *LdapUserGroupModel // ldap_user_group 用户权限分组表
|
||||
|
||||
}
|
||||
@@ -230,6 +231,7 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
||||
LdapGroup: NewLdapGroupModel(gdb),
|
||||
LdapGroupMenus: NewLdapGroupMenusModel(gdb),
|
||||
LdapMenus: NewLdapMenusModel(gdb),
|
||||
LdapUser: NewLdapUserModel(gdb),
|
||||
LdapUserGroup: NewLdapUserGroupModel(gdb),
|
||||
}
|
||||
return models
|
||||
|
||||
Reference in New Issue
Block a user