Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
poc
poc-api
Commits
a406ab1b
Commit
a406ab1b
authored
Aug 22, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:智能出题
parent
101a5b4f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
ExaminationServiceImpl.java
...om/poc/writing/aggregate/impl/ExaminationServiceImpl.java
+4
-4
ExaminationRestImpl.java
...ava/cn/com/poc/writing/rest/impl/ExaminationRestImpl.java
+2
-1
No files found.
src/main/java/cn/com/poc/writing/aggregate/impl/ExaminationServiceImpl.java
View file @
a406ab1b
...
@@ -101,9 +101,9 @@ public class ExaminationServiceImpl implements ExaminationService {
...
@@ -101,9 +101,9 @@ public class ExaminationServiceImpl implements ExaminationService {
largeModelResponse
.
setMessages
(
messages
);
largeModelResponse
.
setMessages
(
messages
);
largeModelResponse
.
setStream
(
true
);
largeModelResponse
.
setStream
(
true
);
largeModelResponse
.
setMaxTokens
(
32768
);
largeModelResponse
.
setMaxTokens
(
32768
);
largeModelResponse
.
setThinking
(
new
Thinking
()
{{
//
largeModelResponse.setThinking(new Thinking() {{
setType
(
"disabled"
);
//
setType("disabled");
}});
//
}});
largeModelResponse
.
setUser
(
"GENERATE_EXAMINATION"
);
largeModelResponse
.
setUser
(
"GENERATE_EXAMINATION"
);
try
{
try
{
...
@@ -343,7 +343,7 @@ public class ExaminationServiceImpl implements ExaminationService {
...
@@ -343,7 +343,7 @@ public class ExaminationServiceImpl implements ExaminationService {
}
}
String
content
=
prompt
.
replace
(
"${file_content}"
,
fileContent
)
String
content
=
prompt
.
replace
(
"${file_content}"
,
fileContent
)
.
replace
(
"${content}"
,
generateExaminationEntity
.
getContent
())
.
replace
(
"${content}"
,
StringUtils
.
isBlank
(
generateExaminationEntity
.
getContent
())
&&
StringUtils
.
isBlank
(
fileContent
)
?
generateExaminationEntity
.
getTitle
()
:
generateExaminationEntity
.
getContent
())
.
replace
(
"${number}"
,
generateExaminationEntity
.
getN
().
toString
())
.
replace
(
"${number}"
,
generateExaminationEntity
.
getN
().
toString
())
.
replace
(
"${total_score}"
,
generateExaminationEntity
.
getTotalScore
().
toString
())
.
replace
(
"${total_score}"
,
generateExaminationEntity
.
getTotalScore
().
toString
())
.
replace
(
"${level}"
,
generateExaminationEntity
.
getLevel
())
.
replace
(
"${level}"
,
generateExaminationEntity
.
getLevel
())
...
...
src/main/java/cn/com/poc/writing/rest/impl/ExaminationRestImpl.java
View file @
a406ab1b
...
@@ -51,7 +51,8 @@ public class ExaminationRestImpl implements ExaminationRest {
...
@@ -51,7 +51,8 @@ public class ExaminationRestImpl implements ExaminationRest {
// Assert.notBlank(generateExaminationDto.getPositions());
// Assert.notBlank(generateExaminationDto.getPositions());
Assert
.
notEmpty
(
generateExaminationDto
.
getQuestionType
());
Assert
.
notEmpty
(
generateExaminationDto
.
getQuestionType
());
Assert
.
notNull
(
generateExaminationDto
.
getN
());
Assert
.
notNull
(
generateExaminationDto
.
getN
());
Assert
.
isTrue
(
generateExaminationDto
.
getN
()
<=
20
,
"总题数不可大于20题"
);
Assert
.
isTrue
(
generateExaminationDto
.
getN
()
<=
20
,
"总题数不可大于20题"
);
Assert
.
isTrue
(
generateExaminationDto
.
getN
()
<=
generateExaminationDto
.
getTotalScore
()
,
"总题数不可大于总分数"
);
UserBaseEntity
currentUser
=
BlContext
.
getCurrentUser
();
UserBaseEntity
currentUser
=
BlContext
.
getCurrentUser
();
GenerateExaminationEntity
generateExaminationEntity
=
new
GenerateExaminationEntity
();
GenerateExaminationEntity
generateExaminationEntity
=
new
GenerateExaminationEntity
();
...
...
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