diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 10:35:50 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 10:35:50 +0300 |
| commit | 6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 (patch) | |
| tree | 28d8d82530476cf607e4d05ca189ae05868711e6 /web/controller/api.go | |
| parent | f60682a6b7cb749fee403c84e2587c3ad7e7ced0 (diff) | |
docs: add comments for all functions
Diffstat (limited to 'web/controller/api.go')
| -rw-r--r-- | web/controller/api.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/web/controller/api.go b/web/controller/api.go index 506f8cc3..dbd3f28d 100644 --- a/web/controller/api.go +++ b/web/controller/api.go @@ -6,6 +6,7 @@ import ( "github.com/gin-gonic/gin" ) +// APIController handles the main API routes for the 3x-ui panel, including inbounds and server management. type APIController struct { BaseController inboundController *InboundController @@ -13,12 +14,14 @@ type APIController struct { Tgbot service.Tgbot } +// NewAPIController creates a new APIController instance and initializes its routes. func NewAPIController(g *gin.RouterGroup) *APIController { a := &APIController{} a.initRouter(g) return a } +// initRouter sets up the API routes for inbounds, server, and other endpoints. func (a *APIController) initRouter(g *gin.RouterGroup) { // Main API group api := g.Group("/panel/api") @@ -36,6 +39,7 @@ func (a *APIController) initRouter(g *gin.RouterGroup) { api.GET("/backuptotgbot", a.BackuptoTgbot) } +// BackuptoTgbot sends a backup of the panel data to Telegram bot admins. func (a *APIController) BackuptoTgbot(c *gin.Context) { a.Tgbot.SendBackupToAdmins() } |
