| Line 496... |
Line 496... |
| 496 |
|
496 |
|
| 497 |
@RequestMapping(value = "/mobileappsettings")
|
497 |
@RequestMapping(value = "/mobileappsettings")
|
| 498 |
public ResponseEntity<?> mobileAppSettings(HttpServletRequest request, @RequestParam(name = "t") int timestamp,
|
498 |
public ResponseEntity<?> mobileAppSettings(HttpServletRequest request, @RequestParam(name = "t") int timestamp,
|
| 499 |
@RequestParam(name = "imeinumber") String imeinumber)
|
499 |
@RequestParam(name = "imeinumber") String imeinumber)
|
| 500 |
throws ProfitMandiBusinessException, ClientProtocolException, IOException {
|
500 |
throws ProfitMandiBusinessException, ClientProtocolException, IOException {
|
| 501 |
LocalDateTime settingsLastUpdated = LocalDateTime.ofEpochSecond(timestamp, 0, ZoneOffset.ofHoursMinutes(5, 30));
|
- |
|
| 502 |
List<MobileAppSetting> mobileAppSettings = mobileAppSettingsRepository.getSettingAftera(settingsLastUpdated);
|
- |
|
| 503 |
|
501 |
|
| 504 |
List<MobileAppSettingsWrapper> mobileSettingsWrappersList = mobileAppSettings.stream()
|
- |
|
| 505 |
.map(x -> new MobileAppSettingsWrapper(x)).collect(Collectors.toList());
|
- |
|
| 506 |
SettingsWrapper wrapper = new SettingsWrapper(mobileSettingsWrappersList);
|
- |
|
| 507 |
|
- |
|
| 508 |
/*
|
- |
|
| 509 |
* LOGGER.info("Wrapper {}", wrapper); return responseSender.ok(wrapper);
|
- |
|
| 510 |
*/
|
- |
|
| 511 |
final String uri = "http://192.168.158.89/mobileappsettings?t=" + timestamp + "&imeinumber=" + imeinumber;
|
502 |
final String uri = "http://192.168.158.89/mobileappsettings?t=" + timestamp + "&imeinumber=" + imeinumber;
|
| 512 |
final String BASIC_AUTH = "Basic " + Base64.getEncoder().encodeToString("dtr:dtr18Feb2015".getBytes());
|
503 |
final String BASIC_AUTH = "Basic " + Base64.getEncoder().encodeToString("dtr:dtr18Feb2015".getBytes());
|
| 513 |
Map<String, String> headers = new HashMap<>();
|
504 |
Map<String, String> headers = new HashMap<>();
|
| 514 |
Map<String, String> params = new HashMap<>();
|
505 |
Map<String, String> params = new HashMap<>();
|
| 515 |
headers.put("Authorization", BASIC_AUTH);
|
506 |
headers.put("Authorization", BASIC_AUTH);
|
| 516 |
headers.put("Authorization", BASIC_AUTH);
|
- |
|
| 517 |
return responseSender.ok(restClient.post(uri, params, headers));
|
507 |
return responseSender.ok(restClient.post(uri, params, headers));
|
| 518 |
}
|
508 |
}
|
| 519 |
|
509 |
|
| 520 |
@RequestMapping(value = "/mobileappsettings1", method = RequestMethod.POST)
|
510 |
@RequestMapping(value = "/mobileappsettings1", method = RequestMethod.POST)
|
| 521 |
public ResponseEntity<?> mobileAppSettings1(HttpServletRequest request, @RequestParam(name = "t") int timestamp,
|
511 |
public ResponseEntity<?> mobileAppSettings1(HttpServletRequest request, @RequestParam(name = "t") int timestamp,
|