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