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
14a20734
Commit
14a20734
authored
Jan 17, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
埋点优化
parent
042f20fd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
20 deletions
+40
-20
cloud-web-manage/src/main/java/com/yizhi/application/portal/controller/LeaveWordManageController.java
+6
-2
cloud-web-manage/src/main/java/com/yizhi/application/portal/controller/SitePublicationManageController.java
+10
-4
cloud-web-manage/src/main/java/com/yizhi/application/research/controller/manage/ResearchController.java
+12
-8
cloud-web-student/src/main/java/com/yizhi/application/project/controller/TpCommentApiController.java
+7
-3
cloud-web-student/src/main/java/com/yizhi/application/project/controller/TrainingProjectController.java
+5
-3
No files found.
cloud-web-manage/src/main/java/com/yizhi/application/portal/controller/LeaveWordManageController.java
View file @
14a20734
package
com
.
yizhi
.
application
.
portal
.
controller
;
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.RequestContext
;
import
com.yizhi.point.application.feign.PointListenerClients
;
...
...
@@ -18,6 +19,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Objects
;
/**
...
...
@@ -40,6 +42,8 @@ public class LeaveWordManageController {
@Autowired
private
EventTrackApiClients
eventTrackApiClients
;
@Autowired
private
RedisCache
redisCache
;
@PostMapping
(
"/page"
)
...
...
@@ -57,13 +61,13 @@ public class LeaveWordManageController {
@PostMapping
(
"/pageByMy"
)
@ApiOperation
(
value
=
"我的分页查询"
,
notes
=
"我的分页查询"
)
public
Response
<
Page
<
LeaveWordVo
>>
pageByMy
(
@ApiParam
(
name
=
"leaveWordParamVo"
,
value
=
""
)
@RequestBody
LeaveWordParamVo
leaveWordParamVo
){
public
Response
<
Page
<
LeaveWordVo
>>
pageByMy
(
HttpServletRequest
request
,
@ApiParam
(
name
=
"leaveWordParamVo"
,
value
=
""
)
@RequestBody
LeaveWordParamVo
leaveWordParamVo
){
try
{
RequestContext
context
=
ContextHolder
.
get
();
leaveWordParamVo
.
setCreateById
(
context
.
getAccountId
());
Page
<
LeaveWordVo
>
page
=
leaveWordClient
.
page
(
leaveWordParamVo
);
// 添加留言埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(
),
2
)){
if
(
Objects
.
equals
(
redisCache
.
get
(
request
.
getSession
().
getId
()
),
2
)){
eventTrackApiClients
.
addEvent
(
"leave_word"
,
context
.
getAccountId
());
}
return
Response
.
ok
(
page
);
...
...
cloud-web-manage/src/main/java/com/yizhi/application/portal/controller/SitePublicationManageController.java
View file @
14a20734
package
com
.
yizhi
.
application
.
portal
.
controller
;
import
com.alibaba.fastjson.JSON
;
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.RequestContext
;
import
com.yizhi.core.application.enums.InternationalEnums
;
...
...
@@ -21,6 +23,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
...
...
@@ -48,6 +51,8 @@ public class SitePublicationManageController {
@Autowired
private
EventTrackApiClients
eventTrackApiClients
;
@Autowired
private
RedisCache
redisCache
;
/**
* 投稿列表
...
...
@@ -56,13 +61,14 @@ public class SitePublicationManageController {
*/
@ApiOperation
(
value
=
"查看投稿"
,
notes
=
"查看投稿"
,
response
=
PublicationParamVO
.
class
)
@PostMapping
(
"/list"
)
public
Response
<
Page
<
PublicationVo
>>
list
(
@RequestBody
PublicationParamVO
vo
)
{
public
Response
<
Page
<
PublicationVo
>>
list
(
HttpServletRequest
request
,
@RequestBody
PublicationParamVO
vo
)
{
try
{
RequestContext
context
=
ContextHolder
.
get
();
vo
.
setSiteId
(
context
.
getSiteId
());
LOGGER
.
info
(
"===========登录信息:{}"
,
JSON
.
toJSONString
(
context
));
// 添加我的投稿埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(
),
2
)){
if
(
Objects
.
equals
(
redisCache
.
get
(
request
.
getSession
().
getId
()
),
2
)){
eventTrackApiClients
.
addEvent
(
"event_publication"
,
context
.
getAccountId
());
}
return
Response
.
ok
(
publicationManageFeignClients
.
list
(
vo
));
...
...
@@ -120,7 +126,7 @@ public class SitePublicationManageController {
@ApiOperation
(
value
=
"保存投稿"
,
notes
=
"保存投稿"
)
@PostMapping
(
"/insert"
)
public
Response
<
Boolean
>
insert
(
@RequestBody
PublicationVo
information
)
{
public
Response
<
Boolean
>
insert
(
HttpServletRequest
request
,
@RequestBody
PublicationVo
information
)
{
try
{
Date
date
=
new
Date
();
RequestContext
context
=
ContextHolder
.
get
();
...
...
@@ -137,7 +143,7 @@ public class SitePublicationManageController {
}
// 添加我的投稿埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(
),
2
)){
if
(
Objects
.
equals
(
redisCache
.
get
(
request
.
getSession
().
getId
()
),
2
)){
eventTrackApiClients
.
addEvent
(
"event_publication_"
+
information
.
getTypeOne
(),
id
);
}
information
.
setId
(
id
);
...
...
cloud-web-manage/src/main/java/com/yizhi/application/research/controller/manage/ResearchController.java
View file @
14a20734
...
...
@@ -2,6 +2,7 @@ package com.yizhi.application.research.controller.manage;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.application.accountUtil.AuthorizeQueryAccount
;
import
com.yizhi.core.application.cache.RedisCache
;
import
com.yizhi.core.application.enums.InternationalEnums
;
import
com.yizhi.application.research.exception.TypeErrorExeption
;
import
com.yizhi.application.util.TaskSendMessage
;
...
...
@@ -38,6 +39,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.*
;
...
...
@@ -70,6 +72,8 @@ public class ResearchController {
@Autowired
private
EventTrackApiClients
eventTrackApiClients
;
@Autowired
private
RedisCache
redisCache
;
/**
* 新增调研接口
...
...
@@ -229,13 +233,13 @@ public class ResearchController {
*/
@GetMapping
(
"/page/list"
)
@ApiOperation
(
value
=
"分页列表"
,
notes
=
"查询未删除的"
)
public
Response
<
PageInfo
>
listPage
(
@ApiParam
(
name
=
"name"
,
value
=
"调研关键字"
)
@RequestParam
(
name
=
"name"
,
required
=
false
)
String
name
,
@ApiParam
(
name
=
"state"
,
value
=
"状态,0草稿 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
=
"currentTime"
,
value
=
"当前时间"
)
@RequestParam
(
value
=
"currentTime"
,
required
=
false
)
String
currentTime
,
@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
public
Response
<
PageInfo
>
listPage
(
HttpServletRequest
request
,
@ApiParam
(
name
=
"name"
,
value
=
"调研关键字"
)
@RequestParam
(
name
=
"name"
,
required
=
false
)
String
name
,
@ApiParam
(
name
=
"state"
,
value
=
"状态,0草稿 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
=
"currentTime"
,
value
=
"当前时间"
)
@RequestParam
(
value
=
"currentTime"
,
required
=
false
)
String
currentTime
,
@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
)
{
try
{
...
...
@@ -260,7 +264,7 @@ public class ResearchController {
RequestContext
context
=
ContextHolder
.
get
();
// 添加调研埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(
),
2
)){
if
(
Objects
.
equals
(
redisCache
.
get
(
request
.
getSession
().
getId
()
),
2
)){
eventTrackApiClients
.
addEvent
(
"event_research"
,
context
.
getAccountId
());
}
return
Response
.
ok
(
researchClient
.
listPage
(
model
));
...
...
cloud-web-student/src/main/java/com/yizhi/application/project/controller/TpCommentApiController.java
View file @
14a20734
...
...
@@ -4,6 +4,7 @@ package com.yizhi.application.project.controller;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.application.project.controller.util.CommentUtil
;
import
com.yizhi.application.tools.PageTools
;
import
com.yizhi.core.application.cache.RedisCache
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.site.application.feign.api.EventTrackApiClients
;
...
...
@@ -24,6 +25,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.Objects
;
...
...
@@ -52,14 +54,16 @@ public class TpCommentApiController {
@Autowired
private
EventTrackApiClients
eventTrackApiClients
;
@Autowired
private
RedisCache
redisCache
;
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
TpCommentApiController
.
class
);
@PostMapping
(
"/save"
)
@ApiOperation
(
value
=
"学员端发表项目评论"
,
notes
=
"返回操作是否成功"
)
public
Response
save
(
@ApiParam
(
value
=
"传入trainingProjectId,content"
)
@RequestBody
TpCommentVo
tpComment
public
Response
save
(
HttpServletRequest
request
,
@ApiParam
(
value
=
"传入trainingProjectId,content"
)
@RequestBody
TpCommentVo
tpComment
// @ApiParam(value = "项目id",required = true)@RequestParam("trainingProjectId")Long trainingProjectId,
// @ApiParam(value = "评论内容",required = true)@RequestParam(name = "content")String content
...
...
@@ -77,7 +81,7 @@ public class TpCommentApiController {
RequestContext
context
=
ContextHolder
.
get
();
// 添加发表评论埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(
),
2
)){
if
(
Objects
.
equals
(
redisCache
.
get
(
request
.
getSession
().
getId
()
),
2
)){
eventTrackApiClients
.
addEvent
(
"event_tp_comment"
,
tpComment
.
getId
());
}
if
(
f
)
{
...
...
cloud-web-student/src/main/java/com/yizhi/application/project/controller/TrainingProjectController.java
View file @
14a20734
...
...
@@ -50,6 +50,8 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @Author: shengchenglong
* @Date: 2018/3/27 20:54
...
...
@@ -495,13 +497,13 @@ public class TrainingProjectController {
* @return
*/
@GetMapping
(
"/getTrainingActivity"
)
public
Response
<
TrainingActivityVO
>
getTrainingActivity
(
@RequestParam
(
"bizType"
)
Integer
bizType
,
@RequestParam
(
name
=
"startDate"
,
required
=
false
)
String
startDate
,
@RequestParam
(
name
=
"endDate"
,
required
=
false
)
String
endDate
)
{
public
Response
<
TrainingActivityVO
>
getTrainingActivity
(
HttpServletRequest
request
,
@RequestParam
(
"bizType"
)
Integer
bizType
,
@RequestParam
(
name
=
"startDate"
,
required
=
false
)
String
startDate
,
@RequestParam
(
name
=
"endDate"
,
required
=
false
)
String
endDate
)
{
TrainingActivityVO
result
=
trainingProjectClient
.
getTrainingActivity
(
bizType
,
startDate
,
endDate
);
RequestContext
context
=
ContextHolder
.
get
();
// 添加活动埋点
if
(
Objects
.
equals
(
context
.
getSiteType
(
),
2
)){
if
(
Objects
.
equals
(
redisCache
.
get
(
request
.
getSession
().
getId
()
),
2
)){
eventTrackApiClients
.
addEvent
(
"event_training_activity"
,
context
.
getAccountId
());
}
return
Response
.
ok
(
result
);
...
...
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