mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 19:46:57 +08:00
remove notification limit
This commit is contained in:
parent
0f17f52c2c
commit
f538a86e10
@ -41,6 +41,8 @@ type groupServer struct {
|
|||||||
rpcRegisterName string
|
rpcRegisterName string
|
||||||
etcdSchema string
|
etcdSchema string
|
||||||
etcdAddr []string
|
etcdAddr []string
|
||||||
|
imdb.GroupInterface
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGroupServer(port int) *groupServer {
|
func NewGroupServer(port int) *groupServer {
|
||||||
|
4
pkg/common/db/cache/group.go
vendored
4
pkg/common/db/cache/group.go
vendored
@ -15,13 +15,13 @@ const GroupExpireTime = time.Second * 60 * 60 * 12
|
|||||||
const groupInfoCacheKey = "GROUP_INFO_CACHE:"
|
const groupInfoCacheKey = "GROUP_INFO_CACHE:"
|
||||||
|
|
||||||
type GroupCache struct {
|
type GroupCache struct {
|
||||||
db *mysql.Group
|
db mysql.GroupModelInterface
|
||||||
expireTime time.Duration
|
expireTime time.Duration
|
||||||
redisClient *RedisClient
|
redisClient *RedisClient
|
||||||
rcClient *rockscache.Client
|
rcClient *rockscache.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGroupCache(rdb redis.UniversalClient, db *mysql.Group, opts rockscache.Options) *GroupCache {
|
func NewGroupCache(rdb redis.UniversalClient, db mysql.GroupModelInterface, opts rockscache.Options) *GroupCache {
|
||||||
rcClient := &rockscache.Client{
|
rcClient := &rockscache.Client{
|
||||||
Options: rockscache.Options{},
|
Options: rockscache.Options{},
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"Open_IM/pkg/common/db/cache"
|
"Open_IM/pkg/common/db/cache"
|
||||||
"Open_IM/pkg/common/db/mongoDB"
|
"Open_IM/pkg/common/db/mongoDB"
|
||||||
"Open_IM/pkg/common/db/mysql"
|
"Open_IM/pkg/common/db/mysql"
|
||||||
"Open_IM/pkg/utils"
|
|
||||||
"context"
|
"context"
|
||||||
"github.com/dtm-labs/rockscache"
|
"github.com/dtm-labs/rockscache"
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/go-redis/redis/v8"
|
||||||
@ -13,13 +12,20 @@ import (
|
|||||||
//"time"
|
//"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type GroupInterface interface {
|
||||||
|
Find(ctx context.Context, groupIDs []string) (groups []*mysql.Group, err error)
|
||||||
|
Create(ctx context.Context, groups []*mysql.Group) error
|
||||||
|
Delete(ctx context.Context, groupIDs []string) error
|
||||||
|
Take(ctx context.Context, groupID string) (group *mysql.Group, err error)
|
||||||
|
}
|
||||||
|
|
||||||
type GroupModel struct {
|
type GroupModel struct {
|
||||||
db *mysql.Group
|
db mysql.GroupModelInterface
|
||||||
cache *cache.GroupCache
|
cache *cache.GroupCache
|
||||||
mongo *mongoDB.Client
|
mongo *mongoDB.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGroupModel(db *mysql.Group, rdb redis.UniversalClient, mdb *mongo.Client) *GroupModel {
|
func NewGroupModel(db mysql.GroupModelInterface, rdb redis.UniversalClient, mdb *mongo.Client) *GroupModel {
|
||||||
var groupModel GroupModel
|
var groupModel GroupModel
|
||||||
groupModel.db = db
|
groupModel.db = db
|
||||||
groupModel.cache = cache.NewGroupCache(rdb, db, rockscache.Options{
|
groupModel.cache = cache.NewGroupCache(rdb, db, rockscache.Options{
|
||||||
|
@ -8,6 +8,14 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type GroupModelInterface interface {
|
||||||
|
Create(ctx context.Context, groups []*Group) (err error)
|
||||||
|
Delete(ctx context.Context, groupIDs []string, tx ...*gorm.DB) (err error)
|
||||||
|
UpdateByMap(ctx context.Context, groupID string, args map[string]interface{}) (err error)
|
||||||
|
Update(ctx context.Context, groups []*Group) (err error)
|
||||||
|
Find(ctx context.Context, groupIDs []string) (groups []*Group, err error)
|
||||||
|
Take(ctx context.Context, groupID string) (group *Group, err error)
|
||||||
|
}
|
||||||
type Group struct {
|
type Group struct {
|
||||||
GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"`
|
GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"`
|
||||||
GroupName string `gorm:"column:name;size:255" json:"groupName"`
|
GroupName string `gorm:"column:name;size:255" json:"groupName"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user