feat(taskcenter): 变体采集接口(麦象代理,多 uid + res_mes)
This commit is contained in:
+26
-3
@@ -68,6 +68,25 @@ public class MaixiangConsoleClient {
|
||||
return parseSingleTaskPage(fetch(url, "单任务列表 status=" + status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量任务分页查询(后台看板用):按 uid 集合(逗号分隔,服务端拆分后 IN)、状态、类型筛选。
|
||||
* {@code uidsCsv} 为空表示不加 uid 过滤(超管),此时会看到所有客户端提交的任务。
|
||||
* 查询失败(含未部署新麦象接口)返回空页,由调用方展示空列表。
|
||||
*/
|
||||
public BatchTaskPage batchTasksPage(String uidsCsv, Integer status, String taskType, int page, int pageSize) {
|
||||
return parseBatchTaskPage(fetch(batchTasksUrl(uidsCsv, status, taskType, page, pageSize), "批量任务列表(看板)"));
|
||||
}
|
||||
|
||||
/** 组装看板批量任务查询 URL(包内可见供单测校验参数编码)。 */
|
||||
String batchTasksUrl(String uidsCsv, Integer status, String taskType, int page, int pageSize) {
|
||||
return buildUrl("/api/console/batch/tasks",
|
||||
hasText(uidsCsv) ? "uid=" + uidsCsv.trim() : null,
|
||||
status == null ? null : "status=" + status,
|
||||
hasText(taskType) ? "task_type=" + taskType.trim() : null,
|
||||
"page=" + page,
|
||||
"page_size=" + pageSize);
|
||||
}
|
||||
|
||||
/** 单任务队列状态(task:queue:N / task:processing:N,仅返回非零级别)。 */
|
||||
public List<QueueStateItem> queueStatus() {
|
||||
return parseQueueStates(fetch(buildUrl("/api/console/queue/status"), "队列状态"));
|
||||
@@ -154,7 +173,10 @@ public class MaixiangConsoleClient {
|
||||
node.path("uid").asText(""),
|
||||
node.path("status").asInt(-1),
|
||||
parseTime(node.path("create_time").asText(null)),
|
||||
parseTime(node.path("update_time").asText(null))));
|
||||
parseTime(node.path("update_time").asText(null)),
|
||||
node.path("res_mes").asText(""),
|
||||
node.path("task_data").isMissingNode() || node.path("task_data").isNull()
|
||||
? null : node.path("task_data").asText("")));
|
||||
}
|
||||
return new BatchTaskPage(data.path("total").asLong(items.size()), items);
|
||||
}
|
||||
@@ -220,9 +242,10 @@ public class MaixiangConsoleClient {
|
||||
|
||||
// ======================== 数据模型 ========================
|
||||
|
||||
/** 批量任务(all_task)单条。 */
|
||||
/** 批量任务(all_task)单条;{@code resMes} 是进度/结果文字(旧版接口缺失时为空串)。 */
|
||||
public record BatchTaskItem(String taskId, String taskType, String uid, int status,
|
||||
LocalDateTime createTime, LocalDateTime updateTime) {
|
||||
LocalDateTime createTime, LocalDateTime updateTime,
|
||||
String resMes, String taskData) {
|
||||
}
|
||||
|
||||
public record BatchTaskPage(long total, List<BatchTaskItem> items) {
|
||||
|
||||
Reference in New Issue
Block a user