-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More forced-synchronization methods
- Loading branch information
Showing
6 changed files
with
112 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using CentaurScores.Model; | ||
using CentaurScores.Services; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace CentaurScores.Controllers | ||
{ | ||
[ApiController] | ||
[Route("/devices")] | ||
public class DeviceController | ||
{ | ||
private readonly IMatchRepository matchRepository; | ||
|
||
public DeviceController(IMatchRepository matchRepository) | ||
{ | ||
this.matchRepository = matchRepository; | ||
} | ||
|
||
/// <summary> | ||
/// Returns all pre-defined participants lists for this organization. | ||
/// </summary> | ||
/// <returns></returns> | ||
[HttpGet("{deviceId}/sync")] | ||
[ProducesResponseType(StatusCodes.Status200OK)] | ||
[ProducesResponseType(StatusCodes.Status400BadRequest)] | ||
public async Task<ActionResult<bool>> GetDeviceNeedsSync([FromRoute] string deviceId) | ||
{ | ||
return await matchRepository.CheckDeviceSynchronization(deviceId); | ||
} | ||
|
||
/// <summary> | ||
/// Returns all pre-defined participants lists for this organization. | ||
/// </summary> | ||
/// <returns></returns> | ||
[HttpDelete("{deviceId}/sync")] | ||
[ProducesResponseType(StatusCodes.Status200OK)] | ||
[ProducesResponseType(StatusCodes.Status400BadRequest)] | ||
public async Task<ActionResult<bool>> DeleteDeviceNeedsSync([FromRoute] string deviceId) | ||
{ | ||
await matchRepository.ClearDeviceSynchronization(deviceId); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"version": "1.0.11" | ||
"version": "1.0.12" | ||
} |