Subversion Repositories SmartDukaan

Rev

Rev 22111 | Rev 23505 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22111 Rev 22217
Line 2... Line 2...
2
 
2
 
3
import java.io.IOException;
3
import java.io.IOException;
4
import java.util.HashMap;
4
import java.util.HashMap;
5
import java.util.Map;
5
import java.util.Map;
6
 
6
 
-
 
7
import org.springframework.http.HttpHeaders;
-
 
8
import org.springframework.http.MediaType;
7
import org.springframework.stereotype.Component;
9
import org.springframework.stereotype.Component;
8
 
10
 
9
import com.fasterxml.jackson.core.JsonProcessingException;
11
import com.fasterxml.jackson.core.JsonProcessingException;
10
import com.fasterxml.jackson.databind.JsonNode;
12
import com.fasterxml.jackson.databind.JsonNode;
11
import com.fasterxml.jackson.databind.ObjectMapper;
13
import com.fasterxml.jackson.databind.ObjectMapper;
Line 24... Line 26...
24
	
26
	
25
	public String getEmailId(String token) throws ProfitMandiBusinessException{
27
	public String getEmailId(String token) throws ProfitMandiBusinessException{
26
		RestClient restClient = new RestClient(SchemeType.HTTPS, V3_HOST_NAME, PORT_NUMBER);
28
		RestClient restClient = new RestClient(SchemeType.HTTPS, V3_HOST_NAME, PORT_NUMBER);
27
		Map<String, String> params = new HashMap<>();
29
		Map<String, String> params = new HashMap<>();
28
		params.put(ProfitMandiConstants.ID_TOKEN, token);
30
		params.put(ProfitMandiConstants.ID_TOKEN, token);
-
 
31
		Map<String, String> headers = new HashMap<>(1);
-
 
32
		headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
29
		String responseString = restClient.get(V3_URI, params);
33
		String responseString = restClient.get(V3_URI, params, headers);
30
		try {
34
		try {
31
			JsonNode rootNode = objectMapper.readTree(responseString);
35
			JsonNode rootNode = objectMapper.readTree(responseString);
32
			return rootNode.get("email").asText();
36
			return rootNode.get("email").asText();
33
			
37
			
34
		}catch (JsonProcessingException jsonProcessingException) {
38
		}catch (JsonProcessingException jsonProcessingException) {