diff --git a/api/legacy/handlers.go b/api/legacy/handlers.go new file mode 100644 index 0000000..bbde2af --- /dev/null +++ b/api/legacy/handlers.go @@ -0,0 +1,25 @@ +package legacy + +import ( + "net/http" + "time" + + "hands/config" + "hands/define" + + "github.com/gin-gonic/gin" +) + +// handleHealth 健康检查处理函数 +func (s *LegacyServer) handleHealth(c *gin.Context) { + c.JSON(http.StatusOK, define.ApiResponse{ + Status: "success", + Message: "CAN Control Service is running", + Data: map[string]any{ + "timestamp": time.Now(), + "availableInterfaces": config.Config.AvailableInterfaces, + "defaultInterface": config.Config.DefaultInterface, + "serviceVersion": "1.0.0-hand-type-support", + }, + }) +}