| Line 239... |
Line 239... |
| 239 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
239 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
| 240 |
required = true, dataType = "string", paramType = "header")
|
240 |
required = true, dataType = "string", paramType = "header")
|
| 241 |
})
|
241 |
})
|
| 242 |
|
242 |
|
| 243 |
@ApiOperation(value = "Change address")
|
243 |
@ApiOperation(value = "Change address")
|
| 244 |
public ResponseEntity<?> changeAddress(HttpServletRequest request,@PathVariable(value="cartId") long cartId, @RequestParam(value="addressId") long addressId){
|
244 |
public ResponseEntity<?> changeAddress(HttpServletRequest request,@PathVariable(value="cartId") long cartId, @RequestParam(value="addressId") long addressId) throws Throwable{
|
| 245 |
ProfitMandiResponse<?> profitMandiResponse;
|
- |
|
| 246 |
try {
|
- |
|
| 247 |
UserContextService.Client userClient = new UserClient().getClient();
|
245 |
UserContextService.Client userClient = new UserClient().getClient();
|
| 248 |
userClient.addAddressToCart(cartId, addressId);
|
246 |
userClient.addAddressToCart(cartId, addressId);
|
| 249 |
return responseSender.ok("Address Changed successfully");
|
247 |
return responseSender.ok("Address Changed successfully");
|
| 250 |
} catch(Exception e) {
|
- |
|
| 251 |
profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, "Could not changed the address");
|
- |
|
| 252 |
logger.error("Unable to change address", e);
|
- |
|
| 253 |
}
|
- |
|
| 254 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
|
- |
|
| 255 |
}
|
248 |
}
|
| 256 |
}
|
249 |
}
|
| 257 |
|
250 |
|