mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-10 02:23:43 +08:00
chore: Update consumeTokenRequest struct in token.go for better clarity
This commit is contained in:
@@ -213,7 +213,7 @@ func DeleteToken(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type updateTokenDto struct {
|
type consumeTokenRequest struct {
|
||||||
// AddUsedQuota add or subtract used quota from another source
|
// AddUsedQuota add or subtract used quota from another source
|
||||||
AddUsedQuota int `json:"add_used_quota" gorm:"-"`
|
AddUsedQuota int `json:"add_used_quota" gorm:"-"`
|
||||||
// AddReason is the reason for adding or subtracting used quota
|
// AddReason is the reason for adding or subtracting used quota
|
||||||
@@ -223,7 +223,7 @@ type updateTokenDto struct {
|
|||||||
// ConsumeToken consume token from another source,
|
// ConsumeToken consume token from another source,
|
||||||
// let one-api to gather billing from different sources.
|
// let one-api to gather billing from different sources.
|
||||||
func ConsumeToken(c *gin.Context) {
|
func ConsumeToken(c *gin.Context) {
|
||||||
tokenPatch := new(updateTokenDto)
|
tokenPatch := new(consumeTokenRequest)
|
||||||
err := c.ShouldBindJSON(tokenPatch)
|
err := c.ShouldBindJSON(tokenPatch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
|||||||
Reference in New Issue
Block a user