简历业务逻辑完善

This commit is contained in:
2025-11-08 11:52:59 +08:00
parent 61d959e6b8
commit f38d157581
9 changed files with 186 additions and 53 deletions

View File

@@ -37,11 +37,6 @@ import java.util.concurrent.ConcurrentHashMap;
@Component
public class ChatWebSocketHandler {
/**
* 追问问题标记
*/
private final String QUESTION_FLAG = "FOLLOW-UP:";
/**
* 评分标记
*/
@@ -180,16 +175,16 @@ public class ChatWebSocketHandler {
Boolean isEndFlag = getInterviewScore(clientId,promptJson, session, "");
if(isEndFlag){
log.info("面试回答符合条件规则,继续追问啦!!!!!");
final int[] resultNum = {(int) (Math.random() * 2) + 1};
aiStreamClient.streamChat(promptJson, new OpenAiStreamListenerService() {
int resultNum = (int) (Math.random() * 2) + 1;
@Override
public void onMessage(String content) {
log.info("返回AI结果{}", content.replaceAll("\n", ""));
//获取1和2的随机数
if(resultNum == 1){
if(resultNum[0] == 1){
content = "";
}
resultNum = resultNum+1;
resultNum[0] = resultNum[0] +1;
log.info("提问的问题:{}",content);
// String contentData = content.replaceAll("\n", "");
//返回是追问的问题
@@ -441,7 +436,7 @@ public class ChatWebSocketHandler {
resultEntity.put("type", "score");
try{
//返回评分语音
sendTTSBuffer(clientId,resultMsg,session);
// sendTTSBuffer(clientId,resultMsg,session);
//返回最终的评分结构
log.info("返回最终的评分结构:{}",JSONUtil.toJsonStr(resultEntity));
@@ -556,7 +551,7 @@ public class ChatWebSocketHandler {
sendVoiceBuffer(openingPathUrl, session);
//返回评分语音
sendTTSBuffer(clientId,scoreText,session);
// sendTTSBuffer(clientId,scoreText,session);
Map<String, String> resultEntity = new HashMap<>();
resultEntity.put("content", scoreText);

View File

@@ -44,7 +44,7 @@ token:
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟
expireTime: 30
expireTime: 2400
# MyBatis配置
mybatis: