实现健康路由

This commit is contained in:
2025-11-06 16:31:21 +08:00
parent b203cfcb7f
commit 901cdfeb5c
4 changed files with 68 additions and 1 deletions

View File

@@ -20,6 +20,11 @@ func (a *API) setupRoutes() {
// --- Public Routes ---
// 这些路由不需要身份验证
// 健康检查路由
a.echo.GET("/healthz", a.healthController.Healthz)
a.echo.GET("/readyz", a.healthController.Readyz)
logger.Debug("公开接口注册成功:健康检查")
// 用户注册和登录
a.echo.POST("/api/v1/users", a.userController.CreateUser) // 注册新用户
a.echo.POST("/api/v1/users/login", a.userController.Login) // 用户登录
@@ -169,7 +174,7 @@ func (a *API) setupRoutes() {
monitorGroup.GET("/pending-collections", a.monitorController.ListPendingCollections)
monitorGroup.GET("/user-action-logs", a.monitorController.ListUserActionLogs)
monitorGroup.GET("/raw-material-purchases", a.monitorController.ListRawMaterialPurchases)
monitorGroup.GET("/raw-material-stock-logs", a.monitorController.ListRawMaterialStockLogs)
monitorGroup.GET("raw-material-stock-logs", a.monitorController.ListRawMaterialStockLogs)
monitorGroup.GET("/feed-usage-records", a.monitorController.ListFeedUsageRecords)
monitorGroup.GET("/medication-logs", a.monitorController.ListMedicationLogs)
monitorGroup.GET("/pig-batch-logs", a.monitorController.ListPigBatchLogs)