Skip to content

Commit 36bd827

Browse files
author
seal
committed
update data property
add statistics data property
1 parent 467325e commit 36bd827

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

src/wu/seal/jsontokotlin/JsonToKotlinApplication.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import wu.seal.jsontokotlin.statistics.sendHistoryActionInfo
1010
*
1111
* Created by Seal.wu on 2017/8/21.
1212
*/
13+
14+
const val PLUGIN_VERSION = "1.3"
15+
1316
class JsonToKotlinApplication : ApplicationComponent {
1417

1518
override fun initComponent() {
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
package wu.seal.jsontokotlin.statistics
22

3+
import wu.seal.jsontokotlin.PLUGIN_VERSION
4+
import java.text.SimpleDateFormat
35
import java.util.*
46

57
/**
68
*
79
* Created by Seal.Wu on 2017/9/25.
810
*/
911

10-
1112
const val ACTION_START = "action_start"
1213
const val ACTION_SUCCESS_COMPLETE = "action_sucess_complete"
1314

1415
data class StartAction(
1516
val uuid: String = UUID,
17+
val pluginVersion: String = PLUGIN_VERSION,
1618
val actionType: String = ACTION_START,
17-
val time: String = Date().time.toString()
18-
19+
val time: String = Date().time.toString(),
20+
val daytime: String = SimpleDateFormat("yyyy-MM-dd", Locale.CHINA).format(Date())
1921
)
2022

2123
data class SuccessCompleteAction(
2224
val uuid: String = UUID,
25+
val pluginVersion: String = PLUGIN_VERSION,
2326
val actionType: String = ACTION_SUCCESS_COMPLETE,
24-
val time: String = Date().time.toString()
27+
val time: String = Date().time.toString(),
28+
val daytime: String = SimpleDateFormat("yyyy-MM-dd", Locale.CHINA).format(Date())
2529
)

src/wu/seal/jsontokotlin/statistics/ExceptionHandler.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package wu.seal.jsontokotlin.statistics
22

3+
import wu.seal.jsontokotlin.PLUGIN_VERSION
34
import java.io.PrintWriter
45
import java.io.StringWriter
56
import java.text.SimpleDateFormat
@@ -16,7 +17,7 @@ import java.util.*
1617
*/
1718
fun handlerException(jsonString: String, callBack: () -> Unit): Thread.UncaughtExceptionHandler = Thread.UncaughtExceptionHandler { t, e ->
1819
val logBuilder = StringBuilder()
19-
logBuilder.append("PluginVersion:1.3\n")
20+
logBuilder.append("PluginVersion:$PLUGIN_VERSION\n")
2021
logBuilder.append("user: $UUID").append("\n")
2122
val time = SimpleDateFormat("yyyy-MM-dd HH:mm:ss E", Locale.CHINA).format(Date())
2223
logBuilder.append("createTime: $time").append("\n")

src/wu/seal/jsontokotlin/statistics/NetWork.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import java.net.URL
88
* Created by Seal.Wu on 2017/9/25.
99
*/
1010

11-
const val actionInfoUrl = "http://localhost:8080/sendActionInfo"
12-
const val exceptionLogUrl = "http://localhost:8080/sendExceptionInfo"
11+
const val actionInfoUrl = "http://jsontokotlin.sealwu.com:8008/sendActionInfo"
12+
const val exceptionLogUrl = "http://jsontokotlin.sealwu.com:8008/sendExceptionInfo"
1313

1414
fun sendExceptionLog(log: String) {
1515
try {
@@ -73,7 +73,7 @@ fun sendHistoryActionInfo() {
7373

7474

7575
fun main(args: Array<String>) {
76-
val demeoActionInfo ="""{"id":12,"uuid":"fdsafds","actionType":"start","time":"1234231434124324"}"""
76+
val demeoActionInfo =""" {"id":0,"uuid":"214fdsafsafafsdf","pluginVersion":"1.2.1","actionType":"start","time":"1234231434124324","daytime":"2017-09-27"}"""
7777

7878
sendExceptionLog("hello,I am exception")
7979
sendActionInfo(demeoActionInfo)

0 commit comments

Comments
 (0)