fixing(gateway)
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ class PingService(private val baseUrl: String = "http://localhost:8080") {
|
||||
}
|
||||
|
||||
suspend fun ping(): Result<PingResponse> = try {
|
||||
val response = client.get("$baseUrl/ping-service/ping").body<PingResponse>()
|
||||
val response = client.get("$baseUrl/api/ping/ping").body<PingResponse>()
|
||||
Result.success(response)
|
||||
} catch (e: Exception) {
|
||||
Result.failure(e)
|
||||
|
||||
@@ -20,7 +20,7 @@ fun App(baseUrl: String = "http://localhost:8080") {
|
||||
|
||||
@Composable
|
||||
fun PingScreen(baseUrl: String) {
|
||||
val pingComponent = remember { PingTestComponent() }
|
||||
val pingComponent = remember { PingTestComponent(baseUrl) }
|
||||
var pingState by remember { mutableStateOf(pingComponent.state) }
|
||||
|
||||
LaunchedEffect(pingComponent) {
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ data class PingTestState(
|
||||
val isConnected: Boolean = false
|
||||
)
|
||||
|
||||
class PingTestComponent {
|
||||
private val pingService = PingService()
|
||||
class PingTestComponent(baseUrl: String = "http://localhost:8080") {
|
||||
private val pingService = PingService(baseUrl)
|
||||
private val scope = CoroutineScope(Dispatchers.Main + SupervisorJob())
|
||||
|
||||
var state: PingTestState = PingTestState()
|
||||
|
||||
Reference in New Issue
Block a user