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:
authorVladislav Tupikin <MrRefactoring@yandex.ru>2026-04-19 22:24:24 +0300
committerGitHub <noreply@github.com>2026-04-19 22:24:24 +0300
commit7466916e0206d55826d74f37c251bb5e40182c00 (patch)
tree2c887558c71f34b76e541c7bf7d57a420ed3c9ed /web/controller/api.go
parent96b568b8389fd5a3ce228d5fb82ec9742d145b15 (diff)
Add custom geosite/geoip URL sources (#3980)
* feat: add custom geosite/geoip URL sources Register DB model, panel API, index/xray UI, and i18n. * fix
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)
}