| Line 24... |
Line 24... |
| 24 |
import com.spice.profitmandi.common.model.GoogleLoginRequest;
|
24 |
import com.spice.profitmandi.common.model.GoogleLoginRequest;
|
| 25 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
25 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 26 |
import com.spice.profitmandi.common.util.JWTUtil;
|
26 |
import com.spice.profitmandi.common.util.JWTUtil;
|
| 27 |
import com.spice.profitmandi.common.util.Utils;
|
27 |
import com.spice.profitmandi.common.util.Utils;
|
| 28 |
import com.spice.profitmandi.common.web.client.RestClient;
|
28 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| - |
|
29 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 29 |
import com.spice.profitmandi.dao.entity.dtr.SocialUser;
|
30 |
import com.spice.profitmandi.dao.entity.dtr.SocialUser;
|
| 30 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
31 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 31 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
32 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
| 32 |
import com.spice.profitmandi.dao.enumuration.dtr.Gender;
|
33 |
import com.spice.profitmandi.dao.enumuration.dtr.Gender;
|
| 33 |
import com.spice.profitmandi.dao.enumuration.dtr.SocialType;
|
34 |
import com.spice.profitmandi.dao.enumuration.dtr.SocialType;
|
| Line 135... |
Line 136... |
| 135 |
LOGGER.info("3");
|
136 |
LOGGER.info("3");
|
| 136 |
String name = authService.getNameByEmailId(socialUser.getEmailId());
|
137 |
String name = authService.getNameByEmailId(socialUser.getEmailId());
|
| 137 |
LOGGER.info("User Name from getNameByEmailId({}) is {}", socialUser.getEmailId(), name);
|
138 |
LOGGER.info("User Name from getNameByEmailId({}) is {}", socialUser.getEmailId(), name);
|
| 138 |
if(name != null) {
|
139 |
if(name != null) {
|
| 139 |
User registeredUser = null;
|
140 |
User registeredUser = null;
|
| - |
|
141 |
AuthUser authUser = authRepository.selectByGmailId(socialUser.getEmailId());
|
| - |
|
142 |
|
| 140 |
if(authRepository.selectByGmailId(socialUser.getEmailId())!=null) {
|
143 |
if(authRepository.selectByGmailId(socialUser.getEmailId())!=null) {
|
| 141 |
registeredUser = userRepository.selectByEmailId(Utils.SYSTEM_PARTNER);
|
144 |
registeredUser = userRepository.selectByEmailId(authUser.getEmailId());
|
| 142 |
} else if(promoterRepository.isExistByEmailId(socialUser.getEmailId())) {
|
145 |
} else if(promoterRepository.isExistByEmailId(socialUser.getEmailId())) {
|
| 143 |
Promoter promoter = promoterRepository.selectByEmailId(socialUser.getEmailId());
|
146 |
Promoter promoter = promoterRepository.selectByEmailId(socialUser.getEmailId());
|
| 144 |
int userId = userAccountRepository.selectUserIdByRetailerId(promoter.getRetailerId());
|
147 |
int userId = userAccountRepository.selectUserIdByRetailerId(promoter.getRetailerId());
|
| 145 |
registeredUser = userRepository.selectById(userId);
|
148 |
registeredUser = userRepository.selectById(userId);
|
| 146 |
} else if(userRepository.isExistBySecondryEmailId(socialUser.getEmailId())) {
|
149 |
} else if(userRepository.isExistBySecondryEmailId(socialUser.getEmailId())) {
|