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:
authorMahdi Nemati <nematimahdi88@gmail.com>2023-05-19 00:01:05 +0300
committerGitHub <noreply@github.com>2023-05-19 00:01:05 +0300
commit334b28cddc713fbeb01e1589926e1975de83c64f (patch)
tree3c9fde049055db29abb1a20041ba02198f7845de /web/controller
parent2fbfc88bc152c46dd8ea33c240ca35038e427986 (diff)
Api for backup Telegram (#468)
Diffstat (limited to 'web/controller')
-rw-r--r--web/controller/api.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/web/controller/api.go b/web/controller/api.go
index 607dd83a..17073345 100644
--- a/web/controller/api.go
+++ b/web/controller/api.go
@@ -1,10 +1,15 @@
package controller
-import "github.com/gin-gonic/gin"
+import (
+ "x-ui/web/service"
+
+ "github.com/gin-gonic/gin"
+)
type APIController struct {
BaseController
inboundController *InboundController
+ Tgbot service.Tgbot
}
func NewAPIController(g *gin.RouterGroup) *APIController {
@@ -32,7 +37,7 @@ func (a *APIController) initRouter(g *gin.RouterGroup) {
g.POST("/resetAllTraffics", a.resetAllTraffics)
g.POST("/resetAllClientTraffics/:id", a.resetAllClientTraffics)
g.POST("/delDepletedClients/:id", a.delDepletedClients)
-
+ g.GET("/createbackup", a.createBackup)
a.inboundController = NewInboundController(g)
}
@@ -95,3 +100,7 @@ func (a *APIController) resetAllClientTraffics(c *gin.Context) {
func (a *APIController) delDepletedClients(c *gin.Context) {
a.inboundController.delDepletedClients(c)
}
+
+func (a *APIController) createBackup(c *gin.Context) {
+ a.Tgbot.SendBackUP(c)
+}