refactor: 调整渠道注册机制

This commit is contained in:
tbphp
2025-07-05 08:51:37 +08:00
parent 40f59524f0
commit 92e4a53659
3 changed files with 40 additions and 9 deletions

View File

@@ -10,11 +10,15 @@ import (
"github.com/gin-gonic/gin/binding"
)
func init() {
Register("openai", newOpenAIChannel)
}
type OpenAIChannel struct {
*BaseChannel
}
func (f *Factory) NewOpenAIChannel(group *models.Group) (*OpenAIChannel, error) {
func newOpenAIChannel(f *Factory, group *models.Group) (ChannelProxy, error) {
base, err := f.newBaseChannel("openai", group.Upstreams, group.Config)
if err != nil {
return nil, err