文字转语音

This commit is contained in:
spllzh
2025-10-04 19:52:06 +08:00
parent 24c00c22ab
commit 06730b656e
51 changed files with 5157 additions and 8 deletions

View File

@@ -0,0 +1,44 @@
package com.rj.service.impl;
import com.rj.entity.TtsRequestLog;
import com.rj.mapper.TtsRequestLogMapper;
import com.rj.service.ITtsRequestLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* TTS请求日志服务实现类
*
* @author rj
* @date 2025-01-02
*/
@Slf4j
@Service
public class TtsRequestLogServiceImpl implements ITtsRequestLogService {
@Autowired
private TtsRequestLogMapper ttsRequestLogMapper;
@Override
public boolean saveTtsRequestLog(TtsRequestLog requestLog) {
try {
int result = ttsRequestLogMapper.insert(requestLog);
log.info("TTS请求日志保存成功: {}", requestLog.getId());
return result > 0;
} catch (Exception e) {
log.error("TTS请求日志保存失败: {}", e.getMessage(), e);
return false;
}
}
@Override
public TtsRequestLog getTtsRequestLogById(String id) {
try {
return ttsRequestLogMapper.selectById(id);
} catch (Exception e) {
log.error("查询TTS请求日志失败: {}", e.getMessage(), e);
return null;
}
}
}