Post featured record

This commit is contained in:
2025-08-12 12:17:26 +08:00
parent 05c6d67c03
commit 616491e6d8
6 changed files with 2055 additions and 2 deletions

View File

@@ -763,6 +763,15 @@ public partial class PostService(
featuredIds = reactSocialPoints.Select(e => e.Key).ToList();
await cache.SetAsync(FeaturedPostCacheKey, featuredIds, TimeSpan.FromHours(24));
// Create featured record
var records = reactSocialPoints.Select(e => new PostFeaturedRecord
{
PostId = e.Key,
SocialCredits = e.Value
}).ToList();
db.PostFeaturedRecords.AddRange(records);
await db.SaveChangesAsync();
}
var posts = await db.Posts