Update algorithm and API documentation for smoking recovery and motivation features
- Added unified backend calculations for health recovery, savings, and motivation generation in the algorithm documentation. - Updated API documentation to include new endpoints for retrieving statistics and motivation messages, enhancing clarity on data retrieval processes. - Revised product documentation to reflect changes in API usage for health recovery and savings calculations, ensuring consistency across all related files.
This commit is contained in:
@@ -202,7 +202,9 @@ function calculateDailyTarget(baseline, stage, dayInStage) {
|
||||
|
||||
---
|
||||
|
||||
## 5. 健康恢复计算
|
||||
## 5. 健康恢复计算(后端统一)
|
||||
|
||||
接口:`GET /api/v1/smoke/stats?range=week|month|year`(详见 `docs/smoke/API.md`)
|
||||
|
||||
基于医学研究的恢复时间线:
|
||||
|
||||
@@ -236,7 +238,9 @@ function calculateLungRecovery(smokeFreeMinutes) {
|
||||
|
||||
---
|
||||
|
||||
## 6. 省钱计算
|
||||
## 6. 省钱计算(后端统一)
|
||||
|
||||
接口:`GET /api/v1/smoke/stats?range=week|month|year`(详见 `docs/smoke/API.md`)
|
||||
|
||||
```javascript
|
||||
// utils/money.js
|
||||
@@ -250,7 +254,9 @@ function calculateMoneySaved(packPriceCent, cigsPerPack, baselineCigsPerDay, act
|
||||
|
||||
---
|
||||
|
||||
## 7. 激励语生成
|
||||
## 7. 激励语生成(后端统一)
|
||||
|
||||
接口:`GET /api/v1/smoke/motivation`(详见 `docs/smoke/API.md`)
|
||||
|
||||
根据用户状态生成不同的激励语:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user