| Line 5... |
Line 5... |
| 5 |
|
5 |
|
| 6 |
import javax.servlet.http.Cookie;
|
6 |
import javax.servlet.http.Cookie;
|
| 7 |
import javax.servlet.http.HttpServletRequest;
|
7 |
import javax.servlet.http.HttpServletRequest;
|
| 8 |
import javax.servlet.http.HttpServletResponse;
|
8 |
import javax.servlet.http.HttpServletResponse;
|
| 9 |
|
9 |
|
| - |
|
10 |
import org.apache.commons.lang3.StringUtils;
|
| 10 |
import org.slf4j.Logger;
|
11 |
import org.slf4j.Logger;
|
| 11 |
import org.slf4j.LoggerFactory;
|
12 |
import org.slf4j.LoggerFactory;
|
| 12 |
import org.springframework.stereotype.Component;
|
13 |
import org.springframework.stereotype.Component;
|
| 13 |
|
14 |
|
| 14 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
15 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| Line 33... |
Line 34... |
| 33 |
fofoIdFound = cookie.getValue();
|
34 |
fofoIdFound = cookie.getValue();
|
| 34 |
}
|
35 |
}
|
| 35 |
if(cookie.getName().equals(ProfitMandiConstants.EMAIL_ID) && cookie.getValue() != null && !cookie.getValue().isEmpty()){
|
36 |
if(cookie.getName().equals(ProfitMandiConstants.EMAIL_ID) && cookie.getValue() != null && !cookie.getValue().isEmpty()){
|
| 36 |
emailIdFound = cookie.getValue();
|
37 |
emailIdFound = cookie.getValue();
|
| 37 |
}
|
38 |
}
|
| 38 |
if(cookie.getName().equals(ProfitMandiConstants.ROLE_NAMES) && cookie.getValue() != null && !cookie.getValue().isEmpty()){
|
39 |
if(cookie.getName().equals(ProfitMandiConstants.ROLE_NAMES) && cookie.getValue() != null){
|
| 39 |
roleNamesString = cookie.getValue();
|
40 |
roleNamesString = cookie.getValue();
|
| 40 |
}
|
41 |
}
|
| 41 |
if(cookie.getName().equals(ProfitMandiConstants.FOFO_FLAG) && cookie.getValue() != null && !cookie.getValue().isEmpty()){
|
42 |
if(cookie.getName().equals(ProfitMandiConstants.FOFO_FLAG) && cookie.getValue() != null && !cookie.getValue().isEmpty()){
|
| 42 |
fofoFlagFound = cookie.getValue();
|
43 |
fofoFlagFound = cookie.getValue();
|
| 43 |
}
|
44 |
}
|
| Line 51... |
Line 52... |
| 51 |
throw new ProfitMandiBusinessException("", "", "");
|
52 |
throw new ProfitMandiBusinessException("", "", "");
|
| 52 |
}else{
|
53 |
}else{
|
| 53 |
LoginDetails fofoDetails = new LoginDetails();
|
54 |
LoginDetails fofoDetails = new LoginDetails();
|
| 54 |
fofoDetails.setFofoId(Integer.parseInt(fofoIdFound));
|
55 |
fofoDetails.setFofoId(Integer.parseInt(fofoIdFound));
|
| 55 |
fofoDetails.setEmailId(emailIdFound);
|
56 |
fofoDetails.setEmailId(emailIdFound);
|
| 56 |
String[] roleNames = roleNamesString.split(",");
|
57 |
String[] roleNames = StringUtils.split(roleNamesString, ",");
|
| 57 |
Set<RoleType> roleTypes = new HashSet<>();
|
58 |
Set<RoleType> roleTypes = new HashSet<>();
|
| 58 |
for(String roleName : roleNames){
|
59 |
for(String roleName : roleNames){
|
| 59 |
RoleType roleType = RoleType.valueOf(roleName);
|
60 |
RoleType roleType = RoleType.valueOf(roleName);
|
| 60 |
roleTypes.add(roleType);
|
61 |
roleTypes.add(roleType);
|
| 61 |
}
|
62 |
}
|