Increment View count
misc fixes
This commit is contained in:
@@ -6,13 +6,13 @@ namespace AobaServer.Controllers.Api;
|
||||
public class AuthApi : ControllerBase
|
||||
{
|
||||
[HttpGet("login")]
|
||||
public async Task<IActionResult> LoginAsync()
|
||||
public Task<IActionResult> LoginAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet("register")]
|
||||
public async Task<IActionResult> RegisterAsync()
|
||||
public Task<IActionResult> RegisterAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ using MongoDB.Driver;
|
||||
namespace AobaServer.Controllers;
|
||||
|
||||
[Route("/m")]
|
||||
public class MediaController(MediaService mediaService, ILogger<MediaController> logger) : Controller
|
||||
public class MediaController(MediaService mediaService, AobaService aobaService, ILogger<MediaController> logger) : Controller
|
||||
{
|
||||
[HttpGet("{id}")]
|
||||
[ResponseCache(Duration = int.MaxValue)]
|
||||
@@ -23,6 +23,7 @@ public class MediaController(MediaService mediaService, ILogger<MediaController>
|
||||
return NotFound();
|
||||
}
|
||||
var mime = MimeTypesMap.GetMimeType(file.Value.FileInfo.Filename);
|
||||
_ = aobaService.IncrementFileViewCountAsync(id);
|
||||
return File(file, mime, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user