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
+7
View File
@@ -2,6 +2,7 @@ package main
import (
"log"
"time"
"github.com/gin-gonic/gin"
@@ -31,6 +32,12 @@ import (
)
func main() {
if loc, err := time.LoadLocation("Asia/Shanghai"); err == nil {
time.Local = loc
} else {
time.Local = time.FixedZone("CST", 8*3600)
}
// 1) 加载配置(通常来自环境变量 / .env)
config.LoadConfig()