diff --git a/DysonNetwork.Sphere/Account/NotificationController.cs b/DysonNetwork.Sphere/Account/NotificationController.cs index 06f6ec2..df4e47d 100644 --- a/DysonNetwork.Sphere/Account/NotificationController.cs +++ b/DysonNetwork.Sphere/Account/NotificationController.cs @@ -1,6 +1,5 @@ using System.ComponentModel.DataAnnotations; using DysonNetwork.Sphere.Auth; -using DysonNetwork.Sphere.Post; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/DysonNetwork.Sphere/Post/PostController.cs b/DysonNetwork.Sphere/Post/PostController.cs index b1f7394..a8f18f9 100644 --- a/DysonNetwork.Sphere/Post/PostController.cs +++ b/DysonNetwork.Sphere/Post/PostController.cs @@ -125,7 +125,8 @@ public class PostController( var postsId = posts.Select(e => e.Id).ToList(); var reactionMaps = await ps.GetPostReactionMapBatch(postsId); foreach (var post in posts) - post.ReactionsCount = reactionMaps[post.Id]; + post.ReactionsCount = + reactionMaps.TryGetValue(post.Id, out var count) ? count : new Dictionary(); Response.Headers["X-Total"] = totalCount.ToString(); diff --git a/compose.yaml b/compose.yaml index caff736..00ec211 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,6 +1,7 @@ services: - dysonnetwork.sphere: - image: dysonnetwork.sphere - build: - context: . - dockerfile: DysonNetwork.Sphere/Dockerfile + sphere: + image: xsheep2010/dyson-sphere:latest + ports: + - "8001:8080" + volumes: + - "./keys:/app/keys"