feat(guild_chat): post text + stamp

Implements PostTextOrStampAsync: validates membership (NotInGuild),
validates stamp id against UsableStampList (PermissionDenied), rejects
type other than 0 or 1, allocates next per-guild message_id, appends row.
Wires /guild_chat/post controller action mapping failures to result_code=2.
Response is GuildChatPostResponse (empty body per spec). 7 integration tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-27 14:58:18 -04:00
parent a248c167e0
commit ab1e23b7cb
3 changed files with 338 additions and 5 deletions

View File

@@ -78,8 +78,13 @@ public sealed class GuildChatController : SVSimController
}
[HttpPost("post")]
public Task<ActionResult<GuildChatPostResponse>> Post([FromBody] GuildChatPostRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildChatPostResponse>>(new GuildChatPostResponse());
public async Task<ActionResult<GuildChatPostResponse>> Post([FromBody] GuildChatPostRequest req, CancellationToken ct)
{
if (!TryGetViewerId(out var viewerId)) return Unauthorized();
var result = await _chat.PostTextOrStampAsync(viewerId, req.Type, req.Message, ct);
if (!result.Ok) return Ok(new { result_code = 2 });
return new GuildChatPostResponse();
}
[HttpPost("add_deck")]
public Task<ActionResult<EmptyResponse>> AddDeck([FromBody] GuildChatAddDeckRequest req, CancellationToken ct)