mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-18 01:26:37 +08:00
- Added required packages to go.mod: `github.com/Laisky/errors/v2 v2.0.1`, `github.com/stretchr/testify v1.8.3`, `github.com/davecgh/go-spew v1.1.1`, `github.com/pmezard/go-difflib v1.0.0` - Increased the number of returned recordings to 100 in `relay-utils.go` - Refactored and simplified code in `relay-aiproxy.go` for improved message retrieval and error handling - Added new test file `relay_test.go` and various test cases for different message types - Modified functions in `group.go` and `relay.go` for improved functionality
20 lines
345 B
Go
20 lines
345 B
Go
package controller
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"net/http"
|
|
"one-api/common"
|
|
)
|
|
|
|
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,
|
|
})
|
|
}
|