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
03c6270d
Commit
03c6270d
authored
Jan 21, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
埋点优化
parent
88a6a54a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
cloud-web-manage/src/main/java/com/yizhi/application/project/controller/TpCommentController.java
+1
-2
cloud-web-student/src/main/java/com/yizhi/application/project/controller/TpCommentApiController.java
+1
-1
cloud-web-student/src/main/java/com/yizhi/application/project/controller/TpCommentReplyApiController.java
+10
-2
No files found.
cloud-web-manage/src/main/java/com/yizhi/application/project/controller/TpCommentController.java
View file @
03c6270d
...
...
@@ -40,11 +40,10 @@ public class TpCommentController {
public
Response
<
Page
<
PageCommentVo
>>
list
(
@ApiParam
(
value
=
"培训项目id"
,
required
=
true
)
@RequestParam
(
"trainingProjectId"
)
Long
trainingProjectId
,
@ApiParam
(
value
=
"关联业务类型:1活动服务;2新闻资讯;3培训测试;4培训资讯"
)
@RequestParam
(
name
=
"bizType"
,
defaultValue
=
"1"
)
Integer
bizType
,
@RequestParam
(
name
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@ApiParam
(
name
=
"pageNo"
,
value
=
"跳转页数,默认第一页"
,
required
=
true
)
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@ApiParam
(
name
=
"pageSize"
,
value
=
"每页条数,默认20条"
,
required
=
true
)
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
){
RequestContext
requestContext
=
ContextHolder
.
get
();
Page
<
PageCommentVo
>
page
=
tpCommentClient
.
list
(
trainingProjectId
,
bizType
,
requestContext
.
getAccountId
(),
pageNo
,
pageSize
,
type
);
Page
<
PageCommentVo
>
page
=
tpCommentClient
.
list
(
trainingProjectId
,
bizType
,
requestContext
.
getAccountId
(),
pageNo
,
pageSize
,
0
);
return
Response
.
ok
(
page
);
}
...
...
cloud-web-student/src/main/java/com/yizhi/application/project/controller/TpCommentApiController.java
View file @
03c6270d
...
...
@@ -82,7 +82,7 @@ public class TpCommentApiController {
RequestContext
context
=
ContextHolder
.
get
();
// 添加发表评论埋点
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)){
eventTrackApiClients
.
addEvent
(
"event_tp_comment"
,
tpComment
.
getId
());
eventTrackApiClients
.
addEvent
(
"event_tp_comment"
,
tpComment
.
get
TrainingProject
Id
());
}
if
(
f
)
{
LOGGER
.
info
(
"发表评论成功"
);
...
...
cloud-web-student/src/main/java/com/yizhi/application/project/controller/TpCommentReplyApiController.java
View file @
03c6270d
...
...
@@ -8,6 +8,7 @@ import com.yizhi.core.application.cache.RedisCache;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.course.application.vo.ReplyVo
;
import
com.yizhi.site.application.feign.api.EventTrackApiClients
;
import
com.yizhi.system.application.system.remote.AccountClient
;
import
com.yizhi.system.application.vo.AccountVO
;
import
com.yizhi.training.application.feign.TpCommentReplyClient
;
...
...
@@ -24,6 +25,7 @@ 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.*
;
/**
...
...
@@ -47,14 +49,16 @@ public class TpCommentReplyApiController {
private
CommentUtil
workUtil
;
@Autowired
private
RedisCache
redisCache
;
@Autowired
private
EventTrackApiClients
eventTrackApiClients
;
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
TpCommentReplyApiController
.
class
);
@PostMapping
(
"/save"
)
@ApiOperation
(
value
=
"学员端回复项目评论"
,
notes
=
"返回操作是否成功"
)
public
Response
save
(
@ApiParam
(
value
=
"项目trainingProjectId,项目评论commmentId,评论内容content"
)
@RequestBody
TpCommentReplyVo
tpCommentReply
public
Response
save
(
HttpServletRequest
request
,
@ApiParam
(
value
=
"项目trainingProjectId,项目评论commmentId,评论内容content"
)
@RequestBody
TpCommentReplyVo
tpCommentReply
// @ApiParam(value = "项目id",required = true)@RequestParam("trainingProjectId")Long trainingProjectId,
// @ApiParam(value = "项目评论id",required = true)@RequestParam("commmentId")Long commmentId,
// @ApiParam(value = "评论内容",required = true)@RequestParam(name = "content")String content
...
...
@@ -68,6 +72,10 @@ public class TpCommentReplyApiController {
tpCommentReply
.
setAuditStatus
(
"0"
);
tpCommentReply
.
setUserAvatar
(
requestContext
.
getHeadPortrait
());
Boolean
f
=
tpCommentReplyClient
.
save
(
tpCommentReply
);
// 添加发表评论埋点
if
(
request
.
getHeader
(
"Cookie"
)!=
null
&&
Objects
.
equals
(
redisCache
.
get
(
request
.
getHeader
(
"Cookie"
).
replace
(
"JSESSIONID="
,
""
)),
"2"
)){
eventTrackApiClients
.
addEvent
(
"event_tp_comment"
,
tpCommentReply
.
getTrainingProjectId
());
}
if
(
f
)
{
LOGGER
.
info
(
"回复评论成功"
);
return
Response
.
ok
(
"回复评论成功"
);
...
...
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