feat: 音色管理

This commit is contained in:
Blizzard
2026-04-28 10:16:23 +08:00
parent 5f4f739f16
commit 141424878c
11 changed files with 1148 additions and 387 deletions
+3 -10
View File
@@ -79,8 +79,9 @@ func (a *VoiceApi) GetVoiceOptions(c *gin.Context) {
response.FailWithMsg(err.Error(), c)
return
}
response.OkWithData(list, c)
response.OkWithData(response.ListResult{
List: list,
}, c)
}
// SaveVoice 保存音色
@@ -98,14 +99,6 @@ func (a *VoiceApi) SaveVoice(c *gin.Context) {
response.FailWithMsg("参数错误: "+err.Error(), c)
return
}
// 检查speakerId是否已存在
existing, _ := voiceService.GetVoiceBySpeakerId(req.SpeakerId)
if existing != nil {
response.FailWithMsg("该音色ID已存在", c)
return
}
if err := voiceService.SaveVoice(req); err != nil {
global.Logger.Error("保存音色失败!", zap.Error(err))
response.FailWithMsg(err.Error(), c)