2024-09-02 13:43:03 +00:00
|
|
|
package repository
|
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
|
|
|
type SocialNetworkRepository interface {
|
|
|
|
CreateUserNode(ctx context.Context, uid string) error
|
2024-09-03 09:11:12 +00:00
|
|
|
MarkFollowerRelation(ctx context.Context, fromUID, toUID string) error
|
|
|
|
RemoveFollowerRelation(ctx context.Context, fromUID, toUID string) error
|
|
|
|
GetFollower(ctx context.Context, req FollowReq) (FollowResp, error)
|
|
|
|
GetFollowee(ctx context.Context, req FollowReq) (FollowResp, error)
|
|
|
|
GetFollowerCount(ctx context.Context, uid string) (int64, error)
|
|
|
|
GetFolloweeCount(ctx context.Context, uid string) (int64, error)
|
|
|
|
GetDegreeBetweenUsers(ctx context.Context, uid1, uid2 string) (int64, error)
|
|
|
|
GetUIDsWithinNDegrees(ctx context.Context, uid string, degrees, pageSize, pageIndex int64) ([]string, int64, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type FollowReq struct {
|
|
|
|
UID string
|
|
|
|
PageSize int64
|
|
|
|
PageIndex int64
|
|
|
|
}
|
|
|
|
|
|
|
|
type FollowResp struct {
|
|
|
|
UIDs []string
|
|
|
|
Total int64
|
2024-09-02 13:43:03 +00:00
|
|
|
}
|