@GET
@Path("wishlist")
@Produces(MediaType.APPLICATION_JSON)
public WishlistPojoResponse getWishlist(final WishlistPojoRequest wishlistPojoRequest) {
WishlistPojoResponse wishlistPojoResponse = new WishlistPojoResponse();
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (!(authentication instanceof AnonymousAuthenticationToken)) {
String currentCustomerName = authentication.getName();
if(StringUtils.isNotEmpty(currentCustomerName)){
if(StringUtils.isNotEmpty(wishlistPojoRequest.getMarketAreaCode())){
Customer customer = customerService.getCustomerByLoginOrEmail(currentCustomerName);
MarketArea marketArea = marketService.getMarketAreaByCode(wishlistPojoRequest.getMarketAreaCode());
List<CustomerWishlistPojo> wishlists = customerPojoService.getWishlist(customer, marketArea);
wishlistPojoResponse.setWishlists(wishlists);
return wishlistPojoResponse;
} else {
// SEND ERREUR
}