refactor: reorganize WebSocket API route configuration for improved clarity

This commit is contained in:
mlogclub
2026-04-25 10:51:41 +08:00
parent 2c884c13cf
commit 323db62512
+5 -8
View File
@@ -92,21 +92,18 @@ func addRouter(app *iris.Application) {
mcpHandler.ServeHTTP(w, r)
})))
mvc.Configure(app.Party("/api/ws"), func(m *mvc.Application) {
m.Router.Get("/dashboard", middleware.AuthMiddleware, services.WsService.HandleDashboardWS)
m.Router.Get("/open", services.WsService.HandleOpenWS)
})
mvc.Configure(app.Party("/api"), func(m *mvc.Application) {
m.Party("/auth").Handle(new(api.AuthController))
m.Party("/channel").Handle(new(api.ChannelController))
// m.Router.Get("/ws", middleware.OpenImWsMiddleware)
m.Party("/conversation", middleware.ExternalInfoMiddleware).Handle(new(api.ConversationController))
m.Party("/message", middleware.ExternalInfoMiddleware).Handle(new(api.MessageController))
})
mvc.Configure(app.Party("/api/ws"), func(m *mvc.Application) {
m.Router.Get("/dashboard", middleware.AuthMiddleware, services.WsService.HandleDashboardWS)
m.Router.Get("/open", services.WsService.HandleOpenWS)
})
mvc.Configure(app.Party("/api/dashboard", middleware.AuthMiddleware), func(m *mvc.Application) {
m.Party("/dashboard").Handle(new(dashboard.DashboardController))
m.Party("/user").Handle(new(dashboard.UserController))