-
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.
fix: Base64 encode docker port response
- Loading branch information
1 parent
6359ad9
commit f9e45fc
Showing
9 changed files
with
59 additions
and
11 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
4 changes: 1 addition & 3 deletions
4
ApiWrapper/src/main/kotlin/org/readutf/orchestrator/wrapper/services/DockerService.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,13 +1,11 @@ | ||
package org.readutf.orchestrator.wrapper.services | ||
|
||
import org.readutf.orchestrator.shared.utils.ApiResponse | ||
import org.readutf.orchestrator.wrapper.types.ContainerPort | ||
import retrofit2.http.GET | ||
import retrofit2.http.Query | ||
|
||
interface DockerService { | ||
@GET("/docker/port") | ||
suspend fun getPort( | ||
@Query("shortId") shortId: String, | ||
): ApiResponse<List<ContainerPort>> | ||
): 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
20 changes: 20 additions & 0 deletions
20
Server/src/main/kotlin/org/readutf/orchestrator/server/Test.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.readutf.orchestrator.server | ||
|
||
import com.alibaba.fastjson2.JSON | ||
import com.alibaba.fastjson2.TypeReference | ||
import org.readutf.orchestrator.shared.utils.ApiResponse | ||
|
||
fun main() { | ||
Test() | ||
} | ||
|
||
class Test { | ||
init { | ||
val json = | ||
"{\"response\":[{\"IP\":\"0.0.0.0\",\"PrivatePort\":2980,\"PublicPort\":2980,\"Type\":\"tcp\"},{\"IP\":\"::\",\"PrivatePort\":2980,\"PublicPort\":2980,\"Type\":\"tcp\"},{\"IP\":\"0.0.0.0\",\"PrivatePort\":9393,\"PublicPort\":9393,\"Type\":\"tcp\"},{\"IP\":\"::\",\"PrivatePort\":9393,\"PublicPort\":9393,\"Type\":\"tcp\"}],\"success\":true}" | ||
|
||
val test = JSON.parseObject(json, object : TypeReference<ApiResponse<List<Map<String, String>>>>() {}) | ||
|
||
println(test) | ||
} | ||
} |
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