新增:权限分组模块

This commit is contained in:
momo
2023-11-17 15:36:17 +08:00
parent 4cda7f0d3c
commit 4097d00f80
8 changed files with 147 additions and 7 deletions

View File

@@ -3,10 +3,24 @@ package gmodel
import (
"context"
"time"
"gorm.io/gorm"
)
// TODO: 使用model的属性做你想做的
// FindAll 全部查询
func (s *LdapGroupModel) FindAll(ctx context.Context, gorm *gorm.DB) (resp []LdapGroup, err error) {
var db = gorm
if gorm == nil {
db = s.db.WithContext(ctx).Model(&LdapGroup{})
} else {
db = db.WithContext(ctx).Model(&LdapGroup{})
}
err = db.Find(&resp).Error
return resp, err
}
// FindPage 分页查询
func (s *LdapGroupModel) FindPage(ctx context.Context, req FindPageReq) (resp []LdapGroup, total int64, err error) {
db := s.db.WithContext(ctx).Model(&LdapGroup{})