mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-08 19:16:35 +08:00
friend
This commit is contained in:
@@ -2,12 +2,13 @@ package relation
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type MetaDB struct {
|
||||
DB *gorm.DB
|
||||
table interface{}
|
||||
table any
|
||||
}
|
||||
|
||||
func NewMetaDB(db *gorm.DB, table any) *MetaDB {
|
||||
@@ -20,7 +21,3 @@ func NewMetaDB(db *gorm.DB, table any) *MetaDB {
|
||||
func (g *MetaDB) db(ctx context.Context) *gorm.DB {
|
||||
return g.DB.WithContext(ctx).Model(g.table)
|
||||
}
|
||||
|
||||
func (g *MetaDB) page(pageNumber, showNumber int32) *gorm.DB {
|
||||
return g.DB.Limit(int(showNumber)).Offset(int(pageNumber*showNumber-1))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user