mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-08 14:14:19 +00:00
fix
This commit is contained in:
parent
0b45732422
commit
96f3768d53
4 changed files with 9 additions and 9 deletions
|
|
@ -18,7 +18,7 @@ type APIController struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewAPIController creates a new APIController instance and initializes its routes.
|
// NewAPIController creates a new APIController instance and initializes its routes.
|
||||||
func NewAPIController(g *gin.RouterGroup, customGeo service.CustomGeoService) *APIController {
|
func NewAPIController(g *gin.RouterGroup, customGeo *service.CustomGeoService) *APIController {
|
||||||
a := &APIController{}
|
a := &APIController{}
|
||||||
a.initRouter(g, customGeo)
|
a.initRouter(g, customGeo)
|
||||||
return a
|
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.
|
// initRouter sets up the API routes for inbounds, server, and other endpoints.
|
||||||
func (a *APIController) initRouter(g *gin.RouterGroup, customGeo service.CustomGeoService) {
|
func (a *APIController) initRouter(g *gin.RouterGroup, customGeo *service.CustomGeoService) {
|
||||||
// Main API group
|
// Main API group
|
||||||
api := g.Group("/panel/api")
|
api := g.Group("/panel/api")
|
||||||
api.Use(a.checkAPIAuth)
|
api.Use(a.checkAPIAuth)
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ import (
|
||||||
|
|
||||||
type CustomGeoController struct {
|
type CustomGeoController struct {
|
||||||
BaseController
|
BaseController
|
||||||
customGeoService service.CustomGeoService
|
customGeoService *service.CustomGeoService
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCustomGeoController(g *gin.RouterGroup, customGeo service.CustomGeoService) *CustomGeoController {
|
func NewCustomGeoController(g *gin.RouterGroup, customGeo *service.CustomGeoService) *CustomGeoController {
|
||||||
a := &CustomGeoController{customGeoService: customGeo}
|
a := &CustomGeoController{customGeoService: customGeo}
|
||||||
a.initRouter(g)
|
a.initRouter(g)
|
||||||
return a
|
return a
|
||||||
|
|
|
||||||
|
|
@ -64,15 +64,15 @@ type CustomGeoUpdateAllResult struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CustomGeoService struct {
|
type CustomGeoService struct {
|
||||||
serverService ServerService
|
serverService *ServerService
|
||||||
updateAllGetAll func() ([]model.CustomGeoResource, error)
|
updateAllGetAll func() ([]model.CustomGeoResource, error)
|
||||||
updateAllApply func(id int, onStartup bool) (string, error)
|
updateAllApply func(id int, onStartup bool) (string, error)
|
||||||
updateAllRestart func() error
|
updateAllRestart func() error
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCustomGeoService() CustomGeoService {
|
func NewCustomGeoService() *CustomGeoService {
|
||||||
s := CustomGeoService{
|
s := &CustomGeoService{
|
||||||
serverService: ServerService{},
|
serverService: &ServerService{},
|
||||||
}
|
}
|
||||||
s.updateAllGetAll = s.GetAll
|
s.updateAllGetAll = s.GetAll
|
||||||
s.updateAllApply = s.applyDownloadAndPersist
|
s.updateAllApply = s.applyDownloadAndPersist
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ type Server struct {
|
||||||
xrayService service.XrayService
|
xrayService service.XrayService
|
||||||
settingService service.SettingService
|
settingService service.SettingService
|
||||||
tgbotService service.Tgbot
|
tgbotService service.Tgbot
|
||||||
customGeoService service.CustomGeoService
|
customGeoService *service.CustomGeoService
|
||||||
|
|
||||||
wsHub *websocket.Hub
|
wsHub *websocket.Hub
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue