视频会议保存

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

@@ -65,6 +65,22 @@ media_server:
close_retry: 2 # 关闭类接口失败重试次数(指数退避 200/500ms
create_router_retry: 1 # Task 16 NitCreateRouter 在 5xx/网络错误时的额外重试次数(默认 1 次,退避 300ms
# 外部 LLM/STT 配置中心Phase B 语音转文字)
# 仅做只读访问 t_llm_provider/t_llm_model/t_llm_key
# enabled=false 时跳过 MySQL 连接,转写接口将返回 503
llm_source:
enabled: false # 默认关闭,本地开发不连外部 MySQL切换到 true 后必须填齐下方字段
host: localhost
port: 3306
user: root
password: "" # 强烈建议通过 ECHOCHAT_LLM_SOURCE_PASSWORD 环境变量覆盖
dbname: ai_gateway
charset: utf8mb4
parse_time: true
loc: Local
max_idle_conns: 5
max_open_conns: 20
# 会议模块生命周期参数Phase 2e-2 Task 8 会议状态机)
# E2E 测试可通过环境变量 ECHOCHAT_MEETING_HOST_GRACE_SECONDS 等覆盖为更短值以加速触发
meeting:

View File

@@ -57,6 +57,22 @@ media_server:
close_retry: 2
create_router_retry: 1 # Task 16 NitCreateRouter 在 5xx/网络错误时的额外重试次数
# 外部 LLM/STT 配置中心Phase B 语音转文字)
# 仅做只读 t_llm_provider/t_llm_model/t_llm_key
# 通过 ECHOCHAT_LLM_SOURCE_HOST / _USER / _PASSWORD / _DBNAME 在容器中覆盖
llm_source:
enabled: false
host: ""
port: 3306
user: ""
password: ""
dbname: ""
charset: utf8mb4
parse_time: true
loc: Local
max_idle_conns: 5
max_open_conns: 20
# 会议模块生命周期参数Phase 2e-2 Task 8
meeting:
host_grace_seconds: 120

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