feat(calculator): 食谱计算器历史记录功能(test-0415 反馈2-2)

后端:
- GET /api/front/tool/calculator/history 倒序分页返回当前用户记录摘要
- ToolCalculatorService.getHistory(PageParamRequest) 实现
- 摘要含 id / createdAt / bmi / ckdStage / proteinIntake / energyIntake / isAdopted / hasDialysis

前端:
- api/tool.js 新增 getCalculatorHistory(params)
- pages/tool/calculator-history.vue 历史列表页(下拉刷新 + 触底加载)
- 点击行跳转 calculator-result?id=xxx 复用结果页,自然支持「重新载入参数」
- pages.json 注册路由

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
msh-agent
2026-05-03 03:24:30 +08:00
parent 229181f1e0
commit fde0d555fa
6 changed files with 288 additions and 6 deletions

View File

@@ -102,6 +102,17 @@ public class ToolController {
return CommonResult.success(toolCalculatorService.getResult(id));
}
/**
* 获取计算历史记录列表test-0415 反馈2-2
* 当前登录用户最近的营养计算记录倒序分页。
*/
@ApiOperation(value = "获取计算历史记录", notes = "倒序分页返回当前用户的营养计算结果摘要")
@GetMapping("/calculator/history")
public CommonResult<CommonPage<Map<String, Object>>> getCalculatorHistory(
@Validated PageParamRequest pageParamRequest) {
return CommonResult.success(CommonPage.restPage(toolCalculatorService.getHistory(pageParamRequest)));
}
/**
* 采纳营养计划
* <p>