usedata.go 382 B

123456789101112131415161718192021222324
  1. package controller
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "net/http"
  5. "one-api/model"
  6. )
  7. func GetAllQuotaDates(c *gin.Context) {
  8. dates, err := model.GetAllQuotaDates()
  9. if err != nil {
  10. c.JSON(http.StatusOK, gin.H{
  11. "success": false,
  12. "message": err.Error(),
  13. })
  14. return
  15. }
  16. c.JSON(http.StatusOK, gin.H{
  17. "success": true,
  18. "message": "",
  19. "data": dates,
  20. })
  21. return
  22. }