Commit 0b7134a0 authored by 技术部-任文超's avatar 技术部-任文超

按照UserStatistics注释纠正发送统计参数值

parent 323eefa0
......@@ -114,6 +114,28 @@ public class UserController implements IBaseController {
return login(channelId, appChannel, createdFrom, userId, key, request, openId, dimension);
}
@LogHttpCaller
@PasswordErrorFiniteValidator
@RequestMapping("/login")
public JsonResult login(
@RequestParam(required = false, defaultValue = "1") Long channelId, String appChannel,
@RequestParam(required = false, defaultValue = "1") Long createdFrom,
@RequestParam(required = false, defaultValue = "") String userId,
@RequestParam(required = false,defaultValue = "xyqb") String key,
HttpServletRequest request, String openId,
@RequestParam(required = false) String dimension) {
LOGGER.info("login -> channelId:{},appChannel:{},createdFrom:{},userId:{},key:{},openId:{},dimension:{}",channelId,appChannel,createdFrom,userId,key,openId,dimension);
Merchant merchant = merchantService.findMerchantByName(key);
if (merchant == null) {
return JsonResult.buildErrorStateResult("未知的连接", null);
}
if (!StringUtils.isEmpty(userId) && userId.length() > 10) {
return loginWithUserId(channelId, appChannel, createdFrom, userId, merchant,dimension);
} else {
return loginWithHttpBasic(channelId, appChannel, createdFrom, merchant, request, openId,dimension);
}
}
/**
* 快速登录(手机号 + 短信验证码),H5专用入口
* 短信验证码错误达到限定次数时执行图形验证码校验
......@@ -139,29 +161,6 @@ public class UserController implements IBaseController {
return loginFast(channelId, appChannel, createdFrom, key, btRegisterChannelId, dimension, request);
}
@LogHttpCaller
@PasswordErrorFiniteValidator
@RequestMapping("/login")
public JsonResult login(
@RequestParam(required = false, defaultValue = "1") Long channelId, String appChannel,
@RequestParam(required = false, defaultValue = "1") Long createdFrom,
@RequestParam(required = false, defaultValue = "") String userId,
@RequestParam(required = false,defaultValue = "xyqb") String key,
HttpServletRequest request, String openId,
@RequestParam(required = false) String dimension) {
LOGGER.info("login -> channelId:{},appChannel:{},createdFrom:{},userId:{},key:{},openId:{},dimension:{}",channelId,appChannel,createdFrom,userId,key,openId,dimension);
Merchant merchant = merchantService.findMerchantByName(key);
if (merchant == null) {
return JsonResult.buildErrorStateResult("未知的连接", null);
}
if (!StringUtils.isEmpty(userId) && userId.length() > 10) {
return loginWithUserId(channelId, appChannel, createdFrom, userId, merchant,dimension);
} else {
return loginWithHttpBasic(channelId, appChannel, createdFrom, merchant, request, openId,dimension);
}
}
@RequestMapping("/login/fast")
public JsonResult loginFast(
@RequestParam(required = false, defaultValue = "1") Long channelId, String appChannel,
......@@ -192,14 +191,15 @@ public class UserController implements IBaseController {
LOGGER.error("用户不存在,或者已经注销,phoneNo:{}",phoneNo);
return JsonResult.buildErrorStateResult("登录失败", null);
}
UserStatistics statistics = new UserStatistics(user,dimension,2,channelId);
if (user == null) {
user = userRegisterService.register(phoneNo, channelId, createdFrom, appChannel,btRegisterChannelId,dimension);
statistics.setAction(1);
if (user == null) {
throw new UserNotExistException("用户未找到");
}
}
//增加登陆统计发送
UserStatistics statistics=new UserStatistics(user,dimension,3,channelId);
MqUtils.sendLoanVest(statistics);
return new JsonResult(sessionService.createSession(channelId, createdFrom, appChannel, user, merchant));
// return createSession(channelId, createdFrom, appChannel, user);
......@@ -388,7 +388,7 @@ public class UserController implements IBaseController {
return JsonResult.buildErrorStateResult("用户名或密码不正确", null);
}
//增加登陆统计发送
UserStatistics statistics=new UserStatistics(user,dimension,1,channelId);
UserStatistics statistics=new UserStatistics(user,dimension,0,channelId);
MqUtils.sendLoanVest(statistics);
LOGGER.info("用户登陆成功phonNo:{},当前ip:{},用户登陆信息:{}",user.getPhoneNo(), IPUtil.getRemoteIP(request), statistics);
return new JsonResult(sessionService.createSession(channelId, createdFrom, appChannel, user, merchant));
......@@ -448,7 +448,7 @@ public class UserController implements IBaseController {
//用户信息存在,更新session中的最后访问时间,重新写入缓存.
if (null != user || !user.getEnable()) {
//增加登陆统计发送
UserStatistics statistics=new UserStatistics(user,dimension,1,channelId);
UserStatistics statistics=new UserStatistics(user,dimension,3,channelId);
MqUtils.sendLoanVest(statistics);
return new JsonResult(sessionService.createSession(channelId, createdFrom, appChannel, user, merchant));
} else {
......
......@@ -12,7 +12,10 @@ public class UserStatistics {
private String uuid;
private Long registerFrom;
private String dimension;
private int action;//登录0,注册1,快捷登录2,免密登录3
/**
* 登录0,注册1,快捷登录2,免密登录3
*/
private int action;
private Long channel;
public UserStatistics() {
......
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