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)
|
||||
// TODO: get client ips by ID
|
||||
// TODO: client client ips by ID
|
||||
// TODO: clear client ips 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) {
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue