diff options
Diffstat (limited to 'web/controller')
| -rw-r--r-- | web/controller/xray_setting.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/web/controller/xray_setting.go b/web/controller/xray_setting.go index d0fe9ca3..3391ad3b 100644 --- a/web/controller/xray_setting.go +++ b/web/controller/xray_setting.go @@ -12,6 +12,7 @@ type XraySettingController struct { InboundService service.InboundService OutboundService service.OutboundService XrayService service.XrayService + WarpService service.WarpService } func NewXraySettingController(g *gin.RouterGroup) *XraySettingController { @@ -72,16 +73,18 @@ func (a *XraySettingController) warp(c *gin.Context) { var err error switch action { case "data": - resp, err = a.XraySettingService.GetWarp() + resp, err = a.WarpService.GetWarpData() + case "del": + err = a.WarpService.DelWarpData() case "config": - resp, err = a.XraySettingService.GetWarpConfig() + resp, err = a.WarpService.GetWarpConfig() case "reg": skey := c.PostForm("privateKey") pkey := c.PostForm("publicKey") - resp, err = a.XraySettingService.RegWarp(skey, pkey) + resp, err = a.WarpService.RegWarp(skey, pkey) case "license": license := c.PostForm("license") - resp, err = a.XraySettingService.SetWarpLicense(license) + resp, err = a.WarpService.SetWarpLicense(license) } jsonObj(c, resp, err) |
