Account rewind controller

This commit is contained in:
2025-12-25 22:47:01 +08:00
parent 1a31d7cbe7
commit 1af11b2a99

View File

@@ -1,6 +1,19 @@
using DysonNetwork.Shared.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace DysonNetwork.Pass.Rewind;
public class AccountRewindController
[ApiController]
[Route("/api/rewind")]
public class AccountRewindController(AccountRewindService rewindSrv) : ControllerBase
{
[HttpGet("me")]
[Authorize]
public async Task<ActionResult<SnRewindPoint>> GetCurrentRewindPoint()
{
if (HttpContext.Items["CurrentUser"] is not SnAccount currentUser) return Unauthorized();
var point = await rewindSrv.GetOrCreateRewindPoint(currentUser.Id);
return Ok(point);
}
}