Commit 03c6270d by 阳浪

埋点优化

parent 88a6a54a
......@@ -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);
}
......
......@@ -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.getTrainingProjectId());
}
if (f) {
LOGGER.info("发表评论成功");
......
......@@ -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,13 +49,15 @@ 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(
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,
......@@ -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("回复评论成功");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment