🐛 Fixes some bugs

This commit is contained in:
LittleSheep 2025-05-21 00:01:36 +08:00
parent 61f7764510
commit b1e3f91acd
3 changed files with 8 additions and 7 deletions

View File

@ -1,6 +1,5 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using DysonNetwork.Sphere.Auth; using DysonNetwork.Sphere.Auth;
using DysonNetwork.Sphere.Post;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;

View File

@ -125,7 +125,8 @@ public class PostController(
var postsId = posts.Select(e => e.Id).ToList(); var postsId = posts.Select(e => e.Id).ToList();
var reactionMaps = await ps.GetPostReactionMapBatch(postsId); var reactionMaps = await ps.GetPostReactionMapBatch(postsId);
foreach (var post in posts) foreach (var post in posts)
post.ReactionsCount = reactionMaps[post.Id]; post.ReactionsCount =
reactionMaps.TryGetValue(post.Id, out var count) ? count : new Dictionary<string, int>();
Response.Headers["X-Total"] = totalCount.ToString(); Response.Headers["X-Total"] = totalCount.ToString();

View File

@ -1,6 +1,7 @@
services: services:
dysonnetwork.sphere: sphere:
image: dysonnetwork.sphere image: xsheep2010/dyson-sphere:latest
build: ports:
context: . - "8001:8080"
dockerfile: DysonNetwork.Sphere/Dockerfile volumes:
- "./keys:/app/keys"