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
+5 -3
View File
@@ -21,6 +21,7 @@ type nextSmokeTimeUnifiedResponse struct {
TodayCount int `json:"today_count"`
Resisted int `json:"resisted_count"`
Reduced int `json:"reduced_from_yesterday"`
Exceeded bool `json:"exceeded_yesterday"`
TimeNodes []string `json:"time_nodes,omitempty"`
Advice string `json:"advice,omitempty"`
Default nextSmokeDefaultResponse `json:"default"`
@@ -84,7 +85,7 @@ func (h *SmokeHandler) GetNextSmokeTime(c *gin.Context) {
if t == nil {
return ""
}
return t.In(time.Local).Format(dateTimeLayout)
return t.In(time.Local).Format(time.RFC3339)
}
formatTimeString := func(value string) string {
@@ -93,10 +94,10 @@ func (h *SmokeHandler) GetNextSmokeTime(c *gin.Context) {
return ""
}
if t, err := time.Parse(time.RFC3339, value); err == nil {
return t.In(time.Local).Format(dateTimeLayout)
return t.In(time.Local).Format(time.RFC3339)
}
if t, err := time.ParseInLocation(dateTimeLayout, value, time.Local); err == nil {
return t.In(time.Local).Format(dateTimeLayout)
return t.In(time.Local).Format(time.RFC3339)
}
return value
}
@@ -137,6 +138,7 @@ func (h *SmokeHandler) GetNextSmokeTime(c *gin.Context) {
TodayCount: homeSummary.TodayCount,
Resisted: homeSummary.ResistedCount,
Reduced: homeSummary.ReducedFromYesterday,
Exceeded: homeSummary.ExceededYesterday,
Default: formatDefault(defaultSuggestion),
}