Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
exam_master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
exam_master
Commits
b535a7fc
Commit
b535a7fc
authored
Oct 10, 2024
by
陈立彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加新接口
parent
d6442497
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
0 deletions
+73
-0
ExamController.java
src/main/java/cn/aibreeze/exam/api/ExamController.java
+39
-0
Run4ScoreRequestDto.java
src/main/java/cn/aibreeze/exam/dto/Run4ScoreRequestDto.java
+34
-0
No files found.
src/main/java/cn/aibreeze/exam/api/ExamController.java
View file @
b535a7fc
...
@@ -275,6 +275,45 @@ public class ExamController {
...
@@ -275,6 +275,45 @@ public class ExamController {
return
ApiResponse
.
ok
(
"ok"
);
return
ApiResponse
.
ok
(
"ok"
);
}
}
@PostMapping
(
value
=
"/run4score_v2"
)
public
ApiResponse
<
String
>
run4ScoreV2
(
@RequestBody
Run4ScoreRequestDto
requestDto
)
{
String
scene
=
requestDto
.
getScene
();
Integer
tenant
=
requestDto
.
getTenant
();
String
answer
=
requestDto
.
getAnswer
();
String
userAnswer
=
requestDto
.
getUserAnswer
();
String
question
=
requestDto
.
getQuestion
();
String
userId
=
requestDto
.
getUserId
();
String
sessionId
=
requestDto
.
getSessionId
();
Long
questionId
=
requestDto
.
getQuestionId
();
String
redisKey
=
String
.
format
(
EXAM_REDIS_SESSION_KEY
,
tenant
,
userId
);
SingleQaResult
qa
=
new
SingleQaResult
();
qa
.
setUserId
(
userId
);
qa
.
setSessionId
(
sessionId
);
qa
.
setUserAnswer
(
userAnswer
);
qa
.
setQuestion
(
question
);
qa
.
setAnswer
(
answer
);
qa
.
setScene
(
scene
);
qa
.
setQuestionId
(
questionId
);
// 更新之前考试过的题目
ElehSessionQaRecordDo
recordDo
=
qaRecordMapper
.
selectQaRecord
(
tenant
,
sessionId
,
userId
,
questionId
);
if
(
Objects
.
nonNull
(
recordDo
))
{
qaRecordMapper
.
clearById
(
recordDo
.
getId
());
}
log
.
info
(
"PUT V2 REDIS KEY = {}, REDIS VALUE = {}"
,
redisKey
,
JSONObject
.
toJSONString
(
qa
));
redisTemplate
.
opsForValue
().
set
(
redisKey
,
JSONObject
.
toJSONString
(
qa
),
30
,
TimeUnit
.
MINUTES
);
examAppFacade
.
run4Score
(
scene
,
sessionId
,
userId
,
question
,
answer
,
userAnswer
);
return
ApiResponse
.
ok
(
"ok"
);
}
@GetMapping
(
value
=
"/get_run4score_info"
)
@GetMapping
(
value
=
"/get_run4score_info"
)
public
ApiResponse
<
SingleQaResult
>
getRun4ScoreInfo
(
@RequestParam
(
value
=
"tenant"
)
Integer
tenant
,
public
ApiResponse
<
SingleQaResult
>
getRun4ScoreInfo
(
@RequestParam
(
value
=
"tenant"
)
Integer
tenant
,
@RequestParam
(
value
=
"user_id"
)
String
userId
)
{
@RequestParam
(
value
=
"user_id"
)
String
userId
)
{
...
...
src/main/java/cn/aibreeze/exam/dto/Run4ScoreRequestDto.java
0 → 100644
View file @
b535a7fc
package
cn
.
aibreeze
.
exam
.
dto
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
Run4ScoreRequestDto
implements
Serializable
{
@JsonProperty
(
"tenant"
)
private
Integer
tenant
;
@JsonProperty
(
"scene"
)
private
String
scene
;
@JsonProperty
(
"session_id"
)
private
String
sessionId
;
@JsonProperty
(
"user_id"
)
private
String
userId
;
@JsonProperty
(
"question"
)
private
String
question
;
@JsonProperty
(
"answer"
)
private
String
answer
;
@JsonProperty
(
"question_id"
)
private
Long
questionId
;
@JsonProperty
(
"user_answer"
)
private
String
userAnswer
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment