diff --git a/SVSim.EmulatedEntrypoint/Controllers/MyPageController.cs b/SVSim.EmulatedEntrypoint/Controllers/MyPageController.cs index fbcdf8c0..87cadb9c 100644 --- a/SVSim.EmulatedEntrypoint/Controllers/MyPageController.cs +++ b/SVSim.EmulatedEntrypoint/Controllers/MyPageController.cs @@ -9,6 +9,7 @@ using SVSim.Database.Services; using SVSim.EmulatedEntrypoint.Constants; using SVSim.EmulatedEntrypoint.Infrastructure; using SVSim.EmulatedEntrypoint.Models.Dtos; +using SVSim.EmulatedEntrypoint.Models.Dtos.Common; using SVSim.EmulatedEntrypoint.Models.Dtos.Requests; using SVSim.EmulatedEntrypoint.Models.Dtos.Requests.MyPage; using SVSim.EmulatedEntrypoint.Models.Dtos.Responses; @@ -370,4 +371,13 @@ public class MyPageController : SVSimController if (!TryGetViewerId(out long __)) return Unauthorized(); return new MyPageFinishBattleResponse { CheckUnfinishedBattle = 0 }; } + + [HttpPost("get_special_crystal_info")] + public ActionResult GetSpecialCrystalInfo([FromBody] BaseRequest _) + { + if (!TryGetViewerId(out long __)) return Unauthorized(); + // No special-crystal offers configured. Spec mock is `data: {}` for the no-offers + // case — special_crystal_info field is optional and omitted when absent. + return new EmptyResponse(); + } } diff --git a/SVSim.UnitTests/Controllers/MyPageControllerSpecialCrystalInfoTests.cs b/SVSim.UnitTests/Controllers/MyPageControllerSpecialCrystalInfoTests.cs new file mode 100644 index 00000000..1801f561 --- /dev/null +++ b/SVSim.UnitTests/Controllers/MyPageControllerSpecialCrystalInfoTests.cs @@ -0,0 +1,23 @@ +using System.Net; +using System.Text; +using NUnit.Framework; +using SVSim.UnitTests.Infrastructure; + +namespace SVSim.UnitTests.Controllers; + +public class MyPageControllerSpecialCrystalInfoTests +{ + [Test] + public async Task GetSpecialCrystalInfo_returns_empty() + { + using var factory = new SVSimTestFactory(); + long viewerId = await factory.SeedViewerAsync(tutorialState: 0); + using var client = factory.CreateAuthenticatedClient(viewerId); + + var requestJson = """{"viewer_id":"0","steam_id":0,"steam_session_ticket":""}"""; + var response = await client.PostAsync("/mypage/get_special_crystal_info", + new StringContent(requestJson, Encoding.UTF8, "application/json")); + + Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); + } +}