feat(mission): /mission/receive_reward stub (refresh-only, no decomp)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ using SVSim.Database.Repositories.Mission;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Common.Mission;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Mission;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests.Mission;
|
||||
using SVSim.EmulatedEntrypoint.Services;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Controllers;
|
||||
@@ -133,6 +134,22 @@ public class MissionController : SVSimController
|
||||
return Ok(dto);
|
||||
}
|
||||
|
||||
[HttpPost("receive_reward")]
|
||||
public async Task<IActionResult> ReceiveReward(MissionReceiveRewardRequest _, CancellationToken ct)
|
||||
{
|
||||
if (!TryGetViewerId(out long viewerId)) return Unauthorized();
|
||||
|
||||
// Spec is INFERRED — no decomp task class. Safe stub: refresh MissionInfoDetail
|
||||
// so the client sees its current state. Real reward granting deferred until we
|
||||
// observe a wire call.
|
||||
var viewer = await LoadViewer(viewerId, ct);
|
||||
await _state.EnsureCurrentAsync(viewer.Id, ct);
|
||||
await _db.SaveChangesAsync(ct);
|
||||
|
||||
var dto = await _assembler.BuildAsync(viewer, ct);
|
||||
return Ok(dto);
|
||||
}
|
||||
|
||||
private Task<Viewer> LoadViewer(long viewerId, CancellationToken ct) =>
|
||||
_db.Viewers
|
||||
.Include(v => v.MissionData)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using MessagePack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Requests.Mission;
|
||||
|
||||
/// <summary>
|
||||
/// INFERRED shape — the spec at docs/api-spec/endpoints/post-login/mission-receive-reward.md
|
||||
/// flags this as not present in the client decompilation. Almost certainly an id of the
|
||||
/// mission to claim.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class MissionReceiveRewardRequest : BaseRequest
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
[Key("id")]
|
||||
public long Id { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user