SES-69 Added controllers and one method

This commit is contained in:
Łukasz Góreczny 2020-12-06 14:34:19 +01:00
parent b6a80a2e89
commit 6cc4ed74a9
5 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Mvc;
using SessionCompanion.Services.Interfaces;
namespace SessionCompanion.Controllers
{
[Route("api/background")]
[ApiController]
public class BackgroundController : Controller
{
private readonly IBackgroundService _service;
public BackgroundController(IBackgroundService service)
{
_service = service;
}
}
}

View File

@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Mvc;
using SessionCompanion.Services.Interfaces;
namespace SessionCompanion.Controllers
{
[Route("api/biography")]
[ApiController]
public class BiographyController : Controller
{
private readonly IBiographyService _service;
public BiographyController(IBiographyService service)
{
_service = service;
}
}
}

View File

@ -0,0 +1,33 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using SessionCompanion.Services.Interfaces;
namespace SessionCompanion.Controllers
{
using SessionCompanion.ViewModels.CharacterViewModels;
[Route("api/character")]
[ApiController]
public class CharacterController : Controller
{
private readonly ICharacterService _service;
public CharacterController(ICharacterService service)
{
this._service = service;
}
/// <summary>
/// Metoda zwraca postać ze wskazanym identyfikatorem
/// </summary>
/// <param name="id">Identyfikator postaci</param>
/// <returns>ViewModel Postaci</returns>
[HttpGet("{id}")]
public async Task<CharacterViewModel> Get(int id)
{
return await _service.Get(id);
}
}
}

View File

@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Mvc;
using SessionCompanion.Services.Interfaces;
namespace SessionCompanion.Controllers
{
[Route("api/statistic")]
[ApiController]
public class StatisticController : Controller
{
private readonly IStatisticsService _service;
public StatisticController(IStatisticsService service)
{
this._service = service;
}
}
}

View File

@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Mvc;
using SessionCompanion.Services.Interfaces;
namespace SessionCompanion.Controllers
{
[Route("api/user")]
[ApiController]
public class UserController : Controller
{
private readonly IUserService _service;
public UserController(IUserService service)
{
this._service = service;
}
}
}