From 58a16c3340f92a1ec0362565020f31de56faaf3e Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 19 九月 2019 16:35:48 +0800
Subject: [PATCH] 1. 增加远程查看版本指令逻辑

---
 src/test/kotlin/com/flightfeather/obd/ObdApplicationTests.kt |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/src/test/kotlin/com/flightfeather/obd/ObdApplicationTests.kt b/src/test/kotlin/com/flightfeather/obd/ObdApplicationTests.kt
index e896af4..db1a9dc 100644
--- a/src/test/kotlin/com/flightfeather/obd/ObdApplicationTests.kt
+++ b/src/test/kotlin/com/flightfeather/obd/ObdApplicationTests.kt
@@ -1,7 +1,13 @@
 package com.flightfeather.obd
 
+import com.flightfeather.obd.domain.mapper.ObdDataMapper
+import com.flightfeather.obd.lightshare.bean.BaseJson
+import com.flightfeather.obd.lightshare.bean.ObdDataVo
+import com.google.gson.Gson
 import org.junit.Test
 import org.junit.runner.RunWith
+import org.slf4j.LoggerFactory
+import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.boot.test.context.SpringBootTest
 import org.springframework.test.context.junit4.SpringRunner
 
@@ -9,8 +15,35 @@
 @SpringBootTest
 class ObdApplicationTests {
 
+    @Autowired
+    lateinit var obdDataMapper: ObdDataMapper
+
     @Test
     fun contextLoads() {
     }
 
+    @Test
+    fun foo1(): Unit {
+//        val map = GsonJsonParser().parseMap("{\"vin\":\"vin001\",\"protocol\":2}")
+        val map = Gson().fromJson("{\"vin\":\"vin001\",\"protocol\":2,\"cmdCode\":2001}", ObdDataVo::class.java)
+        val res = obdDataMapper.selectAll()
+        res.forEach {
+            println(it.obdVin)
+            println(it.obdTime)
+        }
+        println(map.obdVin)
+        println(map.obdProtocol)
+        println(map.cmdCode)
+    }
+
+    @Test
+    fun logTest() {
+        val log = LoggerFactory.getLogger(javaClass)
+        log.trace("trace")
+        log.debug("debug")
+        log.warn("warn")
+        log.info("info")
+        log.error("error")
+    }
+
 }

--
Gitblit v1.9.3