feat: add feed

This commit is contained in:
Krispire Admin
2026-06-13 23:55:02 +05:30
parent 2135ec334c
commit 8a2bdf945a
7 changed files with 232 additions and 0 deletions
+8
View File
@@ -19,6 +19,7 @@ import (
"fmt"
"html/template"
"strings"
"time"
"github.com/prabhupadasays/spsays-bff/internal/model"
"github.com/prabhupadasays/spsays-bff/internal/repository"
@@ -338,6 +339,13 @@ func (s *SocialGraphService) Followers(ctx context.Context, handle, q string, li
return s.follows.ListFollowers(ctx, u.ID, q, limit, offset)
}
// NewUsers returns up to `limit` accounts that joined in the last 24h for the
// feed's "new on the platform" discovery strip — excluding the viewer, anyone
// they already have a follow edge with, and blocked pairs.
func (s *SocialGraphService) NewUsers(ctx context.Context, viewerID string, limit int) ([]model.UserSummary, error) {
return s.users.RecentlyJoined(ctx, viewerID, time.Now().Add(-24*time.Hour), limit)
}
func (s *SocialGraphService) Following(ctx context.Context, handle, q string, limit, offset int) ([]model.UserSummary, int, error) {
u, err := s.users.FindByHandle(ctx, handle)
if err != nil {