feat(account): /account/update_region_code (accept-only)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SVSim.Database;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests.Account;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Controllers;
|
||||
@@ -46,4 +47,14 @@ public class AccountController : SVSimController
|
||||
// so the translation middleware emits the right msgpack shape.
|
||||
return Ok(Array.Empty<object>());
|
||||
}
|
||||
|
||||
[HttpPost("update_region_code")]
|
||||
public ActionResult<EmptyResponse> UpdateRegionCode([FromBody] AccountUpdateRegionCodeRequest _)
|
||||
{
|
||||
if (!TryGetViewerId(out long __)) return Unauthorized();
|
||||
// No-op: actual region value is sent in the REGION_CODE HTTP header, which we
|
||||
// don't currently consume server-side. The body carries only initialize_flag,
|
||||
// which is a first-set-vs-update signal we have no use for yet.
|
||||
return new EmptyResponse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Requests.Account;
|
||||
|
||||
[MessagePackObject]
|
||||
public class AccountUpdateRegionCodeRequest : BaseRequest
|
||||
{
|
||||
[JsonPropertyName("initialize_flag")]
|
||||
[Key("initialize_flag")]
|
||||
public int InitializeFlag { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user