mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-22 00:35:48 +00:00
Add getClientTrafficsById (#1347)
* Add getClientTrafficsById Ability for API to get traffics by uuid * bugfix GetClientTrafficByID * bugfix GetClientTrafficByID * Update GetClientTrafficByID function by Alireza0 Recomendation * update Replace Logger Warning with Debug for GetClientTrafficByID * Fix: return empty array instead of error in case of gorm.ErrRecordNotFound --------- Co-authored-by: Ali Gilani <gilani1364@gmail.com>
This commit is contained in:
committed by
GitHub
parent
f6535dd83e
commit
f5ce84ae68
@@ -75,6 +75,15 @@ func (a *InboundController) getClientTraffics(c *gin.Context) {
|
||||
jsonObj(c, clientTraffics, nil)
|
||||
}
|
||||
|
||||
func (a *InboundController) getClientTrafficsById(c *gin.Context) {
|
||||
id := c.Param("id")
|
||||
clientTraffics, err := a.inboundService.GetClientTrafficByID(id)
|
||||
if err != nil {
|
||||
jsonMsg(c, "Error getting traffics", err)
|
||||
return
|
||||
}
|
||||
jsonObj(c, clientTraffics, nil)
|
||||
}
|
||||
func (a *InboundController) addInbound(c *gin.Context) {
|
||||
inbound := &model.Inbound{}
|
||||
err := c.ShouldBind(inbound)
|
||||
|
||||
Reference in New Issue
Block a user