feat: 音色管理
This commit is contained in:
+3
-10
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user