feat(mcp): 新增出纸机通信日志查询工具 hardware.socketlog.list.query

- 对应老系统 SocketLogController /hardwareLog/listByPage,读 ES 月索引 socket_log_yyyyMM
- 双集群按 Redis Dictionary.SocketLogPath 切换,返回 cluster 便于排障
- 拍板:不加行级 ACL、允许服务 Token、logType 0-18/99、srcLogContent 不截断、
  不做名称富化、rows 默认 20 上限 100、索引不存在返回空 + notice
This commit is contained in:
my_local_kimi_dev2
2026-11-30 16:48:35 +08:00
parent 6dad85d6e4
commit ba3581fc9d
8 changed files with 1722 additions and 0 deletions
@@ -1386,6 +1386,29 @@
---
## 59. hardware.socketlog.list.query
出纸机通信日志分页查询(只读),对应老系统 `SocketLogController` 的 `/hardwareLog/listByPage`。
- 分类:hardware | 类型:读(readOnlyHint=true)
- 数据源:ES 月别名 `socket_log_yyyyMM`(物理索引 `socket_log_yyyyMMNN`);集群由 Redis db5
`Dictionary.SocketLogPath` 决定:`offline`→本地集群,`online`/缺失→云集群;返回体带 `cluster` 便于排障。
- 入参:`snCode`(必填,1~64 字符,`match_phrase`);`logType`(多选,0-18、99);
`startTime`/`endTime`(`yyyy-MM-dd` 或 `yyyy-MM-dd HH:mm:ss`,必须同月且同时传或同时不传,缺省当天);
`page`(默认 1);`rows`(默认 20、上限 100)。
- 查询:`createTime` 为 date 类型,range 必须发 **epoch 毫秒**(Asia/Shanghai);排序 `createTime desc, id desc`;
`track_total_hits=true` 取精确总数;`from+size` 超 10000 按窗口截断并在 notice 说明。
- 返回:`snCode/cluster/index/total/totalPages/page/rows/records/notice`;`records` 为索引全字段加
`logTypeText/messageTypeText/useTypeText` 中文文案,`srcLogContent` 原样返回不截断。
- 空/异常:目标月份索引不存在时返回 `total=0` + notice(不报 500);Redis/ES 连接失败返回 `UPSTREAM_UNAVAILABLE`;
参数非法(snCode 为空、时间格式/跨月、logType 非法)返回 `INVALID_ARGUMENT`。
- 权限:无行级 ACL(2026-11-30 拍板对齐老接口,仅靠 Token scope 约束能力面);允许用户 Token 与服务 Token;
prod 只绑研发专用 scope 6(code=code),dev 绑测试专用 scope(code=test)与 ops-query。
详细设计见 [socket-log-list-mcp-design](socket-log-list-mcp-design.md)。
---
## 附录:在线查看工具清单
```bash