Go: Add admin server status checking (#13571)

### What problem does this PR solve?

RAGFlow server isn't available when admin server isn't connected.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-03-12 20:02:50 +08:00
committed by GitHub
parent 1df804a14a
commit d688b72dff
10 changed files with 181 additions and 26 deletions

View File

@ -93,12 +93,13 @@ func (r *Router) Setup(engine *gin.Engine) {
// User login by email endpoint
engine.POST("/v1/user/login", r.userHandler.LoginByEmail)
// User logout endpoint
engine.GET("/v1/user/logout", r.userHandler.Logout)
// Protected routes
authorized := engine.Group("")
authorized.Use(r.authHandler.AuthMiddleware())
{
// User logout endpoint
authorized.GET("/v1/user/logout", r.userHandler.Logout)
// User info endpoint
authorized.GET("/v1/user/info", r.userHandler.Info)
// User tenant info endpoint
@ -116,13 +117,13 @@ func (r *Router) Setup(engine *gin.Engine) {
v1 := authorized.Group("/api/v1")
{
// User routes
users := v1.Group("/users")
{
users.POST("/register", r.userHandler.Register)
users.POST("/login", r.userHandler.Login)
users.GET("", r.userHandler.ListUsers)
users.GET("/:id", r.userHandler.GetUserByID)
}
//users := v1.Group("/users")
//{
// users.POST("/register", r.userHandler.Register)
// users.POST("/login", r.userHandler.Login)
// users.GET("", r.userHandler.ListUsers)
// users.GET("/:id", r.userHandler.GetUserByID)
//}
// Document routes
documents := v1.Group("/documents")