feat(legacy): implement health check function
This commit is contained in:
parent
e04e311ff4
commit
cc1de7c776
25
api/legacy/handlers.go
Normal file
25
api/legacy/handlers.go
Normal file
@ -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",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user