SES-69 Added controllers and comments #17

Merged
s426135 merged 2 commits from SES-69 into master 2020-12-06 15:29:13 +01:00
5 changed files with 102 additions and 0 deletions
Showing only changes of commit 6cc4ed74a9 - Show all commits

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;
}
}
}