- Improved error handling in various modules for better stability and responsiveness. - Optimized code in several files for improved efficiency and readability. - Enhanced user experience by providing more detailed error responses in the controller. - Strengthened security by ignoring sensitive files in `.gitignore`.
20 lines
369 B
Go
20 lines
369 B
Go
package controller
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/songquanpeng/one-api/common"
|
|
"net/http"
|
|
)
|
|
|
|
func GetGroups(c *gin.Context) {
|
|
groupNames := make([]string, 0)
|
|
for groupName := range common.GroupRatio {
|
|
groupNames = append(groupNames, groupName)
|
|
}
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"success": true,
|
|
"message": "",
|
|
"data": groupNames,
|
|
})
|
|
}
|