| Line 66... |
Line 66... |
| 66 |
public ResponseEntity<?> getById(HttpServletRequest request, @RequestParam(name = "id") int id){
|
66 |
public ResponseEntity<?> getById(HttpServletRequest request, @RequestParam(name = "id") int id){
|
| 67 |
LOGGER.info("requested url : "+request.getRequestURL().toString());
|
67 |
LOGGER.info("requested url : "+request.getRequestURL().toString());
|
| 68 |
try {
|
68 |
try {
|
| 69 |
return responseSender.ok(addressRepository.selectById(id));
|
69 |
return responseSender.ok(addressRepository.selectById(id));
|
| 70 |
}catch (ProfitMandiBusinessException profitMandiBusinessException) {
|
70 |
}catch (ProfitMandiBusinessException profitMandiBusinessException) {
|
| 71 |
LOGGER.error("ProfitMandi error: ", profitMandiBusinessException);
|
71 |
LOGGER.warn("ProfitMandi error: ", profitMandiBusinessException);
|
| 72 |
return responseSender.badRequest(profitMandiBusinessException);
|
72 |
return responseSender.badRequest(profitMandiBusinessException);
|
| 73 |
}
|
73 |
}
|
| 74 |
}
|
74 |
}
|
| 75 |
|
75 |
|
| 76 |
@RequestMapping(value = "/pin-info/{pinCode}", method=RequestMethod.GET)
|
76 |
@RequestMapping(value = "/pin-info/{pinCode}", method=RequestMethod.GET)
|
| Line 81... |
Line 81... |
| 81 |
Map<String, String> params = new HashMap<>();
|
81 |
Map<String, String> params = new HashMap<>();
|
| 82 |
String response = rc.get(SchemeType.HTTP, host, port, remoteUrl, params);
|
82 |
String response = rc.get(SchemeType.HTTP, host, port, remoteUrl, params);
|
| 83 |
JsonObject result_json = Json.parse(response).asObject();
|
83 |
JsonObject result_json = Json.parse(response).asObject();
|
| 84 |
return responseSender.ok(result_json);
|
84 |
return responseSender.ok(result_json);
|
| 85 |
}catch (ProfitMandiBusinessException profitMandiBusinessException) {
|
85 |
}catch (ProfitMandiBusinessException profitMandiBusinessException) {
|
| 86 |
LOGGER.error("ProfitMandi error: ", profitMandiBusinessException);
|
86 |
LOGGER.warn("ProfitMandi error: ", profitMandiBusinessException);
|
| 87 |
return responseSender.badRequest(profitMandiBusinessException);
|
87 |
return responseSender.badRequest(profitMandiBusinessException);
|
| 88 |
}catch (HttpHostConnectException hhce) {
|
88 |
}catch (HttpHostConnectException hhce) {
|
| 89 |
LOGGER.error("Cannot connect to remote url: {}", remoteUrl);
|
89 |
LOGGER.error("Cannot connect to remote url: {}", remoteUrl);
|
| 90 |
return responseSender.badRequest(new ProfitMandiBusinessException("None", "None", "cannot connect to remote url" + remoteUrl));
|
90 |
return responseSender.badRequest(new ProfitMandiBusinessException("None", "None", "cannot connect to remote url" + remoteUrl));
|
| 91 |
|
91 |
|