Files
SVSimServer/SVSim.EmulatedEntrypoint/Models/Dtos/RankBattle/RankBattleFinishRequestDto.cs
gamer147 7c4aa89d45 feat(rank-battle): RankBattleController shell + DTOs + routing smoke tests
Stands up the controller with all 13 rank-battle URL routes wired via
explicit absolute [HttpPost] attributes (multi-prefix family — can't ride
[Route(\"[controller]\")]). Real DoMatching / AiStart logic arrives in
later tasks; finish + telemetry + force-finish are returnable stubs as
of this task.

DTOs cover the request + response shapes per the spec. Note the
camelCase wire keys on AiBattlePlayerInfo (sleeveId, emblemId, ...) —
the AI battle subsystem uses camelCase, not the project-default
snake_case, per AIBattleStartTask.Parse's literal Keys.Contains lookups.

DoMatchingResponseDto.NodeServerUrl is non-nullable + always-emit (with
[JsonIgnore(Never)]) — matches Phase 2's TK2 fix because the client's
DoMatchingBase parser calls .ToString() without a Keys.Contains guard.

13 routing smoke tests confirm each URL resolves to the controller.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 01:19:02 -04:00

47 lines
1.3 KiB
C#

using System.Text.Json.Serialization;
using MessagePack;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.RankBattle;
/// <summary>
/// Standard BattleFinishParam shape — see docs/api-spec/common/types.ts.md and
/// docs/api-spec/endpoints/post-login/rank-battle/finish.md. Future: promote to
/// a shared common DTO when a second finish endpoint reuses this.
/// </summary>
[MessagePackObject(keyAsPropertyName: true)]
public sealed class RankBattleFinishRequestDto
{
[JsonPropertyName("battle_result")]
[Key("battle_result")]
public int BattleResult { get; set; }
[JsonPropertyName("is_retire")]
[Key("is_retire")]
public int IsRetire { get; set; }
[JsonPropertyName("recovery_data")]
[Key("recovery_data")]
public string? RecoveryData { get; set; }
[JsonPropertyName("class_id")]
[Key("class_id")]
public int ClassId { get; set; }
[JsonPropertyName("total_turn")]
[Key("total_turn")]
public int TotalTurn { get; set; }
[JsonPropertyName("evolve_count")]
[Key("evolve_count")]
public int EvolveCount { get; set; }
[JsonPropertyName("enemy_evolve_count")]
[Key("enemy_evolve_count")]
public int EnemyEvolveCount { get; set; }
// RankBattleFinishTask extends BattleFinishParam with SDTRB.
[JsonPropertyName("sdtrb")]
[Key("sdtrb")]
public int Sdtrb { get; set; }
}