This commit is contained in:
wangchuxiao
2023-02-08 17:56:04 +08:00
parent 4a32e98e62
commit 2193d380ca
19 changed files with 401 additions and 555 deletions
+10 -2
View File
@@ -1,6 +1,8 @@
package unrelation
import "go.mongodb.org/mongo-driver/mongo"
import (
"context"
)
const (
CSuperGroup = "super_group"
@@ -26,5 +28,11 @@ func (UserToSuperGroupModel) TableName() string {
}
type SuperGroupModelInterface interface {
CreateSuperGroup(sCtx mongo.SessionContext, groupID string, initMemberIDs []string) error
// tx is your transaction object
CreateSuperGroup(ctx context.Context, groupID string, initMemberIDs []string, tx ...interface{}) error
GetSuperGroup(ctx context.Context, groupID string) (SuperGroupModel, error)
AddUserToSuperGroup(ctx context.Context, groupID string, userIDs []string, tx ...interface{}) error
RemoverUserFromSuperGroup(ctx context.Context, groupID string, userIDs []string, tx ...interface{}) error
GetSuperGroupByUserID(ctx context.Context, userID string) (*UserToSuperGroupModel, error)
DeleteSuperGroup(ctx context.Context, groupID string, tx ...interface{}) error
}
+10
View File
@@ -1,5 +1,7 @@
package unrelation
import "context"
const (
CTag = "tag"
CSendLog = "send_log"
@@ -29,4 +31,12 @@ func (TagSendLogModel) TableName() string {
}
type TagModelInterface interface {
GetUserTags(ctx context.Context, userID string) ([]TagModel, error)
CreateTag(ctx context.Context, userID, tagName string, userList []string) error
GetTagByID(ctx context.Context, userID, tagID string) (TagModel, error)
DeleteTag(ctx context.Context, userID, tagID string) error
SetTag(ctx context.Context, userID, tagID, newName string, increaseUserIDList []string, reduceUserIDList []string) error
GetUserIDListByTagID(ctx context.Context, userID, tagID string) ([]string, error)
SaveTagSendLog(ctx context.Context, tagSendLog *TagSendLogModel) error
GetTagSendLogs(ctx context.Context, userID string, showNumber, pageNumber int32) ([]TagSendLogModel, error)
}
@@ -1,5 +1,7 @@
package unrelation
import "context"
const (
CWorkMoment = "work_moment"
)
@@ -32,3 +34,15 @@ type Comment struct {
func (WorkMoment) TableName() string {
return CWorkMoment
}
type WorkMomentModelInterface interface {
CreateOneWorkMoment(ctx context.Context, workMoment *WorkMoment) error
DeleteOneWorkMoment(ctx context.Context, workMomentID string) error
DeleteComment(ctx context.Context, workMomentID, contentID, opUserID string) error
GetWorkMomentByID(ctx context.Context, workMomentID string) (*WorkMoment, error)
LikeOneWorkMoment(ctx context.Context, likeUserID, userName, workMomentID string) (*WorkMoment, bool, error)
CommentOneWorkMoment(ctx context.Context, comment *Comment, workMomentID string) (*WorkMoment, error)
GetUserSelfWorkMoments(ctx context.Context, userID string, showNumber, pageNumber int32) ([]*WorkMoment, error)
GetUserWorkMoments(ctx context.Context, opUserID, userID string, showNumber, pageNumber int32, friendIDList []string) ([]*WorkMoment, error)
GetUserFriendWorkMoments(ctx context.Context, showNumber, pageNumber int32, userID string, friendIDList []string) ([]*WorkMoment, error)
}