新增:权限分组模块

This commit is contained in:
momo
2023-11-17 14:53:28 +08:00
parent 93924f1f3d
commit 6f14668342
8 changed files with 262 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ package gmodel
import (
"context"
"time"
"gorm.io/gorm"
)
// TODO: 使用model的属性做你想做的
@@ -14,6 +16,18 @@ type FindPageReq struct {
Limit int //每页数量
}
// FindAll 全部查询
func (s *LdapApisModel) FindAll(ctx context.Context, gorm *gorm.DB) (resp []LdapApis, err error) {
var db = gorm
if gorm == nil {
db = s.db.WithContext(ctx).Model(&LdapApis{})
} else {
db = db.WithContext(ctx).Model(&LdapApis{})
}
err = db.Find(&resp).Error
return resp, err
}
// FindPage 分页查询
func (s *LdapApisModel) FindPage(ctx context.Context, req FindPageReq) (resp []LdapApis, total int64, err error) {
db := s.db.WithContext(ctx).Model(&LdapApis{})