|
|
@@ -0,0 +1,37 @@
|
|
|
+package com.telerobot.fs.service;
|
|
|
+
|
|
|
+import com.telerobot.fs.entity.po.CallRound;
|
|
|
+import com.telerobot.fs.utils.CommonUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class CallRoundService {
|
|
|
+ @Resource
|
|
|
+ private JdbcTemplate jdbcTemplate;
|
|
|
+ private final static Logger logger = LoggerFactory.getLogger(CallRoundService.class);
|
|
|
+
|
|
|
+ public void insertCallRound(CallRound callRound) {
|
|
|
+ String sql = "INSERT INTO cc_call_round (id, uuid, round_no, asr_text, llm_text, asr_cost_ms, llm_cost_ms, tts_cost_ms, create_time) " +
|
|
|
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
|
|
+ try {
|
|
|
+ jdbcTemplate.update(sql,
|
|
|
+ callRound.getId(),
|
|
|
+ callRound.getUuid(),
|
|
|
+ callRound.getRoundNo(),
|
|
|
+ callRound.getAsrText(),
|
|
|
+ callRound.getLlmText(),
|
|
|
+ callRound.getAsrCostMs(),
|
|
|
+ callRound.getLlmCostMs(),
|
|
|
+ callRound.getTtsCostMs(),
|
|
|
+ callRound.getCreateTime()
|
|
|
+ );
|
|
|
+ } catch (Throwable e) {
|
|
|
+ logger.error("insertCallRound error: {} {}", e.toString(), CommonUtils.getStackTraceString(e.getStackTrace()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|