Subversion Repositories SmartDukaan

Rev

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

Rev 25436 Rev 25452
Line 193... Line 193...
193
	private String getToken(String emailId) throws Exception {
193
	private String getToken(String emailId) throws Exception {
194
		List<NameValuePair> nameValuePairs = new ArrayList<>();
194
		List<NameValuePair> nameValuePairs = new ArrayList<>();
195
		nameValuePairs.add(new BasicNameValuePair("adminToken", "ecip$stgMay2014"));
195
		nameValuePairs.add(new BasicNameValuePair("adminToken", "ecip$stgMay2014"));
196
		nameValuePairs.add(new BasicNameValuePair("emailId", emailId));
196
		nameValuePairs.add(new BasicNameValuePair("emailId", emailId));
197
		String queryString = URLEncodedUtils.format(nameValuePairs, "UTF-8");
197
		String queryString = URLEncodedUtils.format(nameValuePairs, "UTF-8");
198
		String response = restClient.post("http://app.profitmandi.com:8080/profitmandi-web/user/admin?" + queryString,
198
		String response = restClient.post("http://app.smartdukaan.com:8080/profitmandi-web/user/admin?" + queryString,
199
				new HashMap<>(), new HashMap<>());
199
				new HashMap<>(), new HashMap<>());
200
		Type t = new TypeToken<ProfitMandiResponse<Map<String, Object>>>() {
200
		Type t = new TypeToken<ProfitMandiResponse<Map<String, Object>>>() {
201
		}.getType();
201
		}.getType();
202
		ProfitMandiResponse<Map<String, Object>> apiResponse = new Gson().fromJson(response, t);
202
		ProfitMandiResponse<Map<String, Object>> apiResponse = new Gson().fromJson(response, t);
203
		if (apiResponse.getStatusCode().equals("200")) {
203
		if (apiResponse.getStatusCode().equals("200")) {