Commit be6e000a by 阳浪

埋点优化

parent 6b1c78f8
...@@ -137,7 +137,7 @@ public class InformationStudentController { ...@@ -137,7 +137,7 @@ public class InformationStudentController {
InformationListPcVo vo = informationStudentFeignClients.informationPcPageListV2(infoVO); InformationListPcVo vo = informationStudentFeignClients.informationPcPageListV2(infoVO);
// 添加阅读文章埋点 // 添加阅读文章埋点
if(request.getHeader("Cookie")!=null&& Objects.equals(redisCache.get(request.getHeader("Cookie").replace("JSESSIONID=","")),"2")){ if(request.getHeader("Cookie")!=null&& Objects.equals(redisCache.get(request.getHeader("Cookie").replace("JSESSIONID=","")),"2")){
eventTrackApiClients.addEvent("info_"+String.valueOf(infoVO.getRelationId()),infoVO.getTypeTwo()); eventTrackApiClients.addEvent(String.valueOf(infoVO.getRelationId()),infoVO.getTypeTwo()!=null?infoVO.getTypeTwo():infoVO.getRelationId());
} }
pageMap.put("pageNo", pageNo); pageMap.put("pageNo", pageNo);
pageMap.put("pageSize", pageSize); pageMap.put("pageSize", pageSize);
......
package com.yizhi.application.research.controller; package com.yizhi.application.research.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.research.application.feign.ResearchClient; import com.yizhi.research.application.feign.ResearchClient;
...@@ -8,6 +9,7 @@ import com.yizhi.research.application.vo.api.PageVo; ...@@ -8,6 +9,7 @@ import com.yizhi.research.application.vo.api.PageVo;
import com.yizhi.research.application.vo.api.SearchVo; import com.yizhi.research.application.vo.api.SearchVo;
import com.yizhi.research.application.vo.domain.ResearchVo; import com.yizhi.research.application.vo.domain.ResearchVo;
import com.yizhi.research.application.vo.domain.TrResearchQuestionVo; import com.yizhi.research.application.vo.domain.TrResearchQuestionVo;
import com.yizhi.site.application.feign.api.EventTrackApiClients;
import com.yizhi.util.application.constant.ReturnCode; import com.yizhi.util.application.constant.ReturnCode;
import com.yizhi.util.application.domain.Response; import com.yizhi.util.application.domain.Response;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -18,8 +20,10 @@ import org.slf4j.LoggerFactory; ...@@ -18,8 +20,10 @@ 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.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
...@@ -36,13 +40,18 @@ public class ResearchController { ...@@ -36,13 +40,18 @@ public class ResearchController {
@Autowired @Autowired
private ResearchClient researchClient; private ResearchClient researchClient;
@Autowired
private EventTrackApiClients eventTrackApiClients;
@Autowired
private RedisCache redisCache;
@GetMapping("/page/list") @GetMapping("/page/list")
@ApiOperation(value = "分页查询学员能看到的调研", notes = "分两种状态", response = ResearchVo.class) @ApiOperation(value = "分页查询学员能看到的调研", notes = "分两种状态", response = ResearchVo.class)
public Response<ResearchVo> listPage( public Response<ResearchVo> listPage(HttpServletRequest request,
@ApiParam(name = "state", value = "状态:1已完成,2进行中", required = false) @RequestParam(name = "state", required = false) Integer state, @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 = "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, @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 @ApiParam(name = "pageSize", value = "每页条数,默认20条", required = true) @RequestParam(name = "pageSize", defaultValue = "20") Integer pageSize
) { ) {
try { try {
PageVo pageVo = new PageVo(); PageVo pageVo = new PageVo();
...@@ -58,6 +67,10 @@ public class ResearchController { ...@@ -58,6 +67,10 @@ public class ResearchController {
model.setDate(new Date()); model.setDate(new Date());
model.setObj(pageVo); model.setObj(pageVo);
model.setContext(ContextHolder.get()); 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)); return Response.ok(researchClient.apiListPage(model));
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("", e); LOGGER.error("", e);
......
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