Commit 68397d25 authored by 陈立彬's avatar 陈立彬

获取当前题目评分结果

parent 462d808b
......@@ -10,12 +10,14 @@ import cn.aibreeze.exam.mapper.ElehKnowledgeTagMapper;
import cn.aibreeze.exam.mapper.ElehSessionQaRecordMapper;
import cn.aibreeze.exam.util.AliyunNLSFacade;
import cn.aibreeze.exam.util.ExamConstants;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.micrometer.common.util.StringUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
......@@ -52,6 +54,8 @@ public class ExamController {
private static String EXAM_REDIS_SESSION_KEY = "EXAM_MASTER_SESSION:%d:%s";
private static String EXAM_REDIS_CAS_KEY = "EXAM_MASTER_CURRENT_AI_SCORE:%d:%s";
private static String USER_SESSION_CONTEXT_KEY = "USER_SESSION_CONTEXT:%d:%s:%s";
private static String USER_SESSION_CONTEXT_COUNT = "USER_SESSION_CONTEXT_COUNT";
......@@ -356,4 +360,21 @@ public class ExamController {
return ApiResponse.ok("SUCCESS");
}
@GetMapping(value = "/get_current_ai_score_info")
public ApiResponse<SingleQaResult> getCurrentAiScoreInfo(@RequestParam("tenant") Integer tenant,
@RequestParam("session_id") String sessionId,
@RequestParam("user_id") String userId,
@RequestParam("question_id") Long questionId) {
SingleQaResult singleQaResult = new SingleQaResult();
ElehSessionQaRecordDo recordDo = qaRecordMapper.selectQaRecord(tenant, sessionId, userId, questionId);
if(Objects.nonNull(recordDo)) {
singleQaResult = BeanUtil.copyProperties(recordDo, SingleQaResult.class);
}
return ApiResponse.ok(singleQaResult);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment