Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-web
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
cloud-web
Commits
5cd8cc59
Commit
5cd8cc59
authored
Apr 23, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4.21bug优化
parent
ae32813a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
12 deletions
+30
-12
cloud-web-student/src/main/java/com/yizhi/application/caseLibrary/controller/StudyCaseController.java
+10
-6
cloud-web-student/src/main/java/com/yizhi/application/enroll/controller/EnrollApiController.java
+6
-2
cloud-web-student/src/main/java/com/yizhi/application/exam/controller/ExamApiController.java
+7
-2
cloud-web-student/src/main/java/com/yizhi/application/exam/controller/MyExamController.java
+7
-2
No files found.
cloud-web-student/src/main/java/com/yizhi/application/caseLibrary/controller/StudyCaseController.java
View file @
5cd8cc59
package
com
.
yizhi
.
application
.
caseLibrary
.
controller
;
package
com
.
yizhi
.
application
.
caseLibrary
.
controller
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.core.application.cache.RedisCache
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.library.application.feign.StudyCaseClient
;
import
com.yizhi.library.application.feign.StudyCaseClient
;
...
@@ -23,6 +24,7 @@ import org.slf4j.LoggerFactory;
...
@@ -23,6 +24,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -48,10 +50,12 @@ public class StudyCaseController {
...
@@ -48,10 +50,12 @@ public class StudyCaseController {
InformationStudentFeignClients
informationStudentFeignClients
;
InformationStudentFeignClients
informationStudentFeignClients
;
@Autowired
@Autowired
private
InformationManageFeignClients
informationManageFeignClients
;
private
InformationManageFeignClients
informationManageFeignClients
;
@Autowired
private
RedisCache
redisCache
;
@ApiOperation
(
value
=
"学习案例点赞"
,
notes
=
"学习案例点赞"
)
@ApiOperation
(
value
=
"学习案例点赞"
,
notes
=
"学习案例点赞"
)
@GetMapping
(
"/admire"
)
@GetMapping
(
"/admire"
)
public
Response
<
Object
>
admireStudentCase
(
@ApiParam
(
value
=
"学员案例id"
,
required
=
true
)
@RequestParam
(
name
=
"studentCaseId"
,
required
=
true
)
Long
studentCaseId
)
{
public
Response
<
Object
>
admireStudentCase
(
HttpServletRequest
request
,
@ApiParam
(
value
=
"学员案例id"
,
required
=
true
)
@RequestParam
(
name
=
"studentCaseId"
,
required
=
true
)
Long
studentCaseId
)
{
try
{
try
{
if
(
studyCaseClient
.
admireStudentCase
(
studentCaseId
))
{
if
(
studyCaseClient
.
admireStudentCase
(
studentCaseId
))
{
...
@@ -61,7 +65,7 @@ public class StudyCaseController {
...
@@ -61,7 +65,7 @@ public class StudyCaseController {
idOneVO
.
setContext
(
context
);
idOneVO
.
setContext
(
context
);
InformationViewVO
viewVO
=
informationStudentFeignClients
.
getInformation
(
idOneVO
);
InformationViewVO
viewVO
=
informationStudentFeignClients
.
getInformation
(
idOneVO
);
// 添加点赞埋点
// 添加点赞埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(),
2
)&&
viewVO
!=
null
&&
viewVO
.
getTypeOne
()!=
null
){
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)
){
eventTrackApiClients
.
addEvent
(
"event_admire_"
+
viewVO
.
getTypeOne
(),
studentCaseId
);
eventTrackApiClients
.
addEvent
(
"event_admire_"
+
viewVO
.
getTypeOne
(),
studentCaseId
);
}
}
return
Response
.
ok
();
return
Response
.
ok
();
...
@@ -101,7 +105,7 @@ public class StudyCaseController {
...
@@ -101,7 +105,7 @@ public class StudyCaseController {
@ApiOperation
(
value
=
"学习案例收藏"
,
notes
=
"学习案例收藏"
)
@ApiOperation
(
value
=
"学习案例收藏"
,
notes
=
"学习案例收藏"
)
@GetMapping
(
"/favorite"
)
@GetMapping
(
"/favorite"
)
public
Response
<
Object
>
favorite
(
@ApiParam
(
value
=
"学员案例id"
,
required
=
true
)
@RequestParam
(
name
=
"studentCaseId"
,
required
=
true
)
Long
studentCaseId
)
{
public
Response
<
Object
>
favorite
(
HttpServletRequest
request
,
@ApiParam
(
value
=
"学员案例id"
,
required
=
true
)
@RequestParam
(
name
=
"studentCaseId"
,
required
=
true
)
Long
studentCaseId
)
{
try
{
try
{
if
(
studyCaseClient
.
favorite
(
studentCaseId
))
{
if
(
studyCaseClient
.
favorite
(
studentCaseId
))
{
...
@@ -111,7 +115,7 @@ public class StudyCaseController {
...
@@ -111,7 +115,7 @@ public class StudyCaseController {
idOneVO
.
setContext
(
context
);
idOneVO
.
setContext
(
context
);
InformationViewVO
viewVO
=
informationStudentFeignClients
.
getInformation
(
idOneVO
);
InformationViewVO
viewVO
=
informationStudentFeignClients
.
getInformation
(
idOneVO
);
// 添加点赞埋点
// 添加点赞埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(),
2
)&&
viewVO
!=
null
&&
viewVO
.
getTypeOne
()!=
null
){
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)
){
eventTrackApiClients
.
addEvent
(
"event_favorite_"
+
viewVO
.
getTypeOne
(),
studentCaseId
);
eventTrackApiClients
.
addEvent
(
"event_favorite_"
+
viewVO
.
getTypeOne
(),
studentCaseId
);
}
}
return
Response
.
ok
();
return
Response
.
ok
();
...
@@ -194,7 +198,7 @@ public class StudyCaseController {
...
@@ -194,7 +198,7 @@ public class StudyCaseController {
@ApiOperation
(
value
=
"评论点赞"
,
notes
=
"评论点赞"
)
@ApiOperation
(
value
=
"评论点赞"
,
notes
=
"评论点赞"
)
@GetMapping
(
"/comment/admire"
)
@GetMapping
(
"/comment/admire"
)
public
Response
<
Object
>
admireComment
(
@ApiParam
(
value
=
"评论id"
,
required
=
true
)
@RequestParam
(
name
=
"commentId"
,
required
=
true
)
Long
commentId
)
{
public
Response
<
Object
>
admireComment
(
HttpServletRequest
request
,
@ApiParam
(
value
=
"评论id"
,
required
=
true
)
@RequestParam
(
name
=
"commentId"
,
required
=
true
)
Long
commentId
)
{
try
{
try
{
if
(
studyCaseClient
.
admireComment
(
commentId
))
{
if
(
studyCaseClient
.
admireComment
(
commentId
))
{
...
@@ -204,7 +208,7 @@ public class StudyCaseController {
...
@@ -204,7 +208,7 @@ public class StudyCaseController {
idOneVO
.
setContext
(
context
);
idOneVO
.
setContext
(
context
);
InformationViewVO
viewVO
=
informationStudentFeignClients
.
getInformation
(
idOneVO
);
InformationViewVO
viewVO
=
informationStudentFeignClients
.
getInformation
(
idOneVO
);
// 添加点赞埋点
// 添加点赞埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(),
2
)&&
viewVO
!=
null
&&
viewVO
.
getTypeOne
()!=
null
){
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)
){
eventTrackApiClients
.
addEvent
(
"event_admire_"
+
viewVO
.
getTypeOne
(),
commentId
);
eventTrackApiClients
.
addEvent
(
"event_admire_"
+
viewVO
.
getTypeOne
(),
commentId
);
}
}
return
Response
.
ok
();
return
Response
.
ok
();
...
...
cloud-web-student/src/main/java/com/yizhi/application/enroll/controller/EnrollApiController.java
View file @
5cd8cc59
package
com
.
yizhi
.
application
.
enroll
.
controller
;
package
com
.
yizhi
.
application
.
enroll
.
controller
;
import
com.yizhi.core.application.cache.RedisCache
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.enroll.application.feign.EnrollFeignClient
;
import
com.yizhi.enroll.application.feign.EnrollFeignClient
;
...
@@ -23,6 +24,7 @@ import io.swagger.annotations.ApiImplicitParam;
...
@@ -23,6 +24,7 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Objects
;
import
java.util.Objects
;
@Api
(
tags
=
"学员端接口"
,
description
=
"学员端接口"
)
@Api
(
tags
=
"学员端接口"
,
description
=
"学员端接口"
)
...
@@ -43,13 +45,15 @@ public class EnrollApiController {
...
@@ -43,13 +45,15 @@ public class EnrollApiController {
@Autowired
@Autowired
private
EventTrackApiClients
eventTrackApiClients
;
private
EventTrackApiClients
eventTrackApiClients
;
@Autowired
private
RedisCache
redisCache
;
@ApiOperation
(
value
=
"添加学员报名信息"
,
notes
=
"添加学员报名信息"
)
@ApiOperation
(
value
=
"添加学员报名信息"
,
notes
=
"添加学员报名信息"
)
@PostMapping
(
"/student"
)
@PostMapping
(
"/student"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"培训项目ID"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"培训项目ID"
),
})
})
public
Response
<
String
>
insertTrEnrollRecord
(
@RequestBody
IdEnrollVO
vo
)
{
public
Response
<
String
>
insertTrEnrollRecord
(
HttpServletRequest
request
,
@RequestBody
IdEnrollVO
vo
)
{
try
{
try
{
if
(
vo
.
getId
()
==
null
)
{
if
(
vo
.
getId
()
==
null
)
{
return
Response
.
fail
(
"参数错误"
);
return
Response
.
fail
(
"参数错误"
);
...
@@ -60,7 +64,7 @@ public class EnrollApiController {
...
@@ -60,7 +64,7 @@ public class EnrollApiController {
pointListenerClients
.
addPoint
(
"CreditClendarDone"
,
id
);
pointListenerClients
.
addPoint
(
"CreditClendarDone"
,
id
);
// 添加学院报名埋点
// 添加学院报名埋点
if
(
Objects
.
equals
(
requestContext
.
getSiteType
(),
2
)){
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)){
eventTrackApiClients
.
addEvent
(
"event_enroll_student"
,
vo
.
getId
());
eventTrackApiClients
.
addEvent
(
"event_enroll_student"
,
vo
.
getId
());
}
}
return
Response
.
ok
(
id
);
return
Response
.
ok
(
id
);
...
...
cloud-web-student/src/main/java/com/yizhi/application/exam/controller/ExamApiController.java
View file @
5cd8cc59
...
@@ -3,6 +3,7 @@ package com.yizhi.application.exam.controller;
...
@@ -3,6 +3,7 @@ package com.yizhi.application.exam.controller;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yizhi.core.application.cache.RedisCache
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.exam.application.feign.ExamApiClient
;
import
com.yizhi.exam.application.feign.ExamApiClient
;
...
@@ -36,6 +37,8 @@ import io.swagger.annotations.ApiImplicitParams;
...
@@ -36,6 +37,8 @@ import io.swagger.annotations.ApiImplicitParams;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
javax.servlet.http.HttpServletRequest
;
@Api
(
tags
=
"学员端考试"
,
description
=
"学员端接口"
)
@Api
(
tags
=
"学员端考试"
,
description
=
"学员端接口"
)
@RestController
@RestController
@RequestMapping
(
"/api/exam"
)
@RequestMapping
(
"/api/exam"
)
...
@@ -57,6 +60,8 @@ public class ExamApiController {
...
@@ -57,6 +60,8 @@ public class ExamApiController {
@Autowired
@Autowired
private
EventTrackApiClients
eventTrackApiClients
;
private
EventTrackApiClients
eventTrackApiClients
;
@Autowired
private
RedisCache
redisCache
;
/*@Autowired
/*@Autowired
private RabbitTemplate rabbitTemplate;*/
private RabbitTemplate rabbitTemplate;*/
...
@@ -265,7 +270,7 @@ public class ExamApiController {
...
@@ -265,7 +270,7 @@ public class ExamApiController {
@ApiImplicitParam
(
name
=
"examId"
,
value
=
"考试ID"
)
@ApiImplicitParam
(
name
=
"examId"
,
value
=
"考试ID"
)
})
})
@PostMapping
(
"/code/scan"
)
@PostMapping
(
"/code/scan"
)
public
Response
<
ExamDetailsVO
>
scanCodeExam
(
@RequestBody
ExamAnswerApiListVO
examAnswerApiListVo
)
{
public
Response
<
ExamDetailsVO
>
scanCodeExam
(
HttpServletRequest
request
,
@RequestBody
ExamAnswerApiListVO
examAnswerApiListVo
)
{
RequestContext
requestContext
=
ContextHolder
.
get
();
RequestContext
requestContext
=
ContextHolder
.
get
();
ExamDetailsVO
examDetailsVO
=
null
;
ExamDetailsVO
examDetailsVO
=
null
;
if
(
requestContext
==
null
)
{
if
(
requestContext
==
null
)
{
...
@@ -292,7 +297,7 @@ public class ExamApiController {
...
@@ -292,7 +297,7 @@ public class ExamApiController {
examDetailsVO
=
examApiClient
.
scanCodeExam
(
myExamParameterVO
);
examDetailsVO
=
examApiClient
.
scanCodeExam
(
myExamParameterVO
);
// 添加培训测试埋点
// 添加培训测试埋点
if
(
Objects
.
equals
(
requestContext
.
getSiteType
(),
2
)){
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)){
eventTrackApiClients
.
addEvent
(
"event_scan_exam"
,
examAnswerApiListVo
.
getExamId
());
eventTrackApiClients
.
addEvent
(
"event_scan_exam"
,
examAnswerApiListVo
.
getExamId
());
}
}
return
Response
.
ok
(
examDetailsVO
);
return
Response
.
ok
(
examDetailsVO
);
...
...
cloud-web-student/src/main/java/com/yizhi/application/exam/controller/MyExamController.java
View file @
5cd8cc59
...
@@ -12,6 +12,7 @@ package com.yizhi.application.exam.controller;
...
@@ -12,6 +12,7 @@ package com.yizhi.application.exam.controller;
import
java.util.*
;
import
java.util.*
;
import
com.yizhi.core.application.cache.RedisCache
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.exam.application.feign.ExamClient
;
import
com.yizhi.exam.application.feign.ExamClient
;
...
@@ -41,6 +42,8 @@ import io.swagger.annotations.Api;
...
@@ -41,6 +42,8 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
javax.servlet.http.HttpServletRequest
;
/**
/**
* 〈一句话功能简述〉<br>
* 〈一句话功能简述〉<br>
* 〈我的考试〉
* 〈我的考试〉
...
@@ -68,10 +71,12 @@ public class MyExamController {
...
@@ -68,10 +71,12 @@ public class MyExamController {
@Autowired
@Autowired
private
EventTrackApiClients
eventTrackApiClients
;
private
EventTrackApiClients
eventTrackApiClients
;
@Autowired
private
RedisCache
redisCache
;
@ApiOperation
(
value
=
"我的考试(未完成、进行中、已完成、已逾期)"
,
notes
=
"我的考试(未完成、进行中、已完成、已逾期)"
,
response
=
MyExamVO
.
class
)
@ApiOperation
(
value
=
"我的考试(未完成、进行中、已完成、已逾期)"
,
notes
=
"我的考试(未完成、进行中、已完成、已逾期)"
,
response
=
MyExamVO
.
class
)
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
Response
<
MyExamVO
>
getMyExamList
(
@RequestBody
MyExamParameterVO
myExamParameterVO
)
{
public
Response
<
MyExamVO
>
getMyExamList
(
HttpServletRequest
request
,
@RequestBody
MyExamParameterVO
myExamParameterVO
)
{
Map
<
String
,
Integer
>
page
=
new
HashMap
<
String
,
Integer
>();
Map
<
String
,
Integer
>
page
=
new
HashMap
<
String
,
Integer
>();
try
{
try
{
RequestContext
requestContext
=
ContextHolder
.
get
();
RequestContext
requestContext
=
ContextHolder
.
get
();
...
@@ -103,7 +108,7 @@ public class MyExamController {
...
@@ -103,7 +108,7 @@ public class MyExamController {
page
.
put
(
"pageTotal"
,
myExamPageVO
.
getPageTotal
());
page
.
put
(
"pageTotal"
,
myExamPageVO
.
getPageTotal
());
// 添加培训测试埋点
// 添加培训测试埋点
if
(
Objects
.
equals
(
requestContext
.
getSiteType
(),
2
)){
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)){
eventTrackApiClients
.
addEvent
(
"event_exam"
,
requestContext
.
getAccountId
());
eventTrackApiClients
.
addEvent
(
"event_exam"
,
requestContext
.
getAccountId
());
}
}
return
Response
.
ok
(
myExamVOS
,
page
);
return
Response
.
ok
(
myExamVOS
,
page
);
...
...
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