视频会议保存

This commit is contained in:
duoaohui
2026-05-18 21:23:00 +08:00
parent fb965cc8c4
commit 5a5706c236
20 changed files with 1211 additions and 1 deletions

View File

@@ -19,6 +19,55 @@ type Config struct {
Minio MinioConfig `mapstructure:"minio"`
MediaServer MediaServerConfig `mapstructure:"media_server"`
Meeting MeetingConfig `mapstructure:"meeting"`
LLMSource LLMSourceConfig `mapstructure:"llm_source"` // Phase B外部 LLM 配置库MySQLt_llm_provider/model/key
}
// LLMSourceConfig 外部 LLM/STT 配置中心 MySQL 连接
//
// 该库与本服务的 PostgreSQL 主库相互独立,仅做只读:
// - t_llm_provider 提供商列表base_url / api_protocol
// - t_llm_model 模型列表model_type=4 表示语音识别)
// - t_llm_key Key 池(按 weight DESC + today_count ASC 选 key
//
// Enabled=false 时跳过初始化,转写功能会以 "未配置 STT 服务" 返回 503
// 方便在没有外部 MySQL 的开发环境只跑会议管理只读视图。
type LLMSourceConfig struct {
Enabled bool `mapstructure:"enabled"` // false=跳过连接,转写不可用
Host string `mapstructure:"host"` // MySQL host
Port int `mapstructure:"port"` // MySQL port默认 3306
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
DBName string `mapstructure:"dbname"`
Charset string `mapstructure:"charset"` // 默认 utf8mb4
ParseTime bool `mapstructure:"parse_time"` // 默认 true
Loc string `mapstructure:"loc"` // 默认 Local
MaxIdleConns int `mapstructure:"max_idle_conns"`
MaxOpenConns int `mapstructure:"max_open_conns"`
}
// DSN 生成 MySQL DSN
// charset/parse_time/loc 缺省时填充常见安全默认值
func (l *LLMSourceConfig) DSN() string {
charset := l.Charset
if charset == "" {
charset = "utf8mb4"
}
loc := l.Loc
if loc == "" {
loc = "Local"
}
parseTime := "True"
if !l.ParseTime {
parseTime = "False"
}
port := l.Port
if port == 0 {
port = 3306
}
return fmt.Sprintf(
"%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=%s&loc=%s",
l.User, l.Password, l.Host, port, l.DBName, charset, parseTime, loc,
)
}
// MeetingConfig 会议模块生命周期参数Phase 2e-2 Task 8