| | |
| | | object NCHttpService { |
| | | |
| | | data class Params( |
| | | val time: String |
| | | val time: String, |
| | | ) |
| | | |
| | | private val httpMethod = HttpMethod("114.94.28.171", 9006) |
| | | const val IP = "114.94.28.171" |
| | | const val PORT = 9006 |
| | | |
| | | private val httpMethod = HttpMethod(IP, PORT) |
| | | |
| | | fun getFile(time: String): JsonArray? { |
| | | val params = Params(time) |
| | | val data = Gson().toJson(params) |
| | | val response = httpMethod.post("/streetapp/nightwork/getInfo", data, |
| | | listOf(Pair("Authorization", "c2hpZXRpb246MjAyMDBhMjc5NjAx"))) |
| | | val response = httpMethod.post( |
| | | "/streetapp/nightwork/getInfo", data, |
| | | listOf(Pair("Authorization", "c2hpZXRpb246MjAyMDBhMjc5NjAx")) |
| | | ) |
| | | return if (response.success) { |
| | | val json = JsonParser.parseString(response.m.responseBodyAsString) |
| | | if (json.isJsonObject && json.asJsonObject["result"].asString == "1") { |