You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/common/db/controller/friend_request.go

45 lines
1.5 KiB

2 years ago
package controller
2 years ago
import (
"Open_IM/pkg/common/db/cache"
2 years ago
"Open_IM/pkg/common/db/relation"
2 years ago
"context"
)
type FriendRequestModel struct {
2 years ago
db *relation.FriendRequest
2 years ago
cache *cache.GroupCache
}
2 years ago
func (f *FriendRequestModel) Create(ctx context.Context, friends []*relation.FriendRequest) (err error) {
2 years ago
return f.db.Create(ctx, friends)
}
func (f *FriendRequestModel) Delete(ctx context.Context, fromUserID, toUserID string) (err error) {
return f.db.Delete(ctx, fromUserID, toUserID)
}
func (f *FriendRequestModel) UpdateByMap(ctx context.Context, ownerUserID string, args map[string]interface{}) (err error) {
return f.db.UpdateByMap(ctx, ownerUserID, args)
}
2 years ago
func (f *FriendRequestModel) Update(ctx context.Context, friends []*relation.FriendRequest) (err error) {
2 years ago
return f.db.Update(ctx, friends)
}
2 years ago
func (f *FriendRequestModel) Find(ctx context.Context, ownerUserID string) (friends []*relation.FriendRequest, err error) {
2 years ago
return f.db.Find(ctx, ownerUserID)
}
2 years ago
func (f *FriendRequestModel) Take(ctx context.Context, fromUserID, toUserID string) (friend *relation.FriendRequest, err error) {
2 years ago
return f.db.Take(ctx, fromUserID, toUserID)
}
2 years ago
func (f *FriendRequestModel) FindToUserID(ctx context.Context, toUserID string) (friends []*relation.FriendRequest, err error) {
2 years ago
return f.db.FindToUserID(ctx, toUserID)
}
2 years ago
func (f *FriendRequestModel) FindFromUserID(ctx context.Context, fromUserID string) (friends []*relation.FriendRequest, err error) {
2 years ago
return f.db.FindFromUserID(ctx, fromUserID)
}