feat(ops): add status test and model fetch

This commit is contained in:
zenfun
2025-12-21 20:22:56 +08:00
parent 6e6c669ea0
commit f7baa0f08f
3 changed files with 237 additions and 38 deletions

View File

@@ -150,6 +150,7 @@ func main() {
}
masterService := service.NewMasterService(db)
healthService := service.NewHealthCheckService(db, rdb)
healthHandler := api.NewHealthHandler(healthService)
handler := api.NewHandler(db, logDB, syncService, logWriter, rdb)
adminHandler := api.NewAdminHandler(db, logDB, masterService, syncService)
@@ -201,6 +202,7 @@ func main() {
}
c.JSON(httpStatus, status)
})
r.GET("/api/status/test", healthHandler.TestDeps)
// Swagger Documentation
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
@@ -245,6 +247,7 @@ func main() {
adminGroup.PUT("/providers/:id", handler.UpdateProvider)
adminGroup.DELETE("/providers/:id", handler.DeleteProvider)
adminGroup.POST("/providers/:id/test", handler.TestProvider)
adminGroup.POST("/providers/:id/fetch-models", handler.FetchProviderModels)
adminGroup.POST("/models", handler.CreateModel)
adminGroup.GET("/models", handler.ListModels)
adminGroup.PUT("/models/:id", handler.UpdateModel)