sql执行java时间字段适配
This commit is contained in:
@@ -151,6 +151,11 @@
|
||||
<artifactId>json-path</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fatboyindustrial.gson-javatime-serialisers</groupId>
|
||||
<artifactId>gson-javatime-serialisers</artifactId>
|
||||
<version>1.1.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -87,6 +87,7 @@ public class TestCaseController extends BaseController {
|
||||
@PostMapping("/run")
|
||||
public AjaxResult run(@RequestBody IDQO qo) {
|
||||
log.info("执行用例 id:{}, jmeterHomePath:{}", qo.getId(), jmeterHomePath);
|
||||
return toAjax(testCaseService.executeTestCaseById(qo.getId(), jmeterHomePath));
|
||||
testCaseService.executeTestCaseById(qo.getId(), jmeterHomePath);
|
||||
return toAjax(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.test.test.service.impl;
|
||||
|
||||
import com.fatboyindustrial.gsonjavatime.LocalDateTimeConverter;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.test.common.utils.DateUtils;
|
||||
import com.test.common.utils.JMeterUtil;
|
||||
@@ -24,6 +26,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -257,7 +260,9 @@ public class TestCaseServiceImpl implements ITestCaseService
|
||||
SqlResult sqlResult = new SqlResult();
|
||||
sqlResult.setColumnNameList(columnNameList);
|
||||
sqlResult.setResultMapList(resultMapList);
|
||||
Gson gson = new Gson();
|
||||
Gson gson = new GsonBuilder()
|
||||
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeConverter())
|
||||
.create();
|
||||
testCaseResult.setSqlResult(gson.toJson(sqlResult));
|
||||
// 处理参数提取
|
||||
Map<String, String> assignmentResultMap = new HashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user