新增:权限分组模块
This commit is contained in:
@@ -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{})
|
||||
|
||||
Reference in New Issue
Block a user