From 078be37e877ad166cbbb7058efb23a89c66162bc Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Mon, 24 Jun 2024 08:20:49 +0000 Subject: [PATCH] chore: Update consumeTokenRequest struct in token.go for better clarity --- controller/token.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/token.go b/controller/token.go index 8bef836e..9adadf87 100644 --- a/controller/token.go +++ b/controller/token.go @@ -213,7 +213,7 @@ func DeleteToken(c *gin.Context) { return } -type updateTokenDto struct { +type consumeTokenRequest struct { // AddUsedQuota add or subtract used quota from another source AddUsedQuota int `json:"add_used_quota" gorm:"-"` // AddReason is the reason for adding or subtracting used quota @@ -223,7 +223,7 @@ type updateTokenDto struct { // ConsumeToken consume token from another source, // let one-api to gather billing from different sources. func ConsumeToken(c *gin.Context) { - tokenPatch := new(updateTokenDto) + tokenPatch := new(consumeTokenRequest) err := c.ShouldBindJSON(tokenPatch) if err != nil { c.JSON(http.StatusOK, gin.H{