feat(channel): enhance AddChannel functionality with structured request handling

This commit is contained in:
CaIon
2025-06-16 00:37:22 +08:00
parent d2b47969da
commit 0089157b83
3 changed files with 94 additions and 24 deletions

View File

@@ -9,6 +9,11 @@ import (
"gorm.io/gorm"
)
type ChannelInfo struct {
MultiKeyMode bool `json:"multi_key_mode"` // 是否多Key模式
MultiKeyStatusList map[int]int `json:"multi_key_status_list"` // key状态列表key index -> status
}
type Channel struct {
Id int `json:"id"`
Type int `json:"type" gorm:"default:0"`
@@ -35,8 +40,10 @@ type Channel struct {
AutoBan *int `json:"auto_ban" gorm:"default:1"`
OtherInfo string `json:"other_info"`
Tag *string `json:"tag" gorm:"index"`
Setting *string `json:"setting" gorm:"type:text"`
Setting *string `json:"setting" gorm:"type:text"` // 渠道额外设置
ParamOverride *string `json:"param_override" gorm:"type:text"`
// add after v0.8.5
ChannelInfo ChannelInfo `json:"channel_info" gorm:"type:json"`
}
func (channel *Channel) GetModels() []string {

View File

@@ -48,7 +48,7 @@ func initCol() {
}
}
// log sql type and database type
common.SysLog("Using Log SQL Type: " + common.LogSqlType)
//common.SysLog("Using Log SQL Type: " + common.LogSqlType)
}
var DB *gorm.DB