diff --git a/internal/feed/entity.go b/internal/feed/entity.go index 43d0730..a5abe4b 100644 --- a/internal/feed/entity.go +++ b/internal/feed/entity.go @@ -29,13 +29,20 @@ type ListLatestResponse struct { } type ListLikesCountRequest struct { - Limit int `json:"limit"` - LikesCount int64 `json:"likes_count"` + Limit int `json:"limit"` + LikesCountBefore *int64 `json:"likes_count_before,omitempty"` + IDBefore *uint `json:"id_before,omitempty"` +} + +type LikesCountCursor struct { + LikesCount int64 + ID uint } type ListLikesCountResponse struct { VideoList []FeedVideoItem `json:"video_list"` - NextLikesCountBefore int64 `json:"next_likes_count_before"` + NextLikesCountBefore *int64 `json:"next_likes_count_before,omitempty"` + NextIDBefore *uint `json:"next_id_before,omitempty"` HasMore bool `json:"has_more"` } diff --git a/internal/social/entity.go b/internal/social/entity.go index 6fc5842..17d9e9b 100644 --- a/internal/social/entity.go +++ b/internal/social/entity.go @@ -4,8 +4,8 @@ import "feedsystem_video_go/internal/account" type Social struct { ID uint `gorm:"primaryKey"` - FollowerID uint `gorm:"index"` - VloggerID uint `gorm:"index"` + FollowerID uint `gorm:"not null;index:idx_social_follower;uniqueIndex:idx_social_follower_vlogger"` + VloggerID uint `gorm:"not null;index:idx_social_vlogger;uniqueIndex:idx_social_follower_vlogger"` } type FollowRequest struct {