mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 21:24:10 +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.
|
||||
func NewAPIController(g *gin.RouterGroup, customGeo service.CustomGeoService) *APIController {
|
||||
func NewAPIController(g *gin.RouterGroup, customGeo *service.CustomGeoService) *APIController {
|
||||
a := &APIController{}
|
||||
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, customGeo service.CustomGeoService) {
|
||||
func (a *APIController) initRouter(g *gin.RouterGroup, customGeo *service.CustomGeoService) {
|
||||
// Main API group
|
||||
api := g.Group("/panel/api")
|
||||
api.Use(a.checkAPIAuth)
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ import (
|
|||
|
||||
type CustomGeoController struct {
|
||||
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.initRouter(g)
|
||||
return a
|
||||
|
|
|
|||
|
|
@ -64,15 +64,15 @@ type CustomGeoUpdateAllResult struct {
|
|||
}
|
||||
|
||||
type CustomGeoService struct {
|
||||
serverService ServerService
|
||||
serverService *ServerService
|
||||
updateAllGetAll func() ([]model.CustomGeoResource, error)
|
||||
updateAllApply func(id int, onStartup bool) (string, error)
|
||||
updateAllRestart func() error
|
||||
}
|
||||
|
||||
func NewCustomGeoService() CustomGeoService {
|
||||
s := CustomGeoService{
|
||||
serverService: ServerService{},
|
||||
func NewCustomGeoService() *CustomGeoService {
|
||||
s := &CustomGeoService{
|
||||
serverService: &ServerService{},
|
||||
}
|
||||
s.updateAllGetAll = s.GetAll
|
||||
s.updateAllApply = s.applyDownloadAndPersist
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ type Server struct {
|
|||
xrayService service.XrayService
|
||||
settingService service.SettingService
|
||||
tgbotService service.Tgbot
|
||||
customGeoService service.CustomGeoService
|
||||
customGeoService *service.CustomGeoService
|
||||
|
||||
wsHub *websocket.Hub
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue