doc: 增加代码注释

This commit is contained in:
2026-05-23 12:19:33 +08:00
parent 6801072671
commit 72497d8dc1
4 changed files with 18 additions and 8 deletions
+4 -2
View File
@@ -1,3 +1,4 @@
// gen2d backend 入口
package main
import (
@@ -16,9 +17,10 @@ func main() {
gin.SetMode(cfg.Mode)
r := gin.New()
r.Use(gin.Recovery())
r.Use(gin.Recovery()) // panic 恢复中间件,防止服务因未捕获异常宕机
r.GET("/api/v1/health", handler.Health)
// API v1 路由组
r.GET("/api/v1/health", handler.Health) // 健康检查
addr := fmt.Sprintf(":%d", cfg.Port)
log.Printf("gen2d backend starting on %s", addr)