Enhance smoking tracking API and documentation

- Updated the main.go file to set the local time zone to Asia/Shanghai.
- Changed API endpoints from `PUT` to `POST` for user profile and logs management in multiple documentation files to reflect the correct usage.
- Added new fields in the API response for home summary, including `last_smoke_at`, `today_count`, `resisted_count`, and `reduced_from_yesterday`.
- Enhanced documentation across various files to accurately describe the updated API endpoints and their expected behaviors.
This commit is contained in:
nepiedg
2026-01-25 07:55:32 +00:00
parent be6d579d41
commit b67dc32369
12 changed files with 758 additions and 37 deletions
@@ -98,8 +98,11 @@ func TestIsSmokeProfileCompleted(t *testing.T) {
t.Fatalf("isSmokeProfileCompleted: expected true")
}
p.SmokeMotivations = nil
if !isSmokeProfileCompleted(p) {
t.Fatalf("isSmokeProfileCompleted: expected true when smoke_motivations empty")
}
p.QuitMotivations = nil
if isSmokeProfileCompleted(p) {
t.Fatalf("isSmokeProfileCompleted: expected false when motivations missing")
t.Fatalf("isSmokeProfileCompleted: expected false when quit_motivations missing")
}
}