| | |
| | | import java.util.Optional; |
| | | import java.util.stream.Stream; |
| | | |
| | | import com.pollex.pam.enums.ConsultantDetailEnum; |
| | | import com.pollex.pam.enums.CustomerDetailEnum; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.GrantedAuthority; |
| | | import org.springframework.security.core.context.SecurityContext; |
| | |
| | | } |
| | | |
| | | public static String getAgentNo() { |
| | | return getCurrentUserLogin().orElseGet(null); |
| | | Map<String, String> userDetails = getCurrentUserDetails(); |
| | | return userDetails.get(ConsultantDetailEnum.AGENT_NO.getValue()); |
| | | } |
| | | |
| | | // todo , should get id from user details |
| | | public static Long getCustomerId() { |
| | | // Map<String, String> userDetails = getCurrentUserDetails(); |
| | | // return Long.parseLong(userDetails.get("id")); |
| | | return Long.parseLong("2"); |
| | | Map<String, String> userDetails = getCurrentUserDetails(); |
| | | return Long.parseLong(userDetails.get(CustomerDetailEnum.ID.getValue())); |
| | | } |
| | | |
| | | public static Map<String, String> getCurrentUserDetails() { |