feat(guild): controller scaffolding + /guild/info baseline
- 5 common DTOs under Models/Dtos/Common/Guild/ (GuildDetailDto, GuildUserBaseDto, GuildMemberInfoDto, ChatUserDto, ChatMessageDto) - 28 per-endpoint request/response DTOs under Models/Dtos/Guild/ and Models/Dtos/GuildChat/ with full [MessagePackObject]/[Key]/ [JsonPropertyName] attribute mirrors on every property - GuildController (22 actions): /guild/info returns prod-shape with config-backed max_member_num/max_sub_leader_num/usable_stamp_list; 21 stubs return empty/default DTOs - GuildChatController (7 stubs), /guild_chat/messages stub returns wait_interval=10 per config - 29 new routing smoke test cases (100 total, all pass) - GuildWireShape literal-JSON test for GuildInfoResponse (1/1 pass) - GameConfigurationJsonbTests updated for 17th GuildConfig section - Total: 1422 tests pass, 0 errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>Request for POST /guild_chat/add_deck. Shares a deck snapshot to guild chat.</summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatAddDeckRequest
|
||||
{
|
||||
[JsonPropertyName("viewer_id"), Key("viewer_id")]
|
||||
public string ViewerId { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("steam_id"), Key("steam_id")]
|
||||
public ulong SteamId { get; set; }
|
||||
|
||||
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
|
||||
public string SteamSessionTicket { get; set; } = "";
|
||||
|
||||
/// <summary>API-side Format value of the deck being shared.</summary>
|
||||
[JsonPropertyName("deck_format"), Key("deck_format")]
|
||||
public int DeckFormat { get; set; }
|
||||
|
||||
/// <summary>Slot number of the deck being shared (within the user's regular deck slots).</summary>
|
||||
[JsonPropertyName("deck_no"), Key("deck_no")]
|
||||
public int DeckNo { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>Request for POST /guild_chat/add_replay. Shares a battle replay to guild chat.</summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatAddReplayRequest
|
||||
{
|
||||
[JsonPropertyName("viewer_id"), Key("viewer_id")]
|
||||
public string ViewerId { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("steam_id"), Key("steam_id")]
|
||||
public ulong SteamId { get; set; }
|
||||
|
||||
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
|
||||
public string SteamSessionTicket { get; set; } = "";
|
||||
|
||||
/// <summary>Battle id of the replay being shared. long per spec.</summary>
|
||||
[JsonPropertyName("battle_id"), Key("battle_id")]
|
||||
public long BattleId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>Request for POST /guild_chat/deck_log. No fields — returns all shared decks by format.</summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatDeckLogRequest
|
||||
{
|
||||
[JsonPropertyName("viewer_id"), Key("viewer_id")]
|
||||
public string ViewerId { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("steam_id"), Key("steam_id")]
|
||||
public ulong SteamId { get; set; }
|
||||
|
||||
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
|
||||
public string SteamSessionTicket { get; set; } = "";
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>
|
||||
/// Response for POST /guild_chat/deck_log.
|
||||
/// deck_log keys are stringified API-side Format ints (e.g. "1", "2").
|
||||
/// TODO(task-17): replace deck_log with typed DTOs when DeckLogData shape is fully specified.
|
||||
/// Crossover/MyRotation keys must be OMITTED (not empty arrays) when those formats are disabled.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatDeckLogResponse
|
||||
{
|
||||
[JsonPropertyName("maintenance_card_list"), Key("maintenance_card_list"),
|
||||
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<int> MaintenanceCardList { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Decks shared in chat, bucketed by API-side Format value (stringified int keys).
|
||||
/// JsonElement pass-through for now — Task 17 will type the inner DeckLogEntry shape.
|
||||
/// </summary>
|
||||
[JsonPropertyName("deck_log"), Key("deck_log")]
|
||||
public JsonElement? DeckLog { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>Request for POST /guild_chat/delete_deck. Deletes a previously-shared deck from the chat archive.</summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatDeleteDeckRequest
|
||||
{
|
||||
[JsonPropertyName("viewer_id"), Key("viewer_id")]
|
||||
public string ViewerId { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("steam_id"), Key("steam_id")]
|
||||
public ulong SteamId { get; set; }
|
||||
|
||||
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
|
||||
public string SteamSessionTicket { get; set; } = "";
|
||||
|
||||
/// <summary>API-side Format of the deck being deleted.</summary>
|
||||
[JsonPropertyName("deck_format"), Key("deck_format")]
|
||||
public int DeckFormat { get; set; }
|
||||
|
||||
/// <summary>Message id of the chat message that originally shared the deck.</summary>
|
||||
[JsonPropertyName("message_id"), Key("message_id")]
|
||||
public long MessageId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>
|
||||
/// Response for POST /guild_chat/delete_deck.
|
||||
/// Returns refreshed deck_log after deletion.
|
||||
/// TODO(task-17): replace deck_log with typed DeckLogData DTOs when deck-log shape is fully documented.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatDeleteDeckResponse
|
||||
{
|
||||
[JsonPropertyName("maintenance_card_list"), Key("maintenance_card_list"),
|
||||
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<int> MaintenanceCardList { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Refreshed deck log keyed by API-side Format int (stringified, e.g. "1", "2").
|
||||
/// Using JsonElement for now; Task 17 will type this properly.
|
||||
/// </summary>
|
||||
[JsonPropertyName("deck_log"), Key("deck_log")]
|
||||
public JsonElement? DeckLog { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>Request for POST /guild_chat/messages. Polling endpoint for guild chat.</summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatMessagesRequest
|
||||
{
|
||||
[JsonPropertyName("viewer_id"), Key("viewer_id")]
|
||||
public string ViewerId { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("steam_id"), Key("steam_id")]
|
||||
public ulong SteamId { get; set; }
|
||||
|
||||
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
|
||||
public string SteamSessionTicket { get; set; } = "";
|
||||
|
||||
/// <summary>Anchor message id. 0 = latest log head.</summary>
|
||||
[JsonPropertyName("start_message_id"), Key("start_message_id")]
|
||||
public long StartMessageId { get; set; }
|
||||
|
||||
/// <summary>Chat.eRequestDirection: 1=OLD 2=NEW 3=BOTH.</summary>
|
||||
[JsonPropertyName("direction"), Key("direction")]
|
||||
public int Direction { get; set; }
|
||||
|
||||
/// <summary>Client's current polling interval in seconds.</summary>
|
||||
[JsonPropertyName("wait_interval"), Key("wait_interval")]
|
||||
public int WaitInterval { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>Response for POST /guild_chat/messages.</summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatMessagesResponse
|
||||
{
|
||||
/// <summary>Card ids currently disabled for maintenance — client refreshes its global list.</summary>
|
||||
[JsonPropertyName("maintenance_card_list"), Key("maintenance_card_list"),
|
||||
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<int> MaintenanceCardList { get; set; } = new();
|
||||
|
||||
/// <summary>Users referenced by messages in this batch — deduplicated catalog.</summary>
|
||||
[JsonPropertyName("users"), Key("users"),
|
||||
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<ChatUserDto> Users { get; set; } = new();
|
||||
|
||||
/// <summary>Messages ordered oldest-to-newest.</summary>
|
||||
[JsonPropertyName("chat_message"), Key("chat_message"),
|
||||
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<ChatMessageDto> ChatMessage { get; set; } = new();
|
||||
|
||||
/// <summary>Server-driven polling interval in seconds. Client uses this for the next poll.</summary>
|
||||
[JsonPropertyName("wait_interval"), Key("wait_interval"), JsonConverter(typeof(StringifiedIntConverter)),
|
||||
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public int WaitInterval { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>Request for POST /guild_chat/post. Posts a text message or stamp to guild chat.</summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatPostRequest
|
||||
{
|
||||
[JsonPropertyName("viewer_id"), Key("viewer_id")]
|
||||
public string ViewerId { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("steam_id"), Key("steam_id")]
|
||||
public ulong SteamId { get; set; }
|
||||
|
||||
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
|
||||
public string SteamSessionTicket { get; set; } = "";
|
||||
|
||||
/// <summary>eMessageType: 0=NORMAL (text body), 1=STAMP (stringified stamp id).</summary>
|
||||
[JsonPropertyName("type"), Key("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>Text body for NORMAL; stringified stamp id for STAMP.</summary>
|
||||
[JsonPropertyName("message"), Key("message")]
|
||||
public string Message { get; set; } = "";
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>
|
||||
/// Response for POST /guild_chat/post.
|
||||
/// achieved_info and reward_list are optional; only present when posting triggered a mission completion.
|
||||
/// TODO(task-16): populate achieved_info + reward_list shapes when chat missions are implemented.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatPostResponse
|
||||
{
|
||||
/// <summary>Optional. Present when posting triggered a mission completion.</summary>
|
||||
[JsonPropertyName("achieved_info"), Key("achieved_info")]
|
||||
public JsonElement? AchievedInfo { get; set; }
|
||||
|
||||
/// <summary>Optional. Goods deltas from any rewards in achieved_info.</summary>
|
||||
[JsonPropertyName("reward_list"), Key("reward_list")]
|
||||
public JsonElement? RewardList { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>Request for POST /guild_chat/replay_detail. Fetches full replay payload for a shared replay.</summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatReplayDetailRequest
|
||||
{
|
||||
[JsonPropertyName("viewer_id"), Key("viewer_id")]
|
||||
public string ViewerId { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("steam_id"), Key("steam_id")]
|
||||
public ulong SteamId { get; set; }
|
||||
|
||||
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
|
||||
public string SteamSessionTicket { get; set; } = "";
|
||||
|
||||
/// <summary>Message id of the REPLAY chat message.</summary>
|
||||
[JsonPropertyName("message_id"), Key("message_id")]
|
||||
public long MessageId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
|
||||
|
||||
/// <summary>
|
||||
/// Response for POST /guild_chat/replay_detail.
|
||||
/// Shape is opaque pending replay-subsystem documentation.
|
||||
/// TODO(task-17): enumerate fields from Wizard/ReplayDetailInfo.cs when replay subsystem is documented.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class GuildChatReplayDetailResponse
|
||||
{
|
||||
// Placeholder — replay detail shape is undocumented until we capture a live trace.
|
||||
// Using JsonElement pass-through for now.
|
||||
[JsonPropertyName("_todo"), Key("_todo")]
|
||||
public JsonElement? Placeholder { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user