package com.sonic.cow.controller.api;

import com.sonic.common.rpc.Result;
import com.sonic.cow.domain.input.CheckImageIsAIGeneratedInput;
import com.sonic.cow.domain.input.VoiceTtsV2Input;
import com.sonic.cow.service.GenImageTaskRecordService;
import com.sonic.cow.service.VoiceService;
import com.sonic.sdk.api.annotation.IgnoreAuth;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 语音接口
 *
 * @author code
 */
@RestController
@Slf4j
public class VoiceApi {

    @Autowired
    private VoiceService voiceService;

    @IgnoreAuth
    @ApiOperation(value = "文本生成语音", tags = {"API-接口"})
    @PostMapping("/api/tts")
    public Result<String> tts(@RequestBody VoiceTtsV2Input input) {
        return Result.success(voiceService.tts(input.getUserId(), input));
    }

}

