group.go 348 B

12345678910111213141516171819
  1. package controller
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "net/http"
  5. "one-api/common"
  6. )
  7. func GetGroups(c *gin.Context) {
  8. groupNames := make([]string, 0)
  9. for groupName, _ := range common.GroupRatio {
  10. groupNames = append(groupNames, groupName)
  11. }
  12. c.JSON(http.StatusOK, gin.H{
  13. "success": true,
  14. "message": "",
  15. "data": groupNames,
  16. })
  17. }