rename server

This commit is contained in:
2025-04-14 21:38:30 -04:00
parent 6410d84754
commit 93c04b9535
13 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Mvc;
namespace AobaV2.Controllers.Api;
[Route("/api/auth")]
public class AuthApi : ControllerBase
{
[HttpGet("login")]
public async Task<IActionResult> LoginAsync()
{
throw new NotImplementedException();
}
[HttpGet("register")]
public async Task<IActionResult> RegisterAsync()
{
throw new NotImplementedException();
}
}

View File

@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace AobaV2.Controllers;
[AllowAnonymous]
[Route("auth")]
public class AuthController : Controller
{
[HttpGet("login")]
public IActionResult Login([FromQuery] string returnUrl)
{
ViewData["returnUrl"] = returnUrl;
return View();
}
[HttpGet("register/{token}")]
public IActionResult Register(string token)
{
return View(token);
}
}

View File

@@ -0,0 +1,27 @@
using AobaCore;
using Microsoft.AspNetCore.Mvc;
using MongoDB.Bson;
using MongoDB.Driver;
namespace AobaV2.Controllers;
[Route("/m")]
public class MediaController(MediaService media) : Controller
{
[HttpGet("{id}")]
public IActionResult Media(ObjectId id)
{
return View();
}
[HttpGet("/i/{id}/{*rest}")]
public async Task<IActionResult> LegacyRedirectAsync(ObjectId id, string rest, [FromServices] AobaService aoba)
{
var media = await aoba.GetMediaAsync(id);
if (media == null)
return NotFound();
return LocalRedirectPermanent($"/m/{media.Id}/{rest}");
}
}