From 585fb9b67dc81f9e14f2cbf59f1c3a02eb4fe98f Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 11 六月 2020 10:58:23 +0800 Subject: [PATCH] 1.添加无人机多参数的数据接收解析函数 2.添加参数存储函数 --- src/test/kotlin/com/flightfeather/uav/UAVApplicationTests.kt | 17 +---------------- 1 files changed, 1 insertions(+), 16 deletions(-) diff --git a/src/test/kotlin/com/flightfeather/uav/UAVApplicationTests.kt b/src/test/kotlin/com/flightfeather/uav/UAVApplicationTests.kt index 0f0e75f..d1be554 100644 --- a/src/test/kotlin/com/flightfeather/uav/UAVApplicationTests.kt +++ b/src/test/kotlin/com/flightfeather/uav/UAVApplicationTests.kt @@ -1,12 +1,8 @@ package com.flightfeather.uav -import com.flightfeather.uav.domain.mapper.ObdDataMapper -import com.flightfeather.uav.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 @@ -14,8 +10,6 @@ @SpringBootTest class UAVApplicationTests { - @Autowired - lateinit var obdDataMapper: ObdDataMapper @Test fun contextLoads() { @@ -23,16 +17,7 @@ @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 -- Gitblit v1.9.3