mirror of
https://github.com/CommonLoon102/NBloodServerSupervisor.git
synced 2025-01-03 16:42:40 +01:00
33 lines
999 B
C#
33 lines
999 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
using WebInterface.Services;
|
|||
|
|
|||
|
namespace WebInterface.Controllers
|
|||
|
{
|
|||
|
public class CustomMapsController : Controller
|
|||
|
{
|
|||
|
private readonly ICustomMapService _customMapService;
|
|||
|
|
|||
|
public CustomMapsController(ICustomMapService customMapService)
|
|||
|
{
|
|||
|
_customMapService = customMapService;
|
|||
|
}
|
|||
|
|
|||
|
[Route("nblood/custommaps", Name = "CustomMaps")]
|
|||
|
public IActionResult Index()
|
|||
|
{
|
|||
|
var viewModel = _customMapService.ListCustomMaps();
|
|||
|
return View(viewModel);
|
|||
|
}
|
|||
|
|
|||
|
[Route("nblood/custommaps/download", Name = "DownloadCustomMap")]
|
|||
|
public FileResult Index([FromQuery] string map)
|
|||
|
{
|
|||
|
byte[] customMap = _customMapService.GetCustomMapBytes(map);
|
|||
|
return File(customMap, System.Net.Mime.MediaTypeNames.Application.Octet, map);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|