This commit is contained in:
van
2026-03-09 15:25:22 +08:00
parent dc8b0b2fcf
commit b4749f3516
3 changed files with 36 additions and 9 deletions

View File

@@ -34,15 +34,17 @@ public class InstructionController extends BaseController {
}
/**
* 获取历史消息记录
* 获取历史消息记录(支持关键词搜索,在全部历史数据中匹配)
* @param type 消息类型request(请求) 或 response(响应)
* @param limit 获取数量默认100条
* @param limit 获取数量默认100条;有 keyword 时为返回匹配条数上限默认200
* @param keyword 可选,搜索关键词;不为空时在全部数据中过滤后返回
* @return 历史消息列表
*/
@GetMapping("/history")
public AjaxResult getHistory(@RequestParam(required = false, defaultValue = "request") String type,
@RequestParam(required = false, defaultValue = "100") Integer limit) {
java.util.List<String> history = instructionService.getHistory(type, limit);
@RequestParam(required = false, defaultValue = "100") Integer limit,
@RequestParam(required = false) String keyword) {
java.util.List<String> history = instructionService.getHistory(type, limit, keyword);
return AjaxResult.success(history);
}
}