Update algorithm and API documentation for smoking tracking app

- Enhanced the algorithm documentation to clarify the calculation of smoking intervals, including default values and edge cases.
- Updated API documentation to reflect changes in response formats, including the addition of `exceeded_yesterday` and adjustments to time formatting to RFC3339.
- Improved descriptions of user profile management and AI suggestions in the product documentation, ensuring consistency across all related files.
- Removed outdated sequence diagram and UI documentation files to streamline project resources.
This commit is contained in:
nepiedg
2026-01-25 08:51:25 +00:00
parent b67dc32369
commit f80c3e8f45
9 changed files with 62 additions and 402 deletions
+3 -3
View File
@@ -123,6 +123,7 @@ type SmokeHomeSummary struct {
TodayCount int
ResistedCount int
ReducedFromYesterday int
ExceededYesterday bool
}
// DashboardWeeklyStat 表示某一天的抽烟支数以及是否为今天。
@@ -290,9 +291,7 @@ func (s *SmokeLogService) HomeSummary(ctx context.Context, uid int, asOf time.Ti
}
reduced := int(yesterdayCount - todayCount)
if reduced < 0 {
reduced = 0
}
exceeded := reduced < 0
var lastSmokeAt *time.Time
var last smokemodel.SmokeLog
@@ -315,6 +314,7 @@ func (s *SmokeLogService) HomeSummary(ctx context.Context, uid int, asOf time.Ti
TodayCount: int(todayCount),
ResistedCount: int(resistedCount),
ReducedFromYesterday: reduced,
ExceededYesterday: exceeded,
}, nil
}