mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
- Fix indentation
This commit is contained in:
parent
f79602ae74
commit
fb9839cb3d
2 changed files with 33 additions and 33 deletions
|
@ -104,7 +104,7 @@ func (controller *APIController) initApiV2Router(router *gin.RouterGroup) {
|
||||||
|
|
||||||
inboundsApiGroup.GET("/:id/clients/:clientId/traffic", controller.inbounds.getClientTrafficsById)
|
inboundsApiGroup.GET("/:id/clients/:clientId/traffic", controller.inbounds.getClientTrafficsById)
|
||||||
// TODO: get client ips by ID
|
// TODO: get client ips by ID
|
||||||
// TODO: client client ips by ID
|
// TODO: clear client ips by ID
|
||||||
// TODO: reset client traffic by ID
|
// TODO: reset client traffic by ID
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -150,55 +150,55 @@ func (a *InboundController) updateInbound(c *gin.Context) {
|
||||||
func (a *InboundController) getInboundClients(c *gin.Context) {
|
func (a *InboundController) getInboundClients(c *gin.Context) {
|
||||||
id, err := strconv.Atoi(c.Param("id"))
|
id, err := strconv.Atoi(c.Param("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jsonMsg(c, "GetInboundClients", errors.New("Incorrect inbound id"))
|
jsonMsg(c, "GetInboundClients", errors.New("Incorrect inbound id"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
client, err := a.inboundService.GetInboundClients(id)
|
client, err := a.inboundService.GetInboundClients(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jsonMsg(c, "GetInboundClientById", err)
|
jsonMsg(c, "GetInboundClientById", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonObj(c, client, nil)
|
jsonObj(c, client, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *InboundController) getClientById(c *gin.Context) {
|
func (a *InboundController) getClientById(c *gin.Context) {
|
||||||
id, err := strconv.Atoi(c.Param("id"))
|
id, err := strconv.Atoi(c.Param("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jsonMsg(c, "GetInboundClientById", errors.New("Incorrect inbound id"))
|
jsonMsg(c, "GetInboundClientById", errors.New("Incorrect inbound id"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
client, err := a.inboundService.GetInboundClientById(id, c.Param("clientId"))
|
client, err := a.inboundService.GetInboundClientById(id, c.Param("clientId"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jsonMsg(c, "GetInboundClientById", err)
|
jsonMsg(c, "GetInboundClientById", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if client == nil {
|
if client == nil {
|
||||||
jsonMsg(c, "GetInboundClientById", errors.New("Client not found"))
|
jsonMsg(c, "GetInboundClientById", errors.New("Client not found"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
jsonObj(c, client, nil)
|
jsonObj(c, client, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *InboundController) getClientByEmail(c *gin.Context) {
|
func (a *InboundController) getClientByEmail(c *gin.Context) {
|
||||||
id, err := strconv.Atoi(c.Param("id"))
|
id, err := strconv.Atoi(c.Param("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jsonMsg(c, "GetInboundClientByEmail", errors.New("Incorrect inbound id"))
|
jsonMsg(c, "GetInboundClientByEmail", errors.New("Incorrect inbound id"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
client, err := a.inboundService.GetInboundClientByEmail(id, c.Param("email"))
|
client, err := a.inboundService.GetInboundClientByEmail(id, c.Param("email"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jsonMsg(c, "GetInboundClientByEmail", err)
|
jsonMsg(c, "GetInboundClientByEmail", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if client == nil {
|
if client == nil {
|
||||||
jsonMsg(c, "GetInboundClientByEmail", errors.New("Client not found"))
|
jsonMsg(c, "GetInboundClientByEmail", errors.New("Client not found"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
jsonObj(c, client, nil)
|
jsonObj(c, client, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *InboundController) getClientIps(c *gin.Context) {
|
func (a *InboundController) getClientIps(c *gin.Context) {
|
||||||
|
|
Loading…
Reference in a new issue