mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 02:03:42 +08:00
chore: add endpoint for consuming tokens
This commit adds a new endpoint `/token/consume` to the API router, allowing users to consume tokens from another source. It includes changes to the `token.go` file in the `controller` package.
This commit is contained in:
@@ -93,6 +93,7 @@ func SetApiRouter(router *gin.Engine) {
|
||||
tokenRoute.POST("/", controller.AddToken)
|
||||
tokenRoute.PUT("/", controller.UpdateToken)
|
||||
tokenRoute.DELETE("/:id", controller.DeleteToken)
|
||||
apiRouter.POST("/token/consume", middleware.TokenAuth(), controller.ConsumeToken)
|
||||
}
|
||||
costRoute := apiRouter.Group("/cost")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user