From fb9839cb3d53a1a9649f4c29b45fde4e49d3a407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90lexander=20Kiselev?= Date: Fri, 7 Feb 2025 10:38:55 +0300 Subject: [PATCH] - Fix indentation --- web/controller/api.go | 2 +- web/controller/inbound.go | 64 +++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/web/controller/api.go b/web/controller/api.go index fd8d3a49..3e599688 100644 --- a/web/controller/api.go +++ b/web/controller/api.go @@ -104,7 +104,7 @@ func (controller *APIController) initApiV2Router(router *gin.RouterGroup) { inboundsApiGroup.GET("/:id/clients/:clientId/traffic", controller.inbounds.getClientTrafficsById) // TODO: get client ips by ID - // TODO: client client ips by ID + // TODO: clear client ips by ID // TODO: reset client traffic by ID /** diff --git a/web/controller/inbound.go b/web/controller/inbound.go index d6c10ec3..0c90174b 100644 --- a/web/controller/inbound.go +++ b/web/controller/inbound.go @@ -150,55 +150,55 @@ func (a *InboundController) updateInbound(c *gin.Context) { func (a *InboundController) getInboundClients(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, "GetInboundClients", errors.New("Incorrect inbound id")) - return + jsonMsg(c, "GetInboundClients", errors.New("Incorrect inbound id")) + return } - client, err := a.inboundService.GetInboundClients(id) - if err != nil { - jsonMsg(c, "GetInboundClientById", err) - return - } + client, err := a.inboundService.GetInboundClients(id) + if err != nil { + jsonMsg(c, "GetInboundClientById", err) + return + } - jsonObj(c, client, nil) + jsonObj(c, client, nil) } func (a *InboundController) getClientById(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, "GetInboundClientById", errors.New("Incorrect inbound id")) - return + jsonMsg(c, "GetInboundClientById", errors.New("Incorrect inbound id")) + return } - client, err := a.inboundService.GetInboundClientById(id, c.Param("clientId")) - if err != nil { - jsonMsg(c, "GetInboundClientById", err) - return - } - if client == nil { - jsonMsg(c, "GetInboundClientById", errors.New("Client not found")) - return - } - jsonObj(c, client, nil) + client, err := a.inboundService.GetInboundClientById(id, c.Param("clientId")) + if err != nil { + jsonMsg(c, "GetInboundClientById", err) + return + } + if client == nil { + jsonMsg(c, "GetInboundClientById", errors.New("Client not found")) + return + } + jsonObj(c, client, nil) } func (a *InboundController) getClientByEmail(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, "GetInboundClientByEmail", errors.New("Incorrect inbound id")) - return + jsonMsg(c, "GetInboundClientByEmail", errors.New("Incorrect inbound id")) + return } - client, err := a.inboundService.GetInboundClientByEmail(id, c.Param("email")) - if err != nil { - jsonMsg(c, "GetInboundClientByEmail", err) - return - } - if client == nil { - jsonMsg(c, "GetInboundClientByEmail", errors.New("Client not found")) - return - } - jsonObj(c, client, nil) + client, err := a.inboundService.GetInboundClientByEmail(id, c.Param("email")) + if err != nil { + jsonMsg(c, "GetInboundClientByEmail", err) + return + } + if client == nil { + jsonMsg(c, "GetInboundClientByEmail", errors.New("Client not found")) + return + } + jsonObj(c, client, nil) } func (a *InboundController) getClientIps(c *gin.Context) {