Commit 172f9604 authored by 陈立彬's avatar 陈立彬

log

parent 125cfeeb
......@@ -12,6 +12,7 @@ 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.data.redis.core.StringRedisTemplate;
import org.springframework.util.CollectionUtils;
......@@ -25,6 +26,7 @@ import java.util.stream.Collectors;
@RestController
@Slf4j
@RequestMapping(value = "/exam")
@RequiredArgsConstructor
public class ExamController {
......@@ -60,6 +62,8 @@ public class ExamController {
String redisKey = String.format(EXAM_REDIS_SESSION_KEY, tenant, sessionId, userId);
String currentQuestion = redisTemplate.opsForValue().get(redisKey);
log.info("获取当前出题,rediskey = {}, value = {}", redisKey, currentQuestion);
if(StringUtils.isNotEmpty(currentQuestion)) {
ElehKnowledgeDo knowledgeDo = knowledgeMapper.selectById(Long.valueOf(currentQuestion));
if(Objects.nonNull(knowledgeDo)) {
......@@ -102,6 +106,8 @@ public class ExamController {
// 存储当前会话考试信息
String redisKey = String.format(EXAM_REDIS_SESSION_KEY, tenant, sessionId, userId);
redisTemplate.opsForValue().set(redisKey, result.getQuestionId()+"", 10, TimeUnit.MINUTES);
log.info("出题结果:result = {}, rediskey = {}", JSONObject.toJSONString(result), redisKey);
}
}
......
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