Commit fb776143 authored by 陈立彬's avatar 陈立彬

考试评分异步流程

parent 5d0fa2fb
...@@ -254,7 +254,11 @@ public class ExamController { ...@@ -254,7 +254,11 @@ public class ExamController {
String redisValue = redisTemplate.opsForValue().get(redisKey); String redisValue = redisTemplate.opsForValue().get(redisKey);
if(StringUtils.isNotEmpty(redisValue)) { if(StringUtils.isNotEmpty(redisValue)) {
return ApiResponse.ok(JSONObject.parseObject(redisValue, SingleQaResult.class)); SingleQaResult singleQaResult = JSONObject.parseObject(redisValue, SingleQaResult.class);
// 获取当天考题
String questionRedisKey = String.format(EXAM_REDIS_QUESTION_KEY, tenant, sessionId, userId);
singleQaResult.setQuestionId(Long.valueOf(redisTemplate.opsForValue().get(questionRedisKey)));
return ApiResponse.ok(singleQaResult);
} }
return ApiResponse.fail("no cache data."); return ApiResponse.fail("no cache data.");
} }
......
...@@ -31,4 +31,7 @@ public class SingleQaResult implements Serializable { ...@@ -31,4 +31,7 @@ public class SingleQaResult implements Serializable {
@JsonProperty("scene") @JsonProperty("scene")
private String scene; private String scene;
@JsonProperty("question_id")
private Long questionId;
} }
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