mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-07 07:00:33 -04:00
Mock FreeSO API
- Until the real FreeSO API server is properly reconfigured, a mock API will take it's place using Mockoon. - Ported over a few elements from FSO.Common into the client.
This commit is contained in:
parent
49820cd42c
commit
a380de3a44
10 changed files with 1114 additions and 29 deletions
|
@ -25,17 +25,15 @@ namespace FSO.Server.Api.Core.Controllers.Admin
|
|||
if (order == null) order = "start_day";
|
||||
var api = Api.INSTANCE;
|
||||
api.DemandModerator(Request);
|
||||
using (var da = api.DAFactory.Get())
|
||||
using var da = api.DAFactory.Get();
|
||||
|
||||
if (limit > 100)
|
||||
{
|
||||
|
||||
if (limit > 100)
|
||||
{
|
||||
limit = 100;
|
||||
}
|
||||
|
||||
var result = da.Events.All((int)offset, (int)limit, order);
|
||||
return ApiResponse.PagedList<DbEvent>(Request, HttpStatusCode.OK, result);
|
||||
limit = 100;
|
||||
}
|
||||
|
||||
var result = da.Events.All((int)offset, (int)limit, order);
|
||||
return ApiResponse.PagedList<DbEvent>(Request, HttpStatusCode.OK, result);
|
||||
}
|
||||
|
||||
[HttpGet("presets")]
|
||||
|
@ -50,7 +48,7 @@ namespace FSO.Server.Api.Core.Controllers.Admin
|
|||
}
|
||||
|
||||
[HttpPost("presets")]
|
||||
public IActionResult CreatePreset([FromBody]PresetCreateModel request)
|
||||
public IActionResult CreatePreset([FromBody] PresetCreateModel request)
|
||||
{
|
||||
var api = Api.INSTANCE;
|
||||
api.DemandModerator(Request);
|
||||
|
@ -104,7 +102,7 @@ namespace FSO.Server.Api.Core.Controllers.Admin
|
|||
|
||||
// POST admin/updates (start update generation)
|
||||
[HttpPost]
|
||||
public IActionResult Post([FromBody]EventCreateModel request)
|
||||
public IActionResult Post([FromBody] EventCreateModel request)
|
||||
{
|
||||
var api = Api.INSTANCE;
|
||||
api.DemandModerator(Request);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue