|
@@ -12,25 +12,33 @@ import lombok.RequiredArgsConstructor;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.tuple.Triple;
|
|
import org.apache.commons.lang3.tuple.Triple;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
+import shop.alien.config.properties.RiskControlProperties;
|
|
|
|
|
+import shop.alien.entity.second.LifeUserLog;
|
|
|
|
|
+import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.store.LifeFans;
|
|
import shop.alien.entity.store.LifeFans;
|
|
|
import shop.alien.entity.store.LifeNotice;
|
|
import shop.alien.entity.store.LifeNotice;
|
|
|
import shop.alien.entity.store.LifeUser;
|
|
import shop.alien.entity.store.LifeUser;
|
|
|
import shop.alien.entity.store.vo.LifeMessageVo;
|
|
import shop.alien.entity.store.vo.LifeMessageVo;
|
|
|
import shop.alien.entity.store.vo.LifeUserVo;
|
|
import shop.alien.entity.store.vo.LifeUserVo;
|
|
|
import shop.alien.entity.store.vo.WebSocketVo;
|
|
import shop.alien.entity.store.vo.WebSocketVo;
|
|
|
|
|
+import shop.alien.mapper.second.LifeUserLogMapper;
|
|
|
import shop.alien.store.config.BaseRedisService;
|
|
import shop.alien.store.config.BaseRedisService;
|
|
|
import shop.alien.mapper.LifeFansMapper;
|
|
import shop.alien.mapper.LifeFansMapper;
|
|
|
import shop.alien.mapper.LifeMessageMapper;
|
|
import shop.alien.mapper.LifeMessageMapper;
|
|
|
import shop.alien.mapper.LifeNoticeMapper;
|
|
import shop.alien.mapper.LifeNoticeMapper;
|
|
|
import shop.alien.mapper.LifeUserMapper;
|
|
import shop.alien.mapper.LifeUserMapper;
|
|
|
import shop.alien.store.config.WebSocketProcess;
|
|
import shop.alien.store.config.WebSocketProcess;
|
|
|
|
|
+import shop.alien.store.feign.SecondServiceFeign;
|
|
|
import shop.alien.store.util.FunctionMagic;
|
|
import shop.alien.store.util.FunctionMagic;
|
|
|
import shop.alien.util.common.JwtUtil;
|
|
import shop.alien.util.common.JwtUtil;
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -55,6 +63,13 @@ public class LifeUserService extends ServiceImpl<LifeUserMapper, LifeUser> {
|
|
|
|
|
|
|
|
private final ActivityInviteConfigService activityInviteConfigService;
|
|
private final ActivityInviteConfigService activityInviteConfigService;
|
|
|
|
|
|
|
|
|
|
+ private final LifeUserLogMapper lifeUserLogMapper;
|
|
|
|
|
+
|
|
|
|
|
+ private final SecondServiceFeign alienSecondFeign;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RiskControlProperties riskControlProperties;
|
|
|
|
|
+
|
|
|
@Value("${jwt.expiration-time}")
|
|
@Value("${jwt.expiration-time}")
|
|
|
private String effectiveTime;
|
|
private String effectiveTime;
|
|
|
|
|
|
|
@@ -138,7 +153,7 @@ public class LifeUserService extends ServiceImpl<LifeUserMapper, LifeUser> {
|
|
|
return voList;
|
|
return voList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public LifeUserVo userLogin(String phoneNum, String inviteCode) {
|
|
|
|
|
|
|
+ public LifeUserVo userLogin(String phoneNum, String inviteCode, String macIp) {
|
|
|
LifeUser user = getUserByPhone(phoneNum);
|
|
LifeUser user = getUserByPhone(phoneNum);
|
|
|
if (user == null) {
|
|
if (user == null) {
|
|
|
LifeUser lifeUser = new LifeUser();
|
|
LifeUser lifeUser = new LifeUser();
|
|
@@ -165,6 +180,12 @@ public class LifeUserService extends ServiceImpl<LifeUserMapper, LifeUser> {
|
|
|
if(StringUtils.isNotEmpty(inviteCode)){
|
|
if(StringUtils.isNotEmpty(inviteCode)){
|
|
|
activityInviteConfigService.bindInviteCode(lifeUser.getId(), inviteCode);
|
|
activityInviteConfigService.bindInviteCode(lifeUser.getId(), inviteCode);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 二手平台登录log,同一个macip登录多账号记录
|
|
|
|
|
+ addLifeUserLogInfo(user2, macIp);
|
|
|
|
|
+ // 第一次登录,添加用户基础积分
|
|
|
|
|
+ alienSecondFeign.createPointsRecord(user2.getId(), 300, 1);
|
|
|
|
|
+
|
|
|
return userVo;
|
|
return userVo;
|
|
|
} else {
|
|
} else {
|
|
|
return null;
|
|
return null;
|
|
@@ -185,6 +206,9 @@ public class LifeUserService extends ServiceImpl<LifeUserMapper, LifeUser> {
|
|
|
activityInviteConfigService.bindInviteCode(user.getId(), inviteCode);
|
|
activityInviteConfigService.bindInviteCode(user.getId(), inviteCode);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 二手平台登录log,同一个macip登录多账号记录
|
|
|
|
|
+ addLifeUserLogInfo(user, macIp);
|
|
|
|
|
+
|
|
|
return userVo;
|
|
return userVo;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|