diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-24 20:34:00 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-24 20:34:00 +0200 |
commit | 6ceaed6126d43e2f2beed04331c50effa0b32afa (patch) | |
tree | 20aafd76feb9fb9deb029ce840163f53a8d69eed /sw-server/src/main/kotlin | |
parent | Make heroku use JRE 11 (diff) | |
download | seven-wonders-6ceaed6126d43e2f2beed04331c50effa0b32afa.tar.gz seven-wonders-6ceaed6126d43e2f2beed04331c50effa0b32afa.tar.bz2 seven-wonders-6ceaed6126d43e2f2beed04331c50effa0b32afa.zip |
Simplify injection and fix tests
Diffstat (limited to 'sw-server/src/main/kotlin')
-rw-r--r-- | sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt index e4536df7..5005d6c9 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt @@ -20,22 +20,20 @@ import org.springframework.validation.annotation.Validated import java.security.Principal import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch -import org.springframework.core.env.Environment +import org.springframework.beans.factory.annotation.Value /** * Handles actions in the game's lobby. The lobby is the place where players gather before a game. */ @Api(name = "Lobby") @Controller -class LobbyController @Autowired constructor( +class LobbyController( private val lobbyRepository: LobbyRepository, private val playerRepository: PlayerRepository, private val template: SimpMessagingTemplate, - private val environment: Environment -) { + @Value("\${server.port}") private val serverPort: String - get() = environment.getProperty("server.port") - +) { private val Principal.player: Player get() = playerRepository.find(name) |