| Line 198... |
Line 198... |
| 198 |
private String getToken(String emailId) throws Exception {
|
198 |
private String getToken(String emailId) throws Exception {
|
| 199 |
List<NameValuePair> nameValuePairs = new ArrayList<>();
|
199 |
List<NameValuePair> nameValuePairs = new ArrayList<>();
|
| 200 |
nameValuePairs.add(new BasicNameValuePair("adminToken", this.adminToken));
|
200 |
nameValuePairs.add(new BasicNameValuePair("adminToken", this.adminToken));
|
| 201 |
nameValuePairs.add(new BasicNameValuePair("emailId", emailId));
|
201 |
nameValuePairs.add(new BasicNameValuePair("emailId", emailId));
|
| 202 |
String queryString = URLEncodedUtils.format(nameValuePairs, "UTF-8");
|
202 |
String queryString = URLEncodedUtils.format(nameValuePairs, "UTF-8");
|
| 203 |
String response = restClient.post("http://app.smartdukaan.com:8080/profitmandi-web/user/admin?" + queryString,
|
203 |
String response = restClient.post(this.appTokenUrl + queryString,
|
| 204 |
new HashMap<>(), new HashMap<>());
|
204 |
new HashMap<>(), new HashMap<>());
|
| 205 |
Type t = new TypeToken<ProfitMandiResponse<Map<String, Object>>>() {
|
205 |
Type t = new TypeToken<ProfitMandiResponse<Map<String, Object>>>() {
|
| 206 |
}.getType();
|
206 |
}.getType();
|
| 207 |
ProfitMandiResponse<Map<String, Object>> apiResponse = new Gson().fromJson(response, t);
|
207 |
ProfitMandiResponse<Map<String, Object>> apiResponse = new Gson().fromJson(response, t);
|
| 208 |
if (apiResponse.getStatusCode().equals("200")) {
|
208 |
if (apiResponse.getStatusCode().equals("200")) {
|