wabbajack/Wabbajack.Server/Controllers/ModFiles.cs

29 lines
765 B
C#
Raw Normal View History

2021-11-28 05:21:28 +00:00
using Microsoft.AspNetCore.Authorization;
2020-06-21 22:03:54 +00:00
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
2021-11-28 05:21:28 +00:00
using Wabbajack.DTOs;
2021-09-27 12:42:46 +00:00
using Wabbajack.DTOs.JsonConverters;
2020-06-21 22:03:54 +00:00
2021-10-23 16:51:17 +00:00
namespace Wabbajack.BuildServer.Controllers;
[Authorize(Roles = "User")]
[ApiController]
[Route("/mod_files")]
public class ModFilesForHash : ControllerBase
2020-06-21 22:03:54 +00:00
{
2021-10-23 16:51:17 +00:00
private readonly DTOSerializer _dtos;
private ILogger<ModFilesForHash> _logger;
2020-06-21 22:03:54 +00:00
2021-11-28 05:21:28 +00:00
public ModFilesForHash(ILogger<ModFilesForHash> logger, DTOSerializer dtos)
2021-10-23 16:51:17 +00:00
{
_logger = logger;
_dtos = dtos;
}
2020-06-21 22:03:54 +00:00
2021-10-23 16:51:17 +00:00
[HttpGet("by_hash/{hashAsHex}")]
public async Task<IActionResult> GetByHash(string hashAsHex)
{
2021-11-28 05:21:28 +00:00
var empty = Array.Empty<Archive>();
return Ok(_dtos.Serialize(empty));
2020-06-21 22:03:54 +00:00
}
2021-10-23 16:51:17 +00:00
}