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
74a30011
Commit
74a30011
authored
Mar 21, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息优化
parent
05834675
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
19 deletions
+17
-19
cloud-web-manage/src/main/java/com/yizhi/application/research/controller/manage/ResearchController.java
+0
-7
cloud-web-student/src/main/java/com/yizhi/application/research/controller/ResearchAnswerController.java
+15
-2
cloud-web-student/src/main/java/com/yizhi/application/research/controller/ResearchController.java
+2
-10
No files found.
cloud-web-manage/src/main/java/com/yizhi/application/research/controller/manage/ResearchController.java
View file @
74a30011
...
...
@@ -264,13 +264,6 @@ public class ResearchController {
BaseModel
<
Page
<
com
.
yizhi
.
research
.
application
.
vo
.
domain
.
ResearchVo
>>
model
=
new
BaseModel
<>();
model
.
setContext
(
ContextHolder
.
get
());
model
.
setObj
(
page
);
RequestContext
context
=
ContextHolder
.
get
();
// 添加调研埋点
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)){
eventTrackApiClients
.
addEvent
(
"event_research"
,
context
.
getAccountId
());
}
return
Response
.
ok
(
researchClient
.
listPage
(
model
));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
""
,
e
);
...
...
cloud-web-student/src/main/java/com/yizhi/application/research/controller/ResearchAnswerController.java
View file @
74a30011
...
...
@@ -2,6 +2,7 @@ package com.yizhi.application.research.controller;
import
com.yizhi.application.point.constant.MQqueuesEnum
;
import
com.yizhi.application.point.constant.PointEventEnum
;
import
com.yizhi.core.application.cache.RedisCache
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.point.application.feign.PointRedisFeignClients
;
...
...
@@ -12,6 +13,7 @@ import com.yizhi.research.application.model.AnswerModel;
import
com.yizhi.research.application.vo.api.AnswerVo
;
import
com.yizhi.research.application.vo.api.ViewAnswerVo
;
import
com.yizhi.research.application.vo.domain.ResearchVo
;
import
com.yizhi.site.application.feign.api.EventTrackApiClients
;
import
com.yizhi.util.application.domain.Response
;
import
com.yizhi.util.application.enums.i18n.Constants
;
import
io.swagger.annotations.Api
;
...
...
@@ -23,7 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.Objects
;
/**
* @Author: shengchenglong
...
...
@@ -42,13 +46,18 @@ public class ResearchAnswerController {
private
ResearchClient
researchClient
;
@Autowired
private
PointRedisFeignClients
pointRedisFeignClients
;
@Autowired
private
EventTrackApiClients
eventTrackApiClients
;
@Autowired
private
RedisCache
redisCache
;
/*@Autowired
private AmqpTemplate amqpTemplate;*/
@PostMapping
(
"/submit"
)
@ApiOperation
(
value
=
"学员提交调研答案"
)
public
Response
<
Integer
>
submitAnswer
(
@ApiParam
(
name
=
"answerVo"
,
value
=
"答案vo"
,
required
=
true
)
@RequestBody
AnswerVo
answerVo
public
Response
<
Integer
>
submitAnswer
(
HttpServletRequest
request
,
@ApiParam
(
name
=
"answerVo"
,
value
=
"答案vo"
,
required
=
true
)
@RequestBody
AnswerVo
answerVo
)
{
try
{
if
(
answerVo
.
getResearchId
()
==
null
||
CollectionUtils
.
isEmpty
(
answerVo
.
getQuestions
()))
{
...
...
@@ -106,6 +115,10 @@ public class ResearchAnswerController {
if
(
num
==
-
3
)
{
return
Response
.
fail
(
Constants
.
RESEARCH_MSG_ANSWER_TOO_SHORT
);
}
// 添加调研埋点
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)){
eventTrackApiClients
.
addEvent
(
"event_research"
,
ContextHolder
.
get
().
getAccountId
());
}
return
Response
.
fail
(
Constants
.
RESEARCH_MSG_BIZ_ERROR
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
""
,
e
);
...
...
cloud-web-student/src/main/java/com/yizhi/application/research/controller/ResearchController.java
View file @
74a30011
...
...
@@ -40,14 +40,9 @@ public class ResearchController {
@Autowired
private
ResearchClient
researchClient
;
@Autowired
private
EventTrackApiClients
eventTrackApiClients
;
@Autowired
private
RedisCache
redisCache
;
@GetMapping
(
"/page/list"
)
@ApiOperation
(
value
=
"分页查询学员能看到的调研"
,
notes
=
"分两种状态"
,
response
=
ResearchVo
.
class
)
public
Response
<
ResearchVo
>
listPage
(
HttpServletRequest
request
,
public
Response
<
ResearchVo
>
listPage
(
@ApiParam
(
name
=
"state"
,
value
=
"状态:1已完成,2进行中"
,
required
=
false
)
@RequestParam
(
name
=
"state"
,
required
=
false
)
Integer
state
,
@ApiParam
(
name
=
"bizType"
,
value
=
"业务类型:1调研;2投票,为空查询所有"
,
required
=
false
)
@RequestParam
(
name
=
"bizType"
,
required
=
false
)
Integer
bizType
,
@ApiParam
(
name
=
"pageNo"
,
value
=
"跳转页数,默认第一页"
,
required
=
true
)
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
...
...
@@ -67,10 +62,7 @@ public class ResearchController {
model
.
setDate
(
new
Date
());
model
.
setObj
(
pageVo
);
model
.
setContext
(
ContextHolder
.
get
());
// 添加调研埋点
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)){
eventTrackApiClients
.
addEvent
(
"event_research"
,
ContextHolder
.
get
().
getAccountId
());
}
return
Response
.
ok
(
researchClient
.
apiListPage
(
model
));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
""
,
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