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:
gamer147
2026-06-27 12:01:27 -04:00
parent a1aa6998b8
commit 99019963ca
50 changed files with 1576 additions and 3 deletions

View File

@@ -0,0 +1,54 @@
using MessagePack;
using System.Text.Json;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
/// <summary>
/// Wire shape for a single chat message in /guild_chat/messages `chat_message[]`
/// and /gathering_chat/messages. Matches guild_chat-messages.md ChatMessage interface.
///
/// deck / replay / room are JsonElement? so arbitrary payloads can pass through in Phase 5
/// without premature typing (TODO task-17: replace with typed DTOs when replay subsystem is documented).
/// </summary>
[MessagePackObject]
public class ChatMessageDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("message_id"), Key("message_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long MessageId { get; set; }
/// <summary>eMessageType: 0=NORMAL 1=STAMP 2=DECK 3=JOIN 4=LEAVE 5=REPLAY etc.</summary>
[JsonPropertyName("message_type"), Key("message_type"), JsonConverter(typeof(StringifiedIntConverter))]
public int MessageType { get; set; }
[JsonPropertyName("create_time"), Key("create_time"), JsonConverter(typeof(StringifiedLongConverter))]
public long CreateTime { get; set; }
/// <summary>Text body for NORMAL, stringified stamp id for STAMP, etc.</summary>
[JsonPropertyName("message"), Key("message")]
public string Message { get; set; } = "";
/// <summary>Present when message_type = DECK (2). Inline DeckLogData payload.</summary>
[JsonPropertyName("deck"), Key("deck")]
public JsonElement? Deck { get; set; }
/// <summary>Present when message_type = REPLAY (5). Inline ReplayInfoItem payload.</summary>
[JsonPropertyName("replay"), Key("replay")]
public JsonElement? Replay { get; set; }
/// <summary>Present when message_type = ROOM_MATCH (10). Inline room-invite payload.</summary>
[JsonPropertyName("room"), Key("room")]
public JsonElement? Room { get; set; }
/// <summary>GATHERING_TOURNAMENT_ROOM extras — only meaningful for /gathering_chat.</summary>
[JsonPropertyName("viewer_id1"), Key("viewer_id1")]
public long? ViewerId1 { get; set; }
/// <summary>GATHERING_TOURNAMENT_ROOM extras — only meaningful for /gathering_chat.</summary>
[JsonPropertyName("viewer_id2"), Key("viewer_id2")]
public long? ViewerId2 { get; set; }
}

View File

@@ -0,0 +1,39 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
/// <summary>
/// Generic UserInfoBase shape for chat contexts — used in /guild_chat/messages `users[]`
/// and shared with /gathering_chat. Matches types.ts.md#user-profile-types ChatUser (UserInfoBase).
/// </summary>
[MessagePackObject]
public class ChatUserDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("name"), Key("name")]
public string Name { get; set; } = "";
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long EmblemId { get; set; }
[JsonPropertyName("country_code"), Key("country_code")]
public string CountryCode { get; set; } = "";
[JsonPropertyName("rank"), Key("rank"), JsonConverter(typeof(StringifiedIntConverter))]
public int Rank { get; set; }
[JsonPropertyName("degree_id"), Key("degree_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int DegreeId { get; set; }
/// <summary>Optional — omit when the viewer has no friend relationship with this user.</summary>
[JsonPropertyName("is_friend"), Key("is_friend")]
public int? IsFriend { get; set; }
/// <summary>Optional — omit when no pending friend apply.</summary>
[JsonPropertyName("is_friend_apply"), Key("is_friend_apply")]
public int? IsFriendApply { get; set; }
}

View File

@@ -0,0 +1,41 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
/// <summary>
/// Mirrors GuildDetailInfo.cs:143-156. Wire ints are emitted as stringified.
/// member_num is included on the wire only when this dto represents a search-result row
/// (the /guild/info "detail" inside `guild` object also includes it).
/// </summary>
[MessagePackObject]
public class GuildDetailDto
{
[JsonPropertyName("guild_id"), Key("guild_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int GuildId { get; set; }
[JsonPropertyName("guild_name"), Key("guild_name")]
public string GuildName { get; set; } = "";
[JsonPropertyName("description"), Key("description")]
public string Description { get; set; } = "";
[JsonPropertyName("guild_emblem_id"), Key("guild_emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long GuildEmblemId { get; set; }
[JsonPropertyName("join_condition"), Key("join_condition"), JsonConverter(typeof(StringifiedIntConverter))]
public int JoinCondition { get; set; }
[JsonPropertyName("activity"), Key("activity"), JsonConverter(typeof(StringifiedIntConverter))]
public int Activity { get; set; }
[JsonPropertyName("member_num"), Key("member_num"), JsonConverter(typeof(StringifiedIntConverter))]
public int MemberNum { get; set; }
[JsonPropertyName("leader_name"), Key("leader_name")]
public string LeaderName { get; set; } = "";
[JsonPropertyName("leader_viewer_id"), Key("leader_viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long LeaderViewerId { get; set; }
}

View File

@@ -0,0 +1,52 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
/// <summary>
/// GuildMember wire shape — extends UserInfoBase (flat-spread) with is_official_mark_displayed + role.
/// Matches GuildMemberInfo.cs:43-50 and types.ts.md#guild-types GuildMember.
/// role: 0 = REGULAR, 1 = LEADER, 2 = SUB_LEADER.
/// </summary>
[MessagePackObject]
public class GuildMemberInfoDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("name"), Key("name")]
public string Name { get; set; } = "";
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long EmblemId { get; set; }
[JsonPropertyName("country_code"), Key("country_code")]
public string CountryCode { get; set; } = "";
[JsonPropertyName("rank"), Key("rank"), JsonConverter(typeof(StringifiedIntConverter))]
public int Rank { get; set; }
[JsonPropertyName("degree_id"), Key("degree_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int DegreeId { get; set; }
/// <summary>Optional — omit when the caller has no friend relationship with this member.</summary>
[JsonPropertyName("is_friend"), Key("is_friend")]
public int? IsFriend { get; set; }
/// <summary>Optional — omit when no pending friend apply.</summary>
[JsonPropertyName("is_friend_apply"), Key("is_friend_apply")]
public int? IsFriendApply { get; set; }
/// <summary>
/// Whether the official-account badge is shown for this member.
/// Client reads this unconditionally from GuildMemberInfo.Parse — always emit it.
/// </summary>
[JsonPropertyName("is_official_mark_displayed"), Key("is_official_mark_displayed"),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public int IsOfficialMarkDisplayed { get; set; }
/// <summary>0 = REGULAR, 1 = LEADER, 2 = SUB_LEADER. Stringified.</summary>
[JsonPropertyName("role"), Key("role"), JsonConverter(typeof(StringifiedIntConverter))]
public int Role { get; set; }
}

View File

@@ -0,0 +1,40 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
/// <summary>
/// UserInfoBase flat-spread fields as used in guild contexts (GuildMemberInfo.cs, invite lists, etc.).
/// viewer_id / name / emblem_id / country_code / rank / degree_id / is_friend? / is_friend_apply?.
/// Matches types.ts.md#user-profile-types UserInfoBase.
/// </summary>
[MessagePackObject]
public class GuildUserBaseDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("name"), Key("name")]
public string Name { get; set; } = "";
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long EmblemId { get; set; }
[JsonPropertyName("country_code"), Key("country_code")]
public string CountryCode { get; set; } = "";
[JsonPropertyName("rank"), Key("rank"), JsonConverter(typeof(StringifiedIntConverter))]
public int Rank { get; set; }
[JsonPropertyName("degree_id"), Key("degree_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int DegreeId { get; set; }
/// <summary>Optional — omit when the caller has no friend relationship with this user.</summary>
[JsonPropertyName("is_friend"), Key("is_friend")]
public int? IsFriend { get; set; }
/// <summary>Optional — omit when the caller has no pending friend apply to this user.</summary>
[JsonPropertyName("is_friend_apply"), Key("is_friend_apply")]
public int? IsFriendApply { get; set; }
}