|
|
@@ -4,6 +4,7 @@ import (
|
|
|
"encoding/json"
|
|
|
"gorm.io/gorm"
|
|
|
"one-api/common"
|
|
|
+ "strings"
|
|
|
)
|
|
|
|
|
|
type Channel struct {
|
|
|
@@ -33,6 +34,13 @@ type Channel struct {
|
|
|
OtherInfo string `json:"other_info"`
|
|
|
}
|
|
|
|
|
|
+func (channel *Channel) GetModels() []string {
|
|
|
+ if channel.Models == "" {
|
|
|
+ return []string{}
|
|
|
+ }
|
|
|
+ return strings.Split(strings.Trim(channel.Models, ","), ",")
|
|
|
+}
|
|
|
+
|
|
|
func (channel *Channel) GetOtherInfo() map[string]interface{} {
|
|
|
otherInfo := make(map[string]interface{})
|
|
|
if channel.OtherInfo != "" {
|