Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/controller/api.go')
-rw-r--r--web/controller/api.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/controller/api.go b/web/controller/api.go
index 1a39f8ed..57d2e4cb 100644
--- a/web/controller/api.go
+++ b/web/controller/api.go
@@ -18,9 +18,9 @@ type APIController struct {
}
// NewAPIController creates a new APIController instance and initializes its routes.
-func NewAPIController(g *gin.RouterGroup) *APIController {
+func NewAPIController(g *gin.RouterGroup, customGeo *service.CustomGeoService) *APIController {
a := &APIController{}
- a.initRouter(g)
+ a.initRouter(g, customGeo)
return a
}
@@ -35,7 +35,7 @@ func (a *APIController) checkAPIAuth(c *gin.Context) {
}
// initRouter sets up the API routes for inbounds, server, and other endpoints.
-func (a *APIController) initRouter(g *gin.RouterGroup) {
+func (a *APIController) initRouter(g *gin.RouterGroup, customGeo *service.CustomGeoService) {
// Main API group
api := g.Group("/panel/api")
api.Use(a.checkAPIAuth)
@@ -48,6 +48,8 @@ func (a *APIController) initRouter(g *gin.RouterGroup) {
server := api.Group("/server")
a.serverController = NewServerController(server)
+ NewCustomGeoController(api.Group("/custom-geo"), customGeo)
+
// Extra routes
api.GET("/backuptotgbot", a.BackuptoTgbot)
}