-
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.
Merge pull request #19 from alyssaruth/ktor-3
Ktor 3
- Loading branch information
Showing
48 changed files
with
601 additions
and
1,531 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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package http | ||
|
||
import http.dto.DevCommandRequest | ||
import kong.unirest.HttpMethod | ||
|
||
class DevApi(private val httpClient: HttpClient) { | ||
fun doServerCommand(commandString: String) { | ||
httpClient.doCall<Unit>( | ||
HttpMethod.POST, | ||
Routes.DEV_COMMAND, | ||
DevCommandRequest(commandString) | ||
) | ||
} | ||
} |
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,10 +1,10 @@ | ||
package http | ||
|
||
import dto.HealthCheckResponse | ||
import http.dto.HealthCheckResponse | ||
import kong.unirest.HttpMethod | ||
|
||
class HealthCheckApi(private val httpClient: HttpClient) { | ||
fun doHealthCheck() { | ||
httpClient.doCall<HealthCheckResponse>(HttpMethod.GET, "/health-check") | ||
httpClient.doCall<HealthCheckResponse>(HttpMethod.GET, Routes.HEALTH_CHECK) | ||
} | ||
} |
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,10 +1,12 @@ | ||
package util | ||
|
||
import http.DevApi | ||
import http.HealthCheckApi | ||
import http.HttpClient | ||
|
||
object Globals { | ||
private val httpClient = HttpClient() | ||
val baseUrl = "http://localhost:8080" | ||
var healthCheckApi = HealthCheckApi(httpClient) | ||
private val baseUrl = "http://localhost:8080" | ||
private val httpClient = HttpClient(baseUrl) | ||
val healthCheckApi = HealthCheckApi(httpClient) | ||
val devApi = DevApi(httpClient) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package http | ||
|
||
object Routes { | ||
const val HEALTH_CHECK = "/health-check" | ||
const val DEV_COMMAND = "/dev-command" | ||
} |
2 changes: 1 addition & 1 deletion
2
...rc/main/kotlin/dto/ClientErrorResponse.kt → ...in/kotlin/http/dto/ClientErrorResponse.kt
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 @@ | ||
package dto | ||
package http.dto | ||
|
||
data class ClientErrorResponse(val errorCode: String, val errorMessage: String) |
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,3 @@ | ||
package http.dto | ||
|
||
data class DevCommandRequest(val command: String) |
2 changes: 1 addition & 1 deletion
2
...rc/main/kotlin/dto/HealthCheckResponse.kt → ...in/kotlin/http/dto/HealthCheckResponse.kt
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 @@ | ||
package dto | ||
package http.dto | ||
|
||
data class HealthCheckResponse(val version: String) |
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,6 +1,6 @@ | ||
package object; | ||
|
||
import util.Debug; | ||
import auth.UserConnection; | ||
|
||
public class ServerThread extends Thread | ||
{ | ||
|
Oops, something went wrong.