feat: V2 microservices stack — backend services, gateway, JWT auth
Add full V2 architecture: identity, content, studio (.NET 10) and file, render, notification, gateway (Go) services with vendored deps, plus DB migrations, event/API contracts, and an init-db script. Wire the Next.js frontend to the gateway: server-side JWT auth routes (login/register/refresh/logout/me), gateway fetch helper, and session/ cookie/jwt helpers under src/lib. Containerize the stack via docker-compose.v2.yml and per-service Dockerfiles. Base images resolve through a Nexus mirror (Docker Hub) and MCR directly; npm/NuGet pull from Nexus groups. Self-host fonts via next/font/local to avoid Google Fonts (geo-blocked). Add CI workflow and ignore .env.v2, *.stackdump, and .NET bin/obj. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
using FlatRender.IdentitySvc.Domain.Enums;
|
||||
|
||||
namespace FlatRender.IdentitySvc.Domain.Entities;
|
||||
|
||||
public class Quest
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
public string Title { get; set; } = default!;
|
||||
public string? Challenge { get; set; }
|
||||
public string? Why { get; set; }
|
||||
public string? Hint { get; set; }
|
||||
public string? Aphorism { get; set; }
|
||||
public string? Icon { get; set; }
|
||||
|
||||
public QuestType QuestType { get; set; }
|
||||
public string TargetEvent { get; set; } = default!;
|
||||
public int TargetCount { get; set; } = 1;
|
||||
public string Metadata { get; set; } = "{}";
|
||||
|
||||
public PrizeType PrizeType { get; set; }
|
||||
public long PrizeAmount { get; set; }
|
||||
|
||||
public int? LevelLimit { get; set; }
|
||||
public string? StartUrl { get; set; }
|
||||
public string? PostActionName { get; set; }
|
||||
public int OrderValue { get; set; }
|
||||
|
||||
public DateTime? StartsAt { get; set; }
|
||||
public DateTime? ExpiresAt { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public ICollection<UserQuestProgress> Progress { get; set; } = [];
|
||||
}
|
||||
|
||||
public class UserQuestProgress
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid UserId { get; set; }
|
||||
public Guid QuestId { get; set; }
|
||||
public Quest Quest { get; set; } = default!;
|
||||
|
||||
public int CurrentCount { get; set; }
|
||||
public string? TextValue { get; set; }
|
||||
public bool IsCompleted { get; set; }
|
||||
public DateTime? CompletedAt { get; set; }
|
||||
public bool PrizeClaimed { get; set; }
|
||||
public DateTime? PrizeClaimedAt { get; set; }
|
||||
public DateOnly? PeriodStart { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class Gift
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
public string Name { get; set; } = default!;
|
||||
public string? Description { get; set; }
|
||||
public string? Icon { get; set; }
|
||||
public GiftType GiftType { get; set; }
|
||||
public PrizeType PrizeType { get; set; }
|
||||
public long Value { get; set; }
|
||||
public string? Unit { get; set; }
|
||||
|
||||
public Guid? AssignedByUserId { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public ICollection<EarnedGift> EarnedGifts { get; set; } = [];
|
||||
}
|
||||
|
||||
public class EarnedGift
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid UserId { get; set; }
|
||||
public Guid GiftId { get; set; }
|
||||
public Gift Gift { get; set; } = default!;
|
||||
public Guid? NotificationId { get; set; }
|
||||
public string? Source { get; set; }
|
||||
public Guid? SourceRef { get; set; }
|
||||
|
||||
public DateTime EarnedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? ExpiresAt { get; set; }
|
||||
public bool IsUsed { get; set; }
|
||||
public DateTime? UsedAt { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class Avatar
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Code { get; set; } = default!;
|
||||
public string Url { get; set; } = default!;
|
||||
public string? Description { get; set; }
|
||||
public int Sort { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
Reference in New Issue
Block a user