|
@@ -1,5 +1,40 @@
|
|
-import cn.qqck.kotlin.tools.Date
|
|
|
|
|
|
+import cn.qqck.kotlin.tools.Okhttp
|
|
|
|
+import cn.qqck.kotlin.tools.Phones
|
|
|
|
+import cn.qqck.kotlin.tools.json
|
|
|
|
+import cn.qqck.kotlin.tools.string
|
|
|
|
+import okhttp3.MediaType.Companion.toMediaType
|
|
|
|
+import okhttp3.RequestBody.Companion.toRequestBody
|
|
|
|
|
|
fun main() {
|
|
fun main() {
|
|
- println(Date.day())
|
|
|
|
|
|
+ println(Phones["15455478879"])
|
|
|
|
+ // println(register_queue.isNet())
|
|
|
|
+ // register_queue.get()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+private object register_queue {
|
|
|
|
+ private const val host = "http://127.0.0.1"
|
|
|
|
+ private const val port = 10002
|
|
|
|
+ private const val query = "?token=pJ1cX5gC9qU8iG3sW9gL5xG9jC5mV6rJ1uL7"
|
|
|
|
+
|
|
|
|
+ fun isNet(): Boolean {
|
|
|
|
+ return Okhttp.call("${this.host}:${this.port}") != null
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fun get(): String? {
|
|
|
|
+ val j_body = Okhttp.call("${this.host}:${this.port}/api/腾讯QQ/注册/任务列表/获取待处理${this.query}") ?: return null
|
|
|
|
+ if (j_body.body == null) return null
|
|
|
|
+ val j_json = j_body.body!!.string().json()
|
|
|
|
+ if (j_json.path("code")?.asInt() != 1) return null
|
|
|
|
+ val j_id = j_json.path("data.id")?.asString() ?: return null
|
|
|
|
+ val j_area = j_json.path("data.区号")?.asString() ?: return null
|
|
|
|
+ val j_phone = j_json.path("data.手机号")?.asString() ?: return null
|
|
|
|
+ println(j_area)
|
|
|
|
+ println(j_phone)
|
|
|
|
+
|
|
|
|
+ val j_url = "${this.host}:${this.port}/api/腾讯QQ/注册/任务列表/更新状态${this.query}"
|
|
|
|
+ val j_post = "id=${j_id}&状态=${10000}"
|
|
|
|
+ while (Okhttp.call(j_url) { it.post(j_post.toRequestBody("application/x-www-form-urlencoded".toMediaType())) } == null) Thread.sleep(1000)
|
|
|
|
+
|
|
|
|
+ return "aaa"
|
|
|
|
+ }
|
|
}
|
|
}
|