♻️ Centralized data models (wip)

This commit is contained in:
2025-09-27 14:09:28 +08:00
parent 51b6f7309e
commit e70d8371f8
206 changed files with 1352 additions and 2128 deletions

View File

@@ -1,13 +1,14 @@
using DysonNetwork.Shared.Models;
using DysonNetwork.Sphere.WebReader;
namespace DysonNetwork.Sphere.Poll;
public class PollWithStats : Poll
{
public PollAnswer? UserAnswer { get; set; }
public SnPollAnswer? UserAnswer { get; set; }
public Dictionary<Guid, Dictionary<string, int>> Stats { get; set; } = new(); // question id -> (option id -> count)
public static PollWithStats FromPoll(Poll poll, PollAnswer? userAnswer = null)
public static PollWithStats FromPoll(Poll poll, SnPollAnswer? userAnswer = null)
{
return new PollWithStats
{