Commit e7579052 authored by Java-刘 彧阳's avatar Java-刘 彧阳

添加日志打印

parent 2467e8c5
...@@ -94,7 +94,7 @@ public class UserController implements IBaseController { ...@@ -94,7 +94,7 @@ public class UserController implements IBaseController {
@RequestMapping("/login/fast") @RequestMapping("/login/fast")
public JsonResult loginFast( public JsonResult loginFast(
@RequestParam(required = false, defaultValue = "1") Long channelId, String appChannel, @RequestParam(required = false, defaultValue = "1") Long channelId, String appChannel,
@RequestParam(required = false, defaultValue = "1") Long createdFrom, String key, HttpServletRequest request) { @RequestParam(required = false, defaultValue = "1") Long createdFrom, String key,@RequestParam(required = false)Long btRegisterChannelId ,HttpServletRequest request) {
Map<String, JsonResult> validMap = getHeaderParam(request); Map<String, JsonResult> validMap = getHeaderParam(request);
if (null != validMap.get("fail")) { if (null != validMap.get("fail")) {
return validMap.get("fail"); return validMap.get("fail");
...@@ -110,7 +110,7 @@ public class UserController implements IBaseController { ...@@ -110,7 +110,7 @@ public class UserController implements IBaseController {
return JsonResult.buildErrorStateResult("登录失败", null); return JsonResult.buildErrorStateResult("登录失败", null);
} }
if (user == null) { if (user == null) {
user = registerFastWhenLogin(phoneNo, channelId, createdFrom, appChannel); user = registerFastWhenLogin(phoneNo, channelId, createdFrom, appChannel,btRegisterChannelId);
if (user == null) { if (user == null) {
throw new UserNotExistException("用户未找到"); throw new UserNotExistException("用户未找到");
} }
...@@ -119,6 +119,21 @@ public class UserController implements IBaseController { ...@@ -119,6 +119,21 @@ public class UserController implements IBaseController {
// return createSession(channelId, createdFrom, appChannel, user); // return createSession(channelId, createdFrom, appChannel, user);
} }
private User registerFastWhenLogin(String phoneNo, Long channelId, Long registerFrom, String appChannel, Long btRegisterChannelId) {
String password = genRandomPwd();
LOGGER.info("用户快速注册, phoneNo:{}, verificationCode:{}, channelId:{}, registerFrom:{},appChannel:{}", phoneNo, channelId, registerFrom, appChannel);
if (!ValidationUtil.validatePhoneNo(phoneNo)) {
LOGGER.info("用户快速注册失败,手机号错误, registerFrom:{}, phoneNo:{}", registerFrom, phoneNo);
throw new UserNotExistException("手机号错误");
}
if (null == registerFrom) {
registerFrom = 1L;
}
LOGGER.info("用户快速注册成功, registerFrom:{}, phoneNo:{}", registerFrom, phoneNo);
return userService.registerAndReturn(phoneNo, password, registerFrom,btRegisterChannelId);
}
/** /**
* 快速登录验证 * 快速登录验证
* *
......
...@@ -34,4 +34,6 @@ public interface IUserService { ...@@ -34,4 +34,6 @@ public interface IUserService {
boolean register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId); boolean register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId);
List<User> findByPhones(List<String> phones); List<User> findByPhones(List<String> phones);
User registerAndReturn(String phoneNo, String password, Long registerFrom, Long btRegisterChannelId);
} }
...@@ -103,6 +103,19 @@ public class UserServiceImpl implements IUserService { ...@@ -103,6 +103,19 @@ public class UserServiceImpl implements IUserService {
}); });
} }
@Override
public User registerAndReturn(String phoneNo, String password, Long registerFrom, Long btRegisterChannelId) {
User user = registerAndReturn(phoneNo, password, registerFrom);
if(null != user && null != btRegisterChannelId){
UserBtRegister userBtRegister = new UserBtRegister();
userBtRegister.setUserId(user.getId());
userBtRegister.setRegisterBtMerchantId(btRegisterChannelId);
userBtRegisterService.save(userBtRegister);
log.info("白条注册渠道信息保存完成");
}
return user;
}
@Override @Override
public boolean register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId) { public boolean register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId) {
String uuid = lkbUserService.registerApp(phoneNo, password); String uuid = lkbUserService.registerApp(phoneNo, password);
......
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