forked from delta/codecharacter-server-2022
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add getLeaderBoardbyTier and leaderboard update events #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1958e4e
fix: resolved conflicts
Valliammai-SM c60f499
update to recaptcha v3
Valliammai-SM d6fd545
fix: formatting
Valliammai-SM c6d043c
fix: updateLeaderboard and pagination requests
Valliammai-SM 635f9f2
fix: changed function names and updated SchedulingService
Valliammai-SM 4d4c273
feat: add timezone and reset ratings
Valliammai-SM eb01c33
feat: tier matches
Valliammai-SM e5b0e1e
fix: test errors
Valliammai-SM 4659c54
feat: promote/demote user tiers
Valliammai-SM ffaee43
feat: leaderboard test
Valliammai-SM 628ef43
feat: tests for update and promote tier functions
Valliammai-SM bc95fde
resolved conflicts
Valliammai-SM 0c6f67f
fix: formatting
Valliammai-SM 1cfb260
fix: test errors
Valliammai-SM 62e7792
fix: leaderboard tests
Valliammai-SM 3ca853d
leaderboardController tests
Valliammai-SM e7a7b17
feat: add logger for scheduling and refactor tests and schedulers
Ram-20062003 ccc3c26
fix: remove leaderBoardEnum
Ram-20062003 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 0 additions & 9 deletions
9
server/src/main/kotlin/delta/codecharacter/server/leaderboard/LeaderBoardEnum.kt
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
20 changes: 19 additions & 1 deletion
20
server/src/main/kotlin/delta/codecharacter/server/schedulers/SchedulingService.kt
This file contains hidden or 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,7 +1,25 @@ | ||
| package delta.codecharacter.server.schedulers | ||
|
|
||
| import delta.codecharacter.server.user.public_user.PublicUserService | ||
| import org.slf4j.Logger | ||
| import org.slf4j.LoggerFactory | ||
| import org.springframework.beans.factory.annotation.Autowired | ||
| import org.springframework.scheduling.annotation.Scheduled | ||
| import org.springframework.stereotype.Service | ||
|
|
||
| @Service class SchedulingService(@Autowired private val publicUserService: PublicUserService) | ||
| @Service | ||
| class SchedulingService(@Autowired private val publicUserService: PublicUserService) { | ||
| private val logger: Logger = LoggerFactory.getLogger(SchedulingService::class.java) | ||
|
|
||
| @Scheduled(cron = "\${environment.registration-time}", zone = "GMT") | ||
| fun updateTempLeaderboard() { | ||
| logger.info("Practice phase ended!!") | ||
| publicUserService.resetRatingsAfterPracticePhase() | ||
| publicUserService.updateLeaderboardAfterPracticePhase() | ||
| } | ||
| @Scheduled(cron = "\${environment.update-time}", zone = "GMT") | ||
| fun promoteAndDemoteUserTiers() { | ||
| logger.info("LeaderBoard Tier Promotion and Demotion started") | ||
| publicUserService.promoteTiers() | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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: 4 additions & 0 deletions
4
server/src/main/kotlin/delta/codecharacter/server/user/public_user/PublicUserRepository.kt
This file contains hidden or 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,9 +1,13 @@ | ||
| package delta.codecharacter.server.user.public_user | ||
|
|
||
| import delta.codecharacter.dtos.TierTypeDto | ||
| import org.springframework.data.domain.PageRequest | ||
| import org.springframework.data.mongodb.repository.MongoRepository | ||
| import java.util.Optional | ||
| import java.util.UUID | ||
|
|
||
| interface PublicUserRepository : MongoRepository<PublicUserEntity, UUID> { | ||
| fun findByUsername(username: String): Optional<PublicUserEntity> | ||
|
|
||
| fun findAllByTier(tier: TierTypeDto?, pageRequest: PageRequest): List<PublicUserEntity> | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
Submodule player_code
updated
6 files
| +6 −6 | cpp/main.cpp | |
| +2 −2 | cpp/player_code.cpp | |
| +2 −1 | cpp/player_code.h | |
| +3 −1 | java/Attributes.java | |
| +2 −2 | java/Main.java | |
| +5 −4 | python/player_code.py |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.