-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
108 changed files
with
632 additions
and
214 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,63 @@ | ||
namespace ArenaService.Controllers; | ||
|
||
using ArenaService.Shared.Dtos; | ||
using ArenaService.Shared.Exceptions; | ||
using ArenaService.Shared.Repositories; | ||
using ArenaService.Shared.Services; | ||
using Libplanet.Crypto; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.EntityFrameworkCore; | ||
using Swashbuckle.AspNetCore.Annotations; | ||
|
||
[Route("manage-seasons")] | ||
[ApiController] | ||
public class SeasonManagingController : ControllerBase | ||
{ | ||
private readonly ISeasonRepository _seasonRepo; | ||
private readonly IRoundRepository _roundRepo; | ||
private readonly ISeasonPreparationService _seasonPreparationService; | ||
private readonly IRoundPreparationService _roundPreparationService; | ||
|
||
public SeasonManagingController( | ||
ISeasonRepository seasonRepo, | ||
IRoundRepository roundRepo, | ||
ISeasonPreparationService seasonPreparationService, | ||
IRoundPreparationService roundPreparationService | ||
) | ||
{ | ||
_seasonRepo = seasonRepo; | ||
_roundRepo = roundRepo; | ||
_seasonPreparationService = seasonPreparationService; | ||
_roundPreparationService = roundPreparationService; | ||
} | ||
|
||
[HttpPost("initialize-season")] | ||
[SwaggerResponse( | ||
StatusCodes.Status200OK, | ||
"SeasonAndRoundResponse", | ||
typeof(SeasonAndRoundResponse) | ||
)] | ||
[SwaggerResponse(StatusCodes.Status404NotFound, "Status404NotFound")] | ||
public async Task<ActionResult> InitializeSeason(int seasonId) | ||
{ | ||
var season = await _seasonRepo.GetSeasonAsync(seasonId, q => q.Include(s => s.Rounds)); | ||
|
||
await _seasonPreparationService.PrepareSeasonAsync( | ||
(season, season.Rounds.OrderBy(r => r.StartBlock).First()) | ||
); | ||
|
||
return Ok(); | ||
} | ||
|
||
[HttpPost("prepare-next-round")] | ||
[SwaggerResponse(StatusCodes.Status200OK, "Ok")] | ||
[SwaggerResponse(StatusCodes.Status404NotFound, "Status404NotFound")] | ||
public async Task<ActionResult> PrepareNextRound(int roundId) | ||
{ | ||
var round = await _roundRepo.GetRoundAsync(roundId, q => q.Include(r => r.Season)); | ||
|
||
await _roundPreparationService.PrepareNextRoundWithSnapshotAsync((round!.Season, round)); | ||
|
||
return Ok(); | ||
} | ||
} |
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
4 changes: 2 additions & 2 deletions
4
ArenaService.IntegrationTests/Repositories/ClanRankingRepo/CopyRoundDataCorrectly.cs
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
4 changes: 2 additions & 2 deletions
4
ArenaService.IntegrationTests/Repositories/ClanRankingRepo/InitRankingCorrectly.cs
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
4 changes: 2 additions & 2 deletions
4
ArenaService.IntegrationTests/Repositories/ClanRankingRepo/UpdateScoreCorrectly.cs
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
4 changes: 2 additions & 2 deletions
4
ArenaService.IntegrationTests/Repositories/RankingRepo/SelectBattleOpponentsTotal100Tests.cs
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
4 changes: 2 additions & 2 deletions
4
ArenaService.IntegrationTests/Repositories/RankingRepo/SelectBattleOpponentsTotal40Tests.cs
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
2 changes: 1 addition & 1 deletion
2
ArenaService.IntegrationTests/Services/RankingServiceTests/UpdateAllClanRankingCorrectly.cs
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
2 changes: 1 addition & 1 deletion
2
ArenaService/Constants/ArenaServiceConfig.cs → ...ce.Shared/Constants/ArenaServiceConfig.cs
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
2 changes: 1 addition & 1 deletion
2
...rvice/Constants/OpponentGroupConstants.cs → ...hared/Constants/OpponentGroupConstants.cs
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,4 +1,4 @@ | ||
namespace ArenaService.Constants; | ||
namespace ArenaService.Shared.Constants; | ||
|
||
using System.Collections.Generic; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
ArenaService/Constants/RankingStatus.cs → ...Service.Shared/Constants/RankingStatus.cs
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,4 +1,4 @@ | ||
namespace ArenaService.Constants; | ||
namespace ArenaService.Shared.Constants; | ||
|
||
public enum RankingStatus | ||
{ | ||
|
2 changes: 1 addition & 1 deletion
2
ArenaService/Dtos/ArenaInfoResponse.cs → ...aService.Shared/Dtos/ArenaInfoResponse.cs
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,4 +1,4 @@ | ||
namespace ArenaService.Dtos; | ||
namespace ArenaService.Shared.Dtos; | ||
|
||
public class ArenaInfoResponse | ||
{ | ||
|
4 changes: 2 additions & 2 deletions
4
...Service/Dtos/AvailableOpponentResponse.cs → ....Shared/Dtos/AvailableOpponentResponse.cs
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
4 changes: 2 additions & 2 deletions
4
ArenaService/Dtos/BattleLogResponse.cs → ...aService.Shared/Dtos/BattleLogResponse.cs
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
4 changes: 2 additions & 2 deletions
4
ArenaService/Dtos/BattleRequest.cs → ArenaService.Shared/Dtos/BattleRequest.cs
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
2 changes: 1 addition & 1 deletion
2
...ervice/Dtos/BattleTicketStatusResponse.cs → ...Shared/Dtos/BattleTicketStatusResponse.cs
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
2 changes: 1 addition & 1 deletion
2
ArenaService/Dtos/BattleTokenResponse.cs → ...ervice.Shared/Dtos/BattleTokenResponse.cs
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
4 changes: 2 additions & 2 deletions
4
ArenaService/Dtos/ClanLeaderboardResponse.cs → ...ce.Shared/Dtos/ClanLeaderboardResponse.cs
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
4 changes: 2 additions & 2 deletions
4
ArenaService/Dtos/ClanResponse.cs → ArenaService.Shared/Dtos/ClanResponse.cs
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
4 changes: 2 additions & 2 deletions
4
...ice/Dtos/ClassifyByBlockMedalsResponse.cs → ...red/Dtos/ClassifyByBlockMedalsResponse.cs
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
2 changes: 1 addition & 1 deletion
2
ArenaService/Dtos/MedalResponse.cs → ArenaService.Shared/Dtos/MedalResponse.cs
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,4 +1,4 @@ | ||
namespace ArenaService.Dtos; | ||
namespace ArenaService.Shared.Dtos; | ||
|
||
public class MedalResponse | ||
{ | ||
|
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
2 changes: 1 addition & 1 deletion
2
...rvice/Dtos/RefreshTicketStatusResponse.cs → ...hared/Dtos/RefreshTicketStatusResponse.cs
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
2 changes: 1 addition & 1 deletion
2
ArenaService/Dtos/RoundResponse.cs → ArenaService.Shared/Dtos/RoundResponse.cs
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,4 +1,4 @@ | ||
namespace ArenaService.Dtos; | ||
namespace ArenaService.Shared.Dtos; | ||
|
||
public class RoundResponse | ||
{ | ||
|
4 changes: 2 additions & 2 deletions
4
ArenaService/Dtos/SeasonAndRoundResponse.cs → ...ice.Shared/Dtos/SeasonAndRoundResponse.cs
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
4 changes: 2 additions & 2 deletions
4
ArenaService/Dtos/SeasonResponse.cs → ArenaService.Shared/Dtos/SeasonResponse.cs
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
2 changes: 1 addition & 1 deletion
2
ArenaService/Dtos/SeasonsResponse.cs → ArenaService.Shared/Dtos/SeasonsResponse.cs
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
2 changes: 1 addition & 1 deletion
2
ArenaService/Dtos/TicketPolicyResponse.cs → ...rvice.Shared/Dtos/TicketPolicyResponse.cs
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,4 +1,4 @@ | ||
namespace ArenaService.Dtos; | ||
namespace ArenaService.Shared.Dtos; | ||
|
||
public class TicketPolicyResponse | ||
{ | ||
|
2 changes: 1 addition & 1 deletion
2
...Service/Dtos/TicketPurchaseLogResponse.cs → ....Shared/Dtos/TicketPurchaseLogResponse.cs
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
2 changes: 1 addition & 1 deletion
2
ArenaService/Dtos/TicketStatusResponse.cs → ...rvice.Shared/Dtos/TicketStatusResponse.cs
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
2 changes: 1 addition & 1 deletion
2
ArenaService/Dtos/UserRegisterRequest.cs → ...ervice.Shared/Dtos/UserRegisterRequest.cs
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
2 changes: 1 addition & 1 deletion
2
ArenaService/Dtos/UserResponse.cs → ArenaService.Shared/Dtos/UserResponse.cs
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
2 changes: 1 addition & 1 deletion
2
...e/Exceptions/CacheUnavailableException.cs → ...d/Exceptions/CacheUnavailableException.cs
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
2 changes: 1 addition & 1 deletion
2
...rvice/Exceptions/CalcAOFailedException.cs → ...hared/Exceptions/CalcAOFailedException.cs
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
2 changes: 1 addition & 1 deletion
2
...ice/Exceptions/NotEnoughMedalException.cs → ...red/Exceptions/NotEnoughMedalException.cs
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
2 changes: 1 addition & 1 deletion
2
...ice/Exceptions/NotFoundSeasonException.cs → ...red/Exceptions/NotFoundSeasonException.cs
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
2 changes: 1 addition & 1 deletion
2
...aService/Exceptions/NotRankedException.cs → ...e.Shared/Exceptions/NotRankedException.cs
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
Oops, something went wrong.