You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
2.4 KiB
39 lines
2.4 KiB
package console
|
|
|
|
// 第三方服务配置(svcconfig) 与 通话翻译配置(calltranslate) 的本地数据模型。
|
|
//
|
|
// yunyan-sas 的 pb 没有这些定义且禁止改 proto,故在 console 模块用本地 Go struct + gorm/json tag 定义。
|
|
// 字段移植自 deep_server 的 db.proto(DBThirdSvcConfig / ThirdSvcFieldItem / DBThirdSvcRegionOverride /
|
|
// DBCallTranslatePair),并与 admin 前端(serviceconfig.vue / calltranslate.vue) 的 JSON 契约精确对齐。
|
|
//
|
|
// 嵌套字段([]SvcField / map[string]string)借助 gorm `serializer:json` tag 存为 jsonb 列,
|
|
// gorm v1.26 AutoMigrate + 读写自动 Marshal/Unmarshal,无需手动处理。
|
|
// region / mode 直接用 int32(与前端 JSON 一致),不依赖 pb 的 Region/TranslateMode 枚举。
|
|
|
|
import "yunyan/comm"
|
|
|
|
// SvcField / ThirdSvcConfig / SvcRegionOverride 结构已下沉到 comm/svcpool.go(业务服务运行时
|
|
// 也要直读消费,如 echomeet 编排),console 侧用 type alias 引用,包内代码零改动。
|
|
type SvcField = comm.SvcField
|
|
type ThirdSvcConfig = comm.ThirdSvcConfig
|
|
type SvcRegionOverride = comm.SvcRegionOverride
|
|
|
|
// CallTranslatePair 通话翻译语言对配置(表:call_translate_pair)。
|
|
// 每条记录定义一个区域下"源语言→目标语言"的翻译服务编排。
|
|
// mode=0 走三段式(asr/mt/tts_svc_id 有效);mode=1 走端到端(ast_svc_id 有效)。
|
|
// bidir=true 时业务侧自动映射反向(dst→src),复用同一套服务。
|
|
type CallTranslatePair struct {
|
|
Id uint64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
|
Region int32 `gorm:"column:region;uniqueIndex:uidx_region_lang" json:"region"`
|
|
SrcLang string `gorm:"column:src_lang;size:16;uniqueIndex:uidx_region_lang" json:"src_lang"`
|
|
DstLang string `gorm:"column:dst_lang;size:16;uniqueIndex:uidx_region_lang" json:"dst_lang"`
|
|
Bidir bool `gorm:"column:bidir" json:"bidir"`
|
|
Mode int32 `gorm:"column:mode" json:"mode"`
|
|
AsrSvcId string `gorm:"column:asr_svc_id;size:64" json:"asr_svc_id"`
|
|
MtSvcId string `gorm:"column:mt_svc_id;size:64" json:"mt_svc_id"`
|
|
TtsSvcId string `gorm:"column:tts_svc_id;size:64" json:"tts_svc_id"`
|
|
AstSvcId string `gorm:"column:ast_svc_id;size:64" json:"ast_svc_id"`
|
|
Enable bool `gorm:"column:enable" json:"enable"`
|
|
Createtime int64 `gorm:"column:createtime" json:"createtime"`
|
|
Updatetime int64 `gorm:"column:updatetime" json:"updatetime"`
|
|
}
|
|
|