dashboard.go 433 B

123456789101112131415161718
  1. package router
  2. import (
  3. "github.com/gin-contrib/gzip"
  4. "github.com/gin-gonic/gin"
  5. "one-api/controller"
  6. "one-api/middleware"
  7. )
  8. func SetDashboardRouter(router *gin.Engine) {
  9. apiRouter := router.Group("/dashboard")
  10. apiRouter.Use(gzip.Gzip(gzip.DefaultCompression))
  11. apiRouter.Use(middleware.GlobalAPIRateLimit())
  12. apiRouter.Use(middleware.TokenAuth())
  13. {
  14. apiRouter.GET("/billing/credit_grants", controller.GetTokenStatus)
  15. }
  16. }