Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elleai
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
E
ellehuis-group
backend
elleai
Commits
df9f4bb1
Commit
df9f4bb1
authored
Oct 23, 2024
by
杨翌文
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/feature/20240918_chain' into feature/20240918_chain
parents
91c2614d
4c33983c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
AppExamineService.java
.../breeze/elleai/application/service/AppExamineService.java
+8
-4
CommonController.java
...a/cn/breeze/elleai/controller/admin/CommonController.java
+30
-0
No files found.
src/main/java/cn/breeze/elleai/application/service/AppExamineService.java
View file @
df9f4bb1
...
...
@@ -17,6 +17,7 @@ import cn.hutool.core.lang.Assert;
import
cn.hutool.core.lang.UUID
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
import
com.mybatisflex.core.paginate.Page
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -815,14 +816,15 @@ public class AppExamineService {
PageResult
<
WikiCategoryDto
>
pageResult
=
PageResult
.
of
(
request
.
getPageNo
(),
request
.
getPageSize
(),
(
int
)
page
.
getTotalRow
(),
null
);
List
<
WikiCategoryDto
>
items
=
Lists
.
newArrayList
();
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getRecords
()))
{
List
<
WikiCategoryDto
>
dtoList
=
page
.
getRecords
().
stream
().
map
(
v
->
{
items
=
page
.
getRecords
().
stream
().
map
(
v
->
{
WikiCategoryDto
dto
=
BeanUtil
.
copyProperties
(
v
,
WikiCategoryDto
.
class
);
return
dto
;
}).
collect
(
Collectors
.
toList
());
pageResult
.
setItems
(
dtoList
);
}
pageResult
.
setItems
(
items
);
return
pageResult
;
}
...
...
@@ -1153,6 +1155,7 @@ public class AppExamineService {
// 获取数据库考试信息
Integer
recordId
;
int
answeredNum
=
0
;
ExamineRecordResponseModel
examineRecord
=
examineService
.
examineRecordDetail
(
businessNo
);
if
(
Objects
.
isNull
(
examineRecord
))
{
// 第一次答题,保存考试信息
...
...
@@ -1170,6 +1173,7 @@ public class AppExamineService {
recordId
=
saveModel
.
getId
();
}
else
{
recordId
=
examineRecord
.
getId
();
answeredNum
=
examineRecord
.
getAnsweredNum
();
}
// 获取有无答题记录
...
...
@@ -1179,7 +1183,7 @@ public class AppExamineService {
// 更新答题数量
ExamineRecordSaveModel
saveModel
=
new
ExamineRecordSaveModel
();
saveModel
.
setId
(
recordId
);
saveModel
.
setAnsweredNum
(
examineRecord
.
getAnsweredNum
()
+
1
);
saveModel
.
setAnsweredNum
(
answeredNum
+
1
);
examineService
.
saveExamineRecord
(
saveModel
);
// 保存单题答题信息
...
...
src/main/java/cn/breeze/elleai/controller/admin/CommonController.java
View file @
df9f4bb1
...
...
@@ -13,17 +13,23 @@ import cn.breeze.elleai.application.service.AppCommonService;
import
cn.breeze.elleai.config.QueryParam
;
import
cn.breeze.elleai.exception.InternalException
;
import
cn.breeze.elleai.util.PrivateFileService
;
import
cn.hutool.core.exceptions.ExceptionUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.google.common.collect.Lists
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.servlet.http.Cookie
;
import
jakarta.servlet.http.HttpServletResponse
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.UUID
;
...
...
@@ -39,6 +45,12 @@ public class CommonController {
private
final
PrivateFileService
fileService
;
@Value
(
"${sso.user.mock:true}"
)
private
String
enableMock
;
@Value
(
"${sso.domain:}"
)
private
String
ssoBaseUrl
;
@Operation
(
summary
=
"专有名词详情"
)
@GetMapping
(
"/proper_noun/detail/{id}"
)
...
...
@@ -144,4 +156,22 @@ public class CommonController {
}
return
ApiResponse
.
ok
(
fileList
);
}
@Operation
(
summary
=
"单点登录"
)
@GetMapping
(
"/sso"
)
public
void
userSSOLogin
(
@RequestParam
(
"jwt"
)
String
token
,
HttpServletResponse
response
)
{
if
(
StrUtil
.
isNotBlank
(
token
))
{
log
.
info
(
"单点登录:{}"
,
token
);
try
{
Cookie
jwt
=
new
Cookie
(
"jwt"
,
token
);
jwt
.
setPath
(
"/"
);
jwt
.
setHttpOnly
(
true
);
response
.
addCookie
(
jwt
);
response
.
sendRedirect
(
ssoBaseUrl
+
"/elle-ai/1.0.0/index.html"
);
}
catch
(
IOException
e
)
{
log
.
error
(
"单点登录异常{}"
,
ExceptionUtil
.
getMessage
(
e
));
}
}
}
}
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