fix(flow): restore workflow task converted pages
This commit is contained in:
@@ -1,10 +1,23 @@
|
||||
package com.eip4.platform.flowgateway.web;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -45,15 +58,22 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@RestController
|
||||
public class TodoController {
|
||||
|
||||
private static final int DEFAULT_AMIS_PER_PAGE = 10;
|
||||
private static final int LEGACY_TASK_FETCH_LIMIT = 1_000;
|
||||
private static final DateTimeFormatter LEGACY_DATE_TIME =
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
private final TodoAggregator todoAggregator;
|
||||
private final FlowableClient flowableClient;
|
||||
private final StatusWriteback statusWriteback;
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
|
||||
public TodoController(TodoAggregator todoAggregator, FlowableClient flowableClient,
|
||||
StatusWriteback statusWriteback) {
|
||||
StatusWriteback statusWriteback, JdbcTemplate jdbcTemplate) {
|
||||
this.todoAggregator = todoAggregator;
|
||||
this.flowableClient = flowableClient;
|
||||
this.statusWriteback = statusWriteback;
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
|
||||
@Operation(summary = "当前用户待办(含候选组待办)",
|
||||
@@ -76,6 +96,42 @@ public class TodoController {
|
||||
return todoAggregator.done(userId, firstResult, maxResults);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换页「流程管理/待办任务」兼容端点。
|
||||
*
|
||||
* <p>老模板列绑定的是 {@code VIEW_ACT_RU_TASK_*} 视图字段,但当前有效待办数据源是
|
||||
* {@link TodoAggregator}。这里保持老列名与查询字段不变,底层改走 Flowable 聚合,供 amis CRUD 直接消费。
|
||||
*/
|
||||
@Operation(summary = "转换页待办任务数据(amis)", description = "返回老 VIEW_ACT_RU_TASK 字段形态,底层走 /api/todo 聚合口径")
|
||||
@GetMapping("/api/workflow/tasks/todo-amis")
|
||||
public Map<String, Object> todoAmis(@AuthenticationPrincipal AuthPrincipal principal,
|
||||
@RequestParam Map<String, String> params) {
|
||||
String userId = principal == null ? null : principal.userId();
|
||||
List<String> candidateGroups = principal == null ? List.of() : principal.roles();
|
||||
List<TodoItem> raw = todoAggregator.todo(userId, candidateGroups, 0, LEGACY_TASK_FETCH_LIMIT);
|
||||
List<Map<String, Object>> rows = raw.stream()
|
||||
.map(item -> legacyTaskRow(item, false))
|
||||
.filter(row -> matchesLegacyFilters(row, params, false))
|
||||
.toList();
|
||||
resolveInitiatorDisplayNames(rows);
|
||||
return amisCrud(rows, params);
|
||||
}
|
||||
|
||||
/** 转换页「流程管理/已办任务」兼容端点;列名对齐 VIEW_ACT_TASK_COMPLETE_SEARCH/VIEW_ACT_FTASK_COMPLETE_SEARCH。 */
|
||||
@Operation(summary = "转换页已办任务数据(amis)", description = "返回老 VIEW_ACT_TASK 字段形态,底层走 /api/done 聚合口径")
|
||||
@GetMapping("/api/workflow/tasks/done-amis")
|
||||
public Map<String, Object> doneAmis(@AuthenticationPrincipal AuthPrincipal principal,
|
||||
@RequestParam Map<String, String> params) {
|
||||
String userId = principal == null ? null : principal.userId();
|
||||
List<TodoItem> raw = todoAggregator.done(userId, 0, LEGACY_TASK_FETCH_LIMIT);
|
||||
List<Map<String, Object>> rows = raw.stream()
|
||||
.map(item -> legacyTaskRow(item, true))
|
||||
.filter(row -> matchesLegacyFilters(row, params, true))
|
||||
.toList();
|
||||
resolveInitiatorDisplayNames(rows);
|
||||
return amisCrud(rows, params);
|
||||
}
|
||||
|
||||
@Operation(summary = "办理任务 + 回写业务状态",
|
||||
description = "complete 后,若请求带 businessKey/processInstanceId,按老系统 ProcessCoreServiceImpl 语义回写 SYS_DATASTATUS(结束→3 通过,未结束→2 处理中,守卫单调递增)。挂起任务被引擎拒为 409(透传)")
|
||||
@PostMapping("/api/task/{id}/complete")
|
||||
@@ -143,6 +199,258 @@ public class TodoController {
|
||||
return pi == null || pi.ended;
|
||||
}
|
||||
|
||||
private static Map<String, Object> amisCrud(List<Map<String, Object>> rows, Map<String, String> params) {
|
||||
int page = parsePositive(params.get("page"), 1);
|
||||
int perPage = parsePositive(params.get("perPage"), DEFAULT_AMIS_PER_PAGE);
|
||||
int from = Math.min((page - 1) * perPage, rows.size());
|
||||
int to = Math.min(from + perPage, rows.size());
|
||||
Map<String, Object> data = new LinkedHashMap<>();
|
||||
data.put("items", rows.subList(from, to));
|
||||
data.put("total", rows.size());
|
||||
|
||||
Map<String, Object> resp = new LinkedHashMap<>();
|
||||
resp.put("status", 0);
|
||||
resp.put("msg", "");
|
||||
resp.put("data", data);
|
||||
return resp;
|
||||
}
|
||||
|
||||
private static Map<String, Object> legacyTaskRow(TodoItem item, boolean done) {
|
||||
Map<String, Object> row = new LinkedHashMap<>();
|
||||
String taskId = trim(item.taskId);
|
||||
if (done) {
|
||||
row.put("VIEW_ACT_TASK_ID", taskId);
|
||||
row.put("VIEW_ACT_FTASK_ID", taskId);
|
||||
} else {
|
||||
row.put("VIEW_ACT_RU_TASK_ID", taskId);
|
||||
}
|
||||
row.put("TASKID", taskId);
|
||||
row.put("TITLE", titleOf(item));
|
||||
row.put("PROCESSNAME", processName(item.processDefinitionId));
|
||||
row.put("TASKNAME", item.taskName);
|
||||
row.put("STARTTIME", formatMillis(item.createTimeMillis));
|
||||
row.put("ENDTIME", formatMillis(item.endTimeMillis));
|
||||
row.put("WFSTATUS", done ? 3 : 2);
|
||||
|
||||
String initUser = summaryString(item, "USER_ID", "USERID", "INITUSERID");
|
||||
row.put("INITUSERID", initUser);
|
||||
row.put("INITUSERID_DISPLAY__", initUser);
|
||||
String initOrg = summaryString(item, "USERORGID", "INITUSERORGID", "ORGID");
|
||||
row.put("INITUSERORGID", initOrg);
|
||||
row.put("INITUSERORGID_DISPLAY__", initOrg);
|
||||
|
||||
row.put("processInstanceId", item.processInstanceId);
|
||||
row.put("businessKey", item.businessKey);
|
||||
row.put("businessTable", item.businessTable);
|
||||
row.put("businessSummary", item.businessSummary == null ? Map.of() : item.businessSummary);
|
||||
row.put("pageTemplateId", item.pageTemplateId);
|
||||
row.put("pageUrl", item.pageUrl);
|
||||
row.put("pageUrlReason", item.pageUrlReason);
|
||||
return row;
|
||||
}
|
||||
|
||||
private void resolveInitiatorDisplayNames(List<Map<String, Object>> rows) {
|
||||
Set<String> userIds = new LinkedHashSet<>();
|
||||
for (Map<String, Object> row : rows) {
|
||||
String userId = trim(Objects.toString(row.get("INITUSERID"), ""));
|
||||
if (userId != null && !userId.isBlank()) {
|
||||
userIds.add(userId);
|
||||
}
|
||||
}
|
||||
if (userIds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, String> displayById = new HashMap<>();
|
||||
List<String> ids = new ArrayList<>(userIds);
|
||||
for (int from = 0; from < ids.size(); from += 200) {
|
||||
List<String> batch = ids.subList(from, Math.min(from + 200, ids.size()));
|
||||
String placeholders = String.join(",", Collections.nCopies(batch.size(), "?"));
|
||||
try {
|
||||
List<Map<String, Object>> matches = jdbcTemplate.queryForList(
|
||||
"SELECT TRIM(VIEW_SYS_USER_ID) AS USER_ID, DISPLAYNAME AS DISPLAY_NAME "
|
||||
+ "FROM VIEW_SYS_USER WHERE TRIM(VIEW_SYS_USER_ID) IN (" + placeholders + ")",
|
||||
batch.toArray());
|
||||
if (matches == null) {
|
||||
continue;
|
||||
}
|
||||
for (Map<String, Object> match : matches) {
|
||||
String userId = rowString(match, "USER_ID", "user_id", "ID", "id");
|
||||
String displayName = rowString(match, "DISPLAY_NAME", "display_name", "DISPLAYNAME", "displayname");
|
||||
if (userId != null && !userId.isBlank() && displayName != null && !displayName.isBlank()) {
|
||||
displayById.put(userId, displayName);
|
||||
}
|
||||
}
|
||||
} catch (DataAccessException ignored) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (Map<String, Object> row : rows) {
|
||||
String userId = trim(Objects.toString(row.get("INITUSERID"), ""));
|
||||
String displayName = displayById.get(userId);
|
||||
if (displayName != null && !displayName.isBlank()) {
|
||||
row.put("INITUSERID_DISPLAY__", displayName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean matchesLegacyFilters(Map<String, Object> row, Map<String, String> params, boolean done) {
|
||||
return contains(row, params, "TITLE")
|
||||
&& contains(row, params, "PROCESSNAME")
|
||||
&& contains(row, params, "TASKNAME")
|
||||
&& equalsIfPresent(row, params, "INITUSERID")
|
||||
&& equalsIfPresent(row, params, "INITUSERORGID")
|
||||
&& inDateRange(row.get("STARTTIME"), params.get("STARTTIME"))
|
||||
&& (!done || inDateRange(row.get("ENDTIME"), params.get("ENDTIME")))
|
||||
&& (!done || equalsIfPresent(row, params, "WFSTATUS"));
|
||||
}
|
||||
|
||||
private static boolean contains(Map<String, Object> row, Map<String, String> params, String key) {
|
||||
String needle = trim(params.get(key));
|
||||
if (needle == null || needle.isBlank()) {
|
||||
return true;
|
||||
}
|
||||
String value = trim(Objects.toString(row.get(key), ""));
|
||||
return value != null && value.toLowerCase().contains(needle.toLowerCase());
|
||||
}
|
||||
|
||||
private static boolean equalsIfPresent(Map<String, Object> row, Map<String, String> params, String key) {
|
||||
String expected = trim(params.get(key));
|
||||
if (expected == null || expected.isBlank()) {
|
||||
return true;
|
||||
}
|
||||
return expected.equals(trim(Objects.toString(row.get(key), "")));
|
||||
}
|
||||
|
||||
private static boolean inDateRange(Object raw, String range) {
|
||||
String value = trim(Objects.toString(raw, ""));
|
||||
String trimmedRange = trim(range);
|
||||
if (trimmedRange == null || trimmedRange.isBlank() || value == null || value.isBlank()) {
|
||||
return true;
|
||||
}
|
||||
if (trimmedRange.startsWith("[") && trimmedRange.endsWith("]")) {
|
||||
trimmedRange = trimmedRange.substring(1, trimmedRange.length() - 1);
|
||||
}
|
||||
LocalDateTime actual = parseDateTime(value);
|
||||
if (actual == null) {
|
||||
return true;
|
||||
}
|
||||
String[] parts = trimmedRange.split(",", -1);
|
||||
LocalDateTime start = parts.length > 0 ? parseDateTime(parts[0]) : null;
|
||||
LocalDateTime end = parts.length > 1 ? parseDateTime(parts[1]) : null;
|
||||
return (start == null || !actual.isBefore(start)) && (end == null || !actual.isAfter(end));
|
||||
}
|
||||
|
||||
private static LocalDateTime parseDateTime(String raw) {
|
||||
String s = trim(raw);
|
||||
if (s == null || s.isBlank()) {
|
||||
return null;
|
||||
}
|
||||
s = stripDateToken(s);
|
||||
if (s.matches("-?\\d+")) {
|
||||
try {
|
||||
long epoch = Long.parseLong(s);
|
||||
long millis = Math.abs(epoch) < 10_000_000_000L ? epoch * 1_000L : epoch;
|
||||
return LocalDateTime.ofInstant(Instant.ofEpochMilli(millis), ZoneId.systemDefault());
|
||||
} catch (NumberFormatException ignored) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
try {
|
||||
return LocalDateTime.parse(s.replace('T', ' ').replaceAll("Z$", ""), LEGACY_DATE_TIME);
|
||||
} catch (DateTimeParseException ignored) {
|
||||
try {
|
||||
return LocalDateTime.parse(s);
|
||||
} catch (DateTimeParseException ignoredAgain) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String stripDateToken(String raw) {
|
||||
String s = trim(raw);
|
||||
if (s == null || s.length() < 2) {
|
||||
return s;
|
||||
}
|
||||
if ((s.startsWith("\"") && s.endsWith("\"")) || (s.startsWith("'") && s.endsWith("'"))) {
|
||||
return trim(s.substring(1, s.length() - 1));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
private static String titleOf(TodoItem item) {
|
||||
if (item.businessSummary != null) {
|
||||
for (String key : List.of("TITLE", "NAME", "SUBJECT", "NO", "SERIALNO", "FORMNO")) {
|
||||
String value = summaryString(item, key);
|
||||
if (value != null && !value.isBlank()) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.businessKey != null && !item.businessKey.isBlank()) {
|
||||
return item.businessKey;
|
||||
}
|
||||
return item.taskName;
|
||||
}
|
||||
|
||||
private static String summaryString(TodoItem item, String... keys) {
|
||||
if (item.businessSummary == null || item.businessSummary.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
for (String key : keys) {
|
||||
Object value = item.businessSummary.get(key);
|
||||
if (value == null) {
|
||||
value = item.businessSummary.get(key.toLowerCase());
|
||||
}
|
||||
String s = trim(Objects.toString(value, ""));
|
||||
if (s != null && !s.isBlank()) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String rowString(Map<String, Object> row, String... keys) {
|
||||
for (String key : keys) {
|
||||
Object value = row.get(key);
|
||||
String s = trim(Objects.toString(value, ""));
|
||||
if (s != null && !s.isBlank()) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String processName(String processDefinitionId) {
|
||||
String s = trim(processDefinitionId);
|
||||
if (s == null || s.isBlank()) {
|
||||
return "";
|
||||
}
|
||||
int colon = s.indexOf(':');
|
||||
return colon > 0 ? s.substring(0, colon) : s;
|
||||
}
|
||||
|
||||
private static String formatMillis(Long millis) {
|
||||
if (millis == null) {
|
||||
return null;
|
||||
}
|
||||
return LEGACY_DATE_TIME.format(Instant.ofEpochMilli(millis).atZone(ZoneId.systemDefault()));
|
||||
}
|
||||
|
||||
private static int parsePositive(String raw, int fallback) {
|
||||
try {
|
||||
int value = Integer.parseInt(Objects.toString(raw, "").trim());
|
||||
return value > 0 ? value : fallback;
|
||||
} catch (NumberFormatException e) {
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
|
||||
private static String trim(String value) {
|
||||
return value == null ? null : value.strip();
|
||||
}
|
||||
|
||||
private static boolean notBlank(String s) {
|
||||
return s != null && !s.isBlank();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.eip4.platform.flowgateway;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
import com.eip4.platform.auth.security.AuthPrincipal;
|
||||
import com.eip4.platform.flowgateway.aggregate.TodoAggregator;
|
||||
import com.eip4.platform.flowgateway.aggregate.TodoItem;
|
||||
import com.eip4.platform.flowgateway.client.FlowableClient;
|
||||
import com.eip4.platform.flowgateway.web.TodoController;
|
||||
import com.eip4.platform.flowgateway.writeback.StatusWriteback;
|
||||
|
||||
/** 转换页流程待办/已办 amis 兼容数据端点单测。 */
|
||||
class TodoControllerAmisTest {
|
||||
|
||||
private final TodoAggregator aggregator = mock(TodoAggregator.class);
|
||||
private final JdbcTemplate jdbcTemplate = mock(JdbcTemplate.class);
|
||||
private final TodoController controller = new TodoController(
|
||||
aggregator, mock(FlowableClient.class), mock(StatusWriteback.class), jdbcTemplate);
|
||||
|
||||
private static AuthPrincipal principal() {
|
||||
return new AuthPrincipal("U1", "u1", "张三", "D1", "O1", List.of("R1"));
|
||||
}
|
||||
|
||||
private static TodoItem item(String taskId, String title) {
|
||||
return item(taskId, title, 1_700_000_000_000L);
|
||||
}
|
||||
|
||||
private static TodoItem item(String taskId, String title, long createTimeMillis) {
|
||||
TodoItem it = new TodoItem();
|
||||
it.taskId = taskId;
|
||||
it.taskName = "办公室主任";
|
||||
it.processInstanceId = "PI-" + taskId;
|
||||
it.processDefinitionId = "新闻审批:3:55882";
|
||||
it.businessKey = "BK-" + taskId;
|
||||
it.businessTable = "OA_NEWSMANAGE";
|
||||
it.businessSummary = Map.of("TITLE", title, "USER_ID", "U1");
|
||||
it.createTimeMillis = createTimeMillis;
|
||||
it.endTimeMillis = createTimeMillis + 100_000L;
|
||||
return it;
|
||||
}
|
||||
|
||||
private static long epochMillis(int year, int month, int day, int hour, int minute) {
|
||||
return LocalDateTime.of(year, month, day, hour, minute)
|
||||
.atZone(ZoneId.systemDefault())
|
||||
.toInstant()
|
||||
.toEpochMilli();
|
||||
}
|
||||
|
||||
private static long epochSeconds(int year, int month, int day, int hour, int minute) {
|
||||
return epochMillis(year, month, day, hour, minute) / 1_000L;
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void todoAmis_映射老待办列并支持主题过滤() {
|
||||
when(aggregator.todo("U1", List.of("R1"), 0, 1_000))
|
||||
.thenReturn(List.of(item("T1", "测试标题"), item("T2", "其他标题")));
|
||||
when(jdbcTemplate.queryForList(anyString(), any(Object[].class)))
|
||||
.thenReturn(List.of(Map.of("USER_ID", "U1", "DISPLAY_NAME", "张三")));
|
||||
|
||||
Map<String, Object> resp = controller.todoAmis(principal(),
|
||||
Map.of("TITLE", "测试", "page", "1", "perPage", "10"));
|
||||
|
||||
assertThat(resp).containsEntry("status", 0);
|
||||
Map<String, Object> data = (Map<String, Object>) resp.get("data");
|
||||
List<Map<String, Object>> items = (List<Map<String, Object>>) data.get("items");
|
||||
assertThat(data).containsEntry("total", 1);
|
||||
assertThat(items).hasSize(1);
|
||||
Map<String, Object> row = items.get(0);
|
||||
assertThat(row).containsEntry("VIEW_ACT_RU_TASK_ID", "T1");
|
||||
assertThat(row).containsEntry("TITLE", "测试标题");
|
||||
assertThat(row).containsEntry("PROCESSNAME", "新闻审批");
|
||||
assertThat(row).containsEntry("TASKNAME", "办公室主任");
|
||||
assertThat(row).containsEntry("INITUSERID", "U1");
|
||||
assertThat(row).containsEntry("INITUSERID_DISPLAY__", "张三");
|
||||
assertThat(row).containsEntry("processInstanceId", "PI-T1");
|
||||
assertThat(row).containsEntry("businessKey", "BK-T1");
|
||||
assertThat(row).containsEntry("businessTable", "OA_NEWSMANAGE");
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void doneAmis_映射已办双主键列并分页() {
|
||||
when(aggregator.done("U1", 0, 1_000))
|
||||
.thenReturn(List.of(item("D1", "已办一"), item("D2", "已办二")));
|
||||
|
||||
Map<String, Object> resp = controller.doneAmis(principal(),
|
||||
Map.of("page", "2", "perPage", "1"));
|
||||
|
||||
Map<String, Object> data = (Map<String, Object>) resp.get("data");
|
||||
List<Map<String, Object>> items = (List<Map<String, Object>>) data.get("items");
|
||||
assertThat(data).containsEntry("total", 2);
|
||||
assertThat(items).hasSize(1);
|
||||
Map<String, Object> row = items.get(0);
|
||||
assertThat(row).containsEntry("VIEW_ACT_TASK_ID", "D2");
|
||||
assertThat(row).containsEntry("VIEW_ACT_FTASK_ID", "D2");
|
||||
assertThat(row).containsEntry("WFSTATUS", 3);
|
||||
assertThat(row.get("ENDTIME")).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void todoAmis_支持amis秒级任务发起时间区间过滤() {
|
||||
when(aggregator.todo("U1", List.of("R1"), 0, 1_000))
|
||||
.thenReturn(List.of(
|
||||
item("T0", "区间前", epochMillis(2026, 6, 15, 17, 29)),
|
||||
item("T1", "区间内", epochMillis(2026, 6, 16, 9, 0))));
|
||||
|
||||
String start = String.valueOf(epochSeconds(2026, 6, 15, 20, 37));
|
||||
String end = String.valueOf(epochSeconds(2026, 6, 17, 20, 37));
|
||||
Map<String, Object> resp = controller.todoAmis(principal(),
|
||||
Map.of("STARTTIME", start + "," + end, "page", "1", "perPage", "10"));
|
||||
|
||||
Map<String, Object> data = (Map<String, Object>) resp.get("data");
|
||||
List<Map<String, Object>> items = (List<Map<String, Object>>) data.get("items");
|
||||
assertThat(data).containsEntry("total", 1);
|
||||
assertThat(items).hasSize(1);
|
||||
assertThat(items.get(0)).containsEntry("TITLE", "区间内");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user