SES-69 Added controllers and comments #17
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user