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:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user