feat: 长文本语音合成
This commit is contained in:
@@ -144,3 +144,26 @@ func (a *ProgramApi) DeleteProgram(c *gin.Context) {
|
||||
|
||||
response.OkWithMsg("删除成功", c)
|
||||
}
|
||||
|
||||
// GenerateTTS 生成TTS语音
|
||||
// @Tags 节目管理
|
||||
// @Summary 生成TTS语音
|
||||
// @Produce json
|
||||
// @Param id query string true "节目ID"
|
||||
// @Success 200 {object} response.Response
|
||||
// @Router /radio/program/generate-tts [get]
|
||||
func (a *ProgramApi) GenerateTTS(c *gin.Context) {
|
||||
id := c.Query("id")
|
||||
if id == "" {
|
||||
response.FailWithMsg("参数错误: id不能为空", c)
|
||||
return
|
||||
}
|
||||
|
||||
if err := programService.GenerateTTS(id); err != nil {
|
||||
global.Logger.Error("生成TTS语音失败!", zap.Error(err))
|
||||
response.FailWithMsg(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
response.OkWithMsg("TTS生成成功", c)
|
||||
}
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ func (a *VipApi) UpdateVipConfig(c *gin.Context) {
|
||||
// @Produce application/json
|
||||
// @Param id query string true "id"
|
||||
// @Success 200 {object} response.Response
|
||||
// @Router /vip/config/detail [get]
|
||||
// @Router /vip/config/detail [post]
|
||||
func (a *VipApi) VipConfigDetail(c *gin.Context) {
|
||||
vipConfig, err := vipService.VipConfigDetail()
|
||||
if err != nil {
|
||||
|
||||
@@ -122,7 +122,8 @@ func (a *AuthApi) GetToken(c *gin.Context, user system.User) {
|
||||
// @Router /auth/miniLogin [get]
|
||||
func (a *AuthApi) MiniLogin(c *gin.Context) {
|
||||
jsCode := c.Query("code")
|
||||
user, err := userService.MiniLogin(jsCode)
|
||||
ip := c.ClientIP()
|
||||
user, err := userService.MiniLogin(jsCode, ip)
|
||||
if err != nil {
|
||||
global.Logger.Error("登录失败!", zap.Error(err))
|
||||
response.FailWithMsg("登录失败", c)
|
||||
|
||||
Reference in New Issue
Block a user