Commit 2baca299 authored by 张宏至's avatar 张宏至

add:神策登录埋点

parent adae6bf0
...@@ -16,8 +16,11 @@ import cn.quantgroup.xyqb.service.session.ISessionService; ...@@ -16,8 +16,11 @@ import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.service.user.IUserService; import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.IpUtil; import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.util.ValidationUtil; import cn.quantgroup.xyqb.util.ValidationUtil;
import com.sensorsdata.analytics.javasdk.ISensorsAnalytics;
import com.sensorsdata.analytics.javasdk.bean.EventRecord;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
...@@ -100,7 +103,8 @@ public class AppController implements IBaseController { ...@@ -100,7 +103,8 @@ public class AppController implements IBaseController {
log.info("第三方用户登录成功 [AppController] login --> loginFrom:{}, phoneNo:{},appChannel:{}", registerFrom, phoneNo, appChannel); log.info("第三方用户登录成功 [AppController] login --> loginFrom:{}, phoneNo:{},appChannel:{}", registerFrom, phoneNo, appChannel);
return JsonResult.buildSuccessResult("登录成功", bean); return JsonResult.buildSuccessResult("登录成功", bean);
} }
@Autowired
private ISensorsAnalytics iSensorsAnalytics;
/** /**
* 第三方用户免密登录 * 第三方用户免密登录
* 发现新手机号,自动执行注册 * 发现新手机号,自动执行注册
...@@ -163,6 +167,22 @@ public class AppController implements IBaseController { ...@@ -163,6 +167,22 @@ public class AppController implements IBaseController {
loginInfo.setLoginContext(context); loginInfo.setLoginContext(context);
log.info("第三方用户获取信息登录成功 [AppController] loginSuper --> loginFrom:{}, phoneNo:{},appChannel:{},channelId:{}", registerFrom, phoneNo, appChannel, channelId); log.info("第三方用户获取信息登录成功 [AppController] loginSuper --> loginFrom:{}, phoneNo:{},appChannel:{},channelId:{}", registerFrom, phoneNo, appChannel, channelId);
try{
if(!StringUtils.isEmpty(merchant.getId()+"")){
if("7".equals(merchant.getId()+"")){
EventRecord userRecord = EventRecord.builder().setDistinctId(user.getUuid()).isLoginId(Boolean.TRUE)
.setEventName("PD_WUXIEC_UserLogin")
.addProperty("son_channel_id", user.getRegisteredFrom())
.addProperty("parent_channel_id", "")
.addProperty("vcc_uuid", user.getUuid())
.build();
iSensorsAnalytics.track(userRecord);
iSensorsAnalytics.flush();
}
}
}catch (Exception e){
log.info("神策埋点出现问题",e);
}
return JsonResult.buildSuccessResult("登陆成功", loginInfo); return JsonResult.buildSuccessResult("登陆成功", loginInfo);
} }
......
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