Subversion Repositories SmartDukaan

Rev

Rev 35758 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35758 Rev 35801
Line 718... Line 718...
718
 
718
 
719
        return subCategories;
719
        return subCategories;
720
 
720
 
721
    }
721
    }
722
 
722
 
-
 
723
    @RequestMapping(value = "/fofo/categories", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-
 
724
    public ResponseEntity<?> getFofoCategories() {
-
 
725
        Map<Integer, Category> categoryMap = categoryRepository.selectAll();
-
 
726
        List<Map<String, Object>> result = new ArrayList<>();
-
 
727
        for (Category category : categoryMap.values()) {
-
 
728
            if (category.isStatus()) {
-
 
729
                Map<String, Object> cat = new HashMap<>();
-
 
730
                cat.put("id", category.getId());
-
 
731
                cat.put("label", category.getLabel());
-
 
732
                cat.put("displayName", category.getDisplayName());
-
 
733
                cat.put("parentCategoryId", category.getParentCategoryId());
-
 
734
                cat.put("marginOnly", category.isMarginOnly());
-
 
735
                result.add(cat);
-
 
736
            }
-
 
737
        }
-
 
738
        return responseSender.ok(result);
-
 
739
    }
-
 
740
 
723
    @RequestMapping(value = "/banners/{bannerType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
741
    @RequestMapping(value = "/banners/{bannerType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
724
    public ResponseEntity<?> getBanners(@PathVariable String bannerType) {
742
    public ResponseEntity<?> getBanners(@PathVariable String bannerType) {
725
        return new ResponseEntity<>(mongoClient.getBannersByType(bannerType), HttpStatus.OK);
743
        return new ResponseEntity<>(mongoClient.getBannersByType(bannerType), HttpStatus.OK);
726
    }
744
    }
727
 
745