1
This commit is contained in:
@@ -3,10 +3,7 @@ package com.ruoyi.web.controller.jarvis;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.jarvis.service.IInstructionService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -33,6 +30,19 @@ public class InstructionController extends BaseController {
|
||||
java.util.List<String> result = instructionService.execute(cmd);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取历史消息记录
|
||||
* @param type 消息类型:request(请求) 或 response(响应)
|
||||
* @param limit 获取数量,默认100条
|
||||
* @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);
|
||||
return AjaxResult.success(history);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user