Subversion Repositories SmartDukaan

Rev

Rev 36321 | Rev 36591 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36321 Rev 36538
Line 96... Line 96...
96
    }
96
    }
97
 
97
 
98
    @GetMapping("/partnerdeals/{id}")
98
    @GetMapping("/partnerdeals/{id}")
99
    public ResponseEntity<ApiResponse<?>> getUnitFocoDeal(HttpServletRequest request,
99
    public ResponseEntity<ApiResponse<?>> getUnitFocoDeal(HttpServletRequest request,
100
                                                          @PathVariable(value = "id") long id) throws Throwable {
100
                                                          @PathVariable(value = "id") long id) throws Throwable {
-
 
101
        try {
101
        return wrapResponse(dealsController.getUnitFocoDeal(request, id));
102
            return wrapResponse(dealsController.getUnitFocoDeal(request, id));
-
 
103
        } catch (IndexOutOfBoundsException e) {
-
 
104
            java.util.Map<String, Object> err = new java.util.HashMap<>();
-
 
105
            err.put("message", "Product not found for catalogId: " + id);
-
 
106
            return ResponseEntity.status(404).body(ApiResponse.success(err));
-
 
107
        }
102
    }
108
    }
103
 
109
 
104
    @PostMapping("/suggestedPoDeals")
110
    @PostMapping("/suggestedPoDeals")
105
    public ResponseEntity<ApiResponse<?>> suggestedPoDeals(HttpServletRequest request,
111
    public ResponseEntity<ApiResponse<?>> suggestedPoDeals(HttpServletRequest request,
106
                                                           @RequestBody Set<Integer> catalogIds) throws Throwable {
112
                                                           @RequestBody Set<Integer> catalogIds) throws Throwable {