This commit is contained in:
@ -1,73 +0,0 @@
|
||||
using HanyadikHetVan.Data.Entities;
|
||||
using HanyadikHetVan.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HanyadikHetVan.Controllers
|
||||
{
|
||||
[Route("api/pauses")]
|
||||
[ApiController]
|
||||
public class PauseController
|
||||
{
|
||||
private readonly PauseService _pauseService;
|
||||
|
||||
public PauseController(PauseService pauseService)
|
||||
{
|
||||
_pauseService = pauseService;
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<Object> AddPause([FromBody] Pause pause)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _pauseService.AddPause(pause);
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
[HttpDelete("{pauseId}")]
|
||||
public bool DeletePause(int pauseId)
|
||||
{
|
||||
try
|
||||
{
|
||||
_pauseService.DeletePause(pauseId);
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
[HttpPut]
|
||||
public bool UpdatePause([FromBody] Pause pause)
|
||||
{
|
||||
try
|
||||
{
|
||||
_pauseService.UpdatePause(pause);
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
public Object GetAllPauses()
|
||||
{
|
||||
var data = _pauseService.GetAllPauses();
|
||||
var json = JsonConvert.SerializeObject(data, Formatting.Indented,
|
||||
new JsonSerializerSettings()
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
|
||||
}
|
||||
);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace HanyadikHetVan.Controllers
|
||||
{
|
||||
[Route("api/test")]
|
||||
[ApiController]
|
||||
public class TestController : ControllerBase
|
||||
{
|
||||
[HttpGet("unprotected")]
|
||||
public string Unprotected()
|
||||
{
|
||||
|
||||
return "Unprotected";
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpGet("protected")]
|
||||
public string Protected()
|
||||
{
|
||||
|
||||
return "Protected";
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HanyadikHetVan.Controllers
|
||||
{
|
||||
public class UserController
|
||||
{
|
||||
}
|
||||
}
|
@ -1,12 +1,14 @@
|
||||
using HanyadikHetVan.DTO;
|
||||
using HanyadikHetVan.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Net.Mime;
|
||||
|
||||
namespace HanyadikHetVan.Controllers
|
||||
namespace HanyadikHetVan.Controllers.V1
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/hanyadikhetvan")]
|
||||
public class HanyadikHetVanController : ControllerBase
|
||||
[ApiVersion("1.0")]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
public class HanyadikHetVanController : Controller
|
||||
{
|
||||
|
||||
private readonly HanyadikHetVanJsonService _jsonservice;
|
||||
@ -20,7 +22,8 @@ namespace HanyadikHetVan.Controllers
|
||||
}
|
||||
|
||||
[HttpGet("json")]
|
||||
[Consumes("application/json")]
|
||||
[Consumes(MediaTypeNames.Application.Json)]
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
public HanyadikHetVanDTO GetJson()
|
||||
{
|
||||
return _jsonservice.HanyadikHetVan();
|
37
HanyadikHetVan/Controllers/V1/TestController.cs
Normal file
37
HanyadikHetVan/Controllers/V1/TestController.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace HanyadikHetVan.Controllers.V1
|
||||
{
|
||||
[ApiVersion("1.0")]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
[ApiController]
|
||||
public class TestController : Controller
|
||||
{
|
||||
private UserManager<IdentityUser> _userManager;
|
||||
|
||||
public TestController(UserManager<IdentityUser> userManager)
|
||||
{
|
||||
_userManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
|
||||
}
|
||||
|
||||
[HttpGet("unprotected")]
|
||||
[Produces("application/json")]
|
||||
public string Unprotected()
|
||||
{
|
||||
|
||||
return "Unprotected";
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpGet("protected")]
|
||||
[Produces("application/json")]
|
||||
public string Protected()
|
||||
{
|
||||
return this.User.FindFirst(ClaimTypes.NameIdentifier).Value;
|
||||
}
|
||||
}
|
||||
}
|
53
HanyadikHetVan/Controllers/V2/HanyadikHetVanController.cs
Normal file
53
HanyadikHetVan/Controllers/V2/HanyadikHetVanController.cs
Normal file
@ -0,0 +1,53 @@
|
||||
using HanyadikHetVan.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HanyadikHetVan.Controllers.V2
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("2.0")]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
public class HanyadikHetVanController : Controller
|
||||
{
|
||||
private readonly HanyadikHetVanEntityService _hanyadikHetVanEntityService;
|
||||
|
||||
public HanyadikHetVanController(HanyadikHetVanEntityService hanyadikHetVanEntityService)
|
||||
{
|
||||
_hanyadikHetVanEntityService = hanyadikHetVanEntityService ?? throw new ArgumentNullException(nameof(hanyadikHetVanEntityService));
|
||||
}
|
||||
|
||||
[HttpGet("{weeklytimespanId}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(int))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetWeekById(int weeklytimespanId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var wts = await _hanyadikHetVanEntityService.GetWeekById(weeklytimespanId);
|
||||
return Ok(wts);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(int))]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public async Task<IActionResult> GetDefaultWeek()
|
||||
{
|
||||
try
|
||||
{
|
||||
var wts = await _hanyadikHetVanEntityService.GetDefaultWeek();
|
||||
return Ok(wts);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
100
HanyadikHetVan/Controllers/V2/PauseController.cs
Normal file
100
HanyadikHetVan/Controllers/V2/PauseController.cs
Normal file
@ -0,0 +1,100 @@
|
||||
using HanyadikHetVan.DTO;
|
||||
using HanyadikHetVan.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Mime;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HanyadikHetVan.Controllers.V2
|
||||
{
|
||||
[ApiVersion("2.0")]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
[ApiController]
|
||||
public class PauseController : Controller
|
||||
{
|
||||
private readonly PauseService _pauseService;
|
||||
|
||||
public PauseController(PauseService pauseService)
|
||||
{
|
||||
_pauseService = pauseService;
|
||||
}
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
[Consumes(MediaTypeNames.Application.Json)]
|
||||
[ProducesResponseType(StatusCodes.Status201Created, Type = typeof(WeeklyTimeSpanDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
public async Task<IActionResult> AddPause([FromBody] PauseDTO pause)
|
||||
{
|
||||
try
|
||||
{
|
||||
var obj = await _pauseService.AddPause(pause);
|
||||
return CreatedAtAction(nameof(GetPauseById),new { pauseId = obj.Id } ,obj);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return BadRequest();
|
||||
}
|
||||
}
|
||||
[HttpDelete("{pauseId}")]
|
||||
[Authorize]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(WeeklyTimeSpanDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
public async Task<IActionResult> DeletePause(int pauseId)
|
||||
{
|
||||
var result = await _pauseService.DeletePause(pauseId);
|
||||
if (result)
|
||||
{
|
||||
return Ok(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
[HttpPut]
|
||||
[Authorize]
|
||||
[Consumes(MediaTypeNames.Application.Json)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(PauseDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
public async Task<IActionResult> UpdatePause([FromBody] PauseDTO pause)
|
||||
{
|
||||
try
|
||||
{
|
||||
var obj = await _pauseService.UpdatePause(pause);
|
||||
return Ok(obj);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
public async Task<List<PauseDTO>> GetAllPauses()
|
||||
{
|
||||
return await _pauseService.GetAllPauses();
|
||||
}
|
||||
|
||||
[HttpGet("{pauseId}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(PauseDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetPauseById(int pauseId)
|
||||
{
|
||||
var pause = await _pauseService.GetPause(pauseId);
|
||||
if (pause == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Ok(pause);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
63
HanyadikHetVan/Controllers/V2/PurseController.cs
Normal file
63
HanyadikHetVan/Controllers/V2/PurseController.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using HanyadikHetVan.DTO;
|
||||
using HanyadikHetVan.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Mime;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HanyadikHetVan.Controllers.V2
|
||||
{
|
||||
[ApiVersion("2.0")]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
[ApiController]
|
||||
public class PurseController : Controller
|
||||
{
|
||||
private readonly PurseService _purseService;
|
||||
|
||||
public PurseController(PurseService purseService)
|
||||
{
|
||||
_purseService = purseService ?? throw new ArgumentNullException(nameof(purseService));
|
||||
}
|
||||
|
||||
[HttpPut("{userId}")]
|
||||
[Authorize]
|
||||
[Consumes(MediaTypeNames.Application.Json)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(PurseDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
public async Task<IActionResult> SetBalanceOfUser(string userId, [FromBody] PurseDTO pause)
|
||||
{
|
||||
try
|
||||
{
|
||||
var obj = await _purseService.SetBalanceOfUser(userId, pause.Balance);
|
||||
return Ok(obj);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("{userId}")]
|
||||
[Authorize]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(PurseDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
public async Task<IActionResult> GetPauseById(string userId)
|
||||
{
|
||||
var purse = await _purseService.GetBalanceOfUser(userId);
|
||||
if (purse == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Ok(purse);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
129
HanyadikHetVan/Controllers/V2/WeeklyTimeSpanController.cs
Normal file
129
HanyadikHetVan/Controllers/V2/WeeklyTimeSpanController.cs
Normal file
@ -0,0 +1,129 @@
|
||||
using HanyadikHetVan.DTO;
|
||||
using HanyadikHetVan.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Mime;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HanyadikHetVan.Controllers.V2
|
||||
{
|
||||
[ApiVersion("2.0")]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
[ApiController]
|
||||
public class WeeklyTimeSpanController: Controller
|
||||
{
|
||||
private readonly WeeklyTimeSpanService _weeklytimespanService;
|
||||
|
||||
public WeeklyTimeSpanController(WeeklyTimeSpanService weeklytimespanService)
|
||||
{
|
||||
_weeklytimespanService = weeklytimespanService;
|
||||
}
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
[Consumes(MediaTypeNames.Application.Json)]
|
||||
[ProducesResponseType(StatusCodes.Status201Created, Type = typeof(WeeklyTimeSpanDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
public async Task<IActionResult> AddWeeklyTimeSpan([FromBody] WeeklyTimeSpanDTO weeklytimespan)
|
||||
{
|
||||
try
|
||||
{
|
||||
var obj = await _weeklytimespanService.AddWeeklyTimeSpan(weeklytimespan);
|
||||
return CreatedAtAction(nameof(GetWeeklyTimeSpanById), new { weeklytimespanId = obj.Id }, obj);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return BadRequest();
|
||||
}
|
||||
}
|
||||
[HttpDelete("{weeklyTimeSpanId}")]
|
||||
[Authorize]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
public async Task<IActionResult> DeleteWeeklyTimeSpan(int weeklyTimeSpanId)
|
||||
{
|
||||
var result = await _weeklytimespanService.DeleteWeeklyTimeSpan(weeklyTimeSpanId);
|
||||
if (result)
|
||||
{
|
||||
return Ok(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
[HttpPut]
|
||||
[Authorize]
|
||||
[Consumes(MediaTypeNames.Application.Json)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(WeeklyTimeSpanDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
public async Task<IActionResult> UpdateWeeklyTimeSpan([FromBody] WeeklyTimeSpanDTO weeklytimespan)
|
||||
{
|
||||
try
|
||||
{
|
||||
var wts = await _weeklytimespanService.UpdateWeeklyTimeSpan(weeklytimespan);
|
||||
return Ok(wts);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
[HttpGet("date/{startTime}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(WeeklyTimeSpanDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetAllWeeklyTimeSpanByStartdate(DateTime startTime)
|
||||
{
|
||||
var wts = await _weeklytimespanService.GetWeeklyTimeSpanByStartdate(startTime);
|
||||
if (wts == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Ok(wts);
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
public async Task<List<WeeklyTimeSpanDTO>> GetAllWeeklyTimespans()
|
||||
{
|
||||
return await _weeklytimespanService.GetAllWeeklyTimeSpans();
|
||||
}
|
||||
[HttpGet("{weeklytimespanId}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(WeeklyTimeSpanDTO))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetWeeklyTimeSpanById(int weeklytimespanId)
|
||||
{
|
||||
var wts = await _weeklytimespanService.GetWeeklyTimeSpan(weeklytimespanId);
|
||||
if (wts == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Ok(wts);
|
||||
}
|
||||
}
|
||||
[HttpGet("pauses/{weeklytimespanId}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(List<PauseDTO>))]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetAllPausesOfTimeSpan(int weeklytimespanId)
|
||||
{
|
||||
var wts = await _weeklytimespanService.GetPausesOfWeeklyTimeSpan(weeklytimespanId);
|
||||
if (wts == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Ok(wts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
using HanyadikHetVan.Data.Entities;
|
||||
using HanyadikHetVan.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HanyadikHetVan.Controllers
|
||||
{
|
||||
[Route("api/weeklytimespans")]
|
||||
[ApiController]
|
||||
public class WeeklyTimeSpanController
|
||||
{
|
||||
private readonly WeeklyTimeSpanService _weeklytimespanService;
|
||||
|
||||
public WeeklyTimeSpanController(WeeklyTimeSpanService weeklytimespanService)
|
||||
{
|
||||
_weeklytimespanService = weeklytimespanService;
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<Object> AddWeeklyTimeSpan([FromBody] WeeklyTimeSpan weeklytimespan)
|
||||
{
|
||||
try
|
||||
{
|
||||
var obj = await _weeklytimespanService.AddWeeklyTimeSpan(weeklytimespan);
|
||||
return obj;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
[HttpDelete("{weeklyTimeSpanId}")]
|
||||
public bool DeleteWeeklyTimeSpan(int weeklyTimeSpanId)
|
||||
{
|
||||
return _weeklytimespanService.DeleteWeeklyTimeSpan(weeklyTimeSpanId);
|
||||
}
|
||||
[HttpPut]
|
||||
public bool UpdateWeeklyTimeSpan([FromBody] WeeklyTimeSpan weeklytimespan)
|
||||
{
|
||||
try
|
||||
{
|
||||
_weeklytimespanService.UpdateWeeklyTimeSpan(weeklytimespan);
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
[HttpGet("date/{startTime}")]
|
||||
public Object GetAllWeeklyTimeSpanByStartdate(DateTime startTime)
|
||||
{
|
||||
var data = _weeklytimespanService.GetWeeklyTimeSpanByStartdate(startTime);
|
||||
var json = JsonConvert.SerializeObject(data, Formatting.Indented,
|
||||
new JsonSerializerSettings()
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
|
||||
}
|
||||
);
|
||||
return json;
|
||||
}
|
||||
[HttpGet]
|
||||
public Object GetAllWeeklyTimespans()
|
||||
{
|
||||
var data = _weeklytimespanService.GetAllWeeklyTimeSpans();
|
||||
var json = JsonConvert.SerializeObject(data, Formatting.Indented,
|
||||
new JsonSerializerSettings()
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
|
||||
}
|
||||
);
|
||||
return json;
|
||||
}
|
||||
[HttpGet("{weeklytimespanId}")]
|
||||
public Object GetWeeklyTimeSpanById(int weeklytimespanId)
|
||||
{
|
||||
var data = _weeklytimespanService.GetWeeklyTimeSpan(weeklytimespanId);
|
||||
var json = JsonConvert.SerializeObject(data, Formatting.Indented,
|
||||
new JsonSerializerSettings()
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
|
||||
}
|
||||
);
|
||||
return json;
|
||||
}
|
||||
[HttpGet("pauses/{weeklytimespanId}")]
|
||||
public Object GetAllPausesOfTimeSpan(int weeklytimespanId)
|
||||
{
|
||||
var data = _weeklytimespanService.GetPausesOfWeeklyTimeSpan(weeklytimespanId);
|
||||
var json = JsonConvert.SerializeObject(data, Formatting.Indented,
|
||||
new JsonSerializerSettings()
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
|
||||
}
|
||||
);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user