主要更新: - 更新 go.mod/go.sum 依赖 - 重新生成 Ent ORM 代码 - 更新 Wire 依赖注入配置 - 添加 docker-compose.override.yml 到 .gitignore - 更新 README 文档(Simple Mode 说明和已知问题) - 清理调试日志 - 其他代码优化和格式修复
33 lines
792 B
Go
33 lines
792 B
Go
package routes
|
||
|
||
import (
|
||
"net/http"
|
||
|
||
"github.com/gin-gonic/gin"
|
||
)
|
||
|
||
// RegisterCommonRoutes 注册通用路由(健康检查、状态等)
|
||
func RegisterCommonRoutes(r *gin.Engine) {
|
||
// 健康检查
|
||
r.GET("/health", func(c *gin.Context) {
|
||
c.JSON(http.StatusOK, gin.H{"status": "ok"})
|
||
})
|
||
|
||
// Claude Code 遥测日志(忽略,直接返回200)
|
||
r.POST("/api/event_logging/batch", func(c *gin.Context) {
|
||
c.Status(http.StatusOK)
|
||
})
|
||
|
||
// Setup status endpoint (always returns needs_setup: false in normal mode)
|
||
// This is used by the frontend to detect when the service has restarted after setup
|
||
r.GET("/setup/status", func(c *gin.Context) {
|
||
c.JSON(http.StatusOK, gin.H{
|
||
"code": 0,
|
||
"data": gin.H{
|
||
"needs_setup": false,
|
||
"step": "completed",
|
||
},
|
||
})
|
||
})
|
||
}
|