Blame | Last modification | View Log | RSS feed
package com.spice.profitmandi.web.v2.controller;import com.spice.profitmandi.service.integrations.pinelabs.dto.OfferDiscoveryRequest;import com.spice.profitmandi.web.controller.DealsController;import com.spice.profitmandi.web.v2.response.ApiResponse;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.http.ResponseEntity;import org.springframework.web.bind.annotation.*;import javax.servlet.http.HttpServletRequest;import java.util.Set;@RestController@RequestMapping("/v2")public class V2DealsController extends V2BaseController {@Autowiredprivate DealsController dealsController;@GetMapping("/fofo/buckets")public ResponseEntity<ApiResponse<?>> getBuckets(HttpServletRequest request) throws Throwable {return wrapResponse(dealsController.getBuckets(request));}@GetMapping("/fofo/bucket")public ResponseEntity<ApiResponse<?>> getBucketDetails(HttpServletRequest request,@RequestParam int id) throws Throwable {return wrapResponse(dealsController.getBucketDetails(request, id));}@GetMapping("/fofo/suggestedPo")public ResponseEntity<ApiResponse<?>> getSuggestedPo(HttpServletRequest request,@RequestParam int id) throws Throwable {return wrapResponse(dealsController.getSuggestedPo(request, id));}@GetMapping("/suggestedPo/status")public ResponseEntity<ApiResponse<?>> changeSuggestedPoStatus(HttpServletRequest request,@RequestParam int id) throws Throwable {return wrapResponse(dealsController.changeSuggestedPoStatus(request, id));}@GetMapping("/fofo/fovourites")public ResponseEntity<ApiResponse<?>> getFavourites(HttpServletRequest request) throws Throwable {return wrapResponse(dealsController.getFavourites(request));}@PostMapping("/favourites/manage")public ResponseEntity<ApiResponse<?>> mangeFavourites(HttpServletRequest request,@RequestParam int catalogId) throws Throwable {return wrapResponse(dealsController.mangeFavourites(request, catalogId));}@GetMapping("/fofo/similar-models/{modelId}")public ResponseEntity<ApiResponse<?>> similarModels(HttpServletRequest request,@PathVariable int modelId) throws Throwable {return wrapResponse(dealsController.similarModels(request, modelId));}@GetMapping("/fofo")public ResponseEntity<ApiResponse<?>> getFofo(HttpServletRequest request,@RequestParam(value = "categoryId", required = false, defaultValue = "3") String categoryId,@RequestParam(value = "offset") int offset,@RequestParam(value = "limit") int limit,@RequestParam(value = "sort", required = false) String sort,@RequestParam(value = "brand", required = false) String brand,@RequestParam(value = "subCategoryId", required = false) int subCategoryId,@RequestParam(value = "q", required = false) String queryTerm,@RequestParam(value = "hotDeal", required = false) boolean hotDeal,@RequestParam(value = "endPoint", required = false) String endPoint,@RequestParam(value = "group", required = false) boolean group) throws Throwable {return wrapResponse(dealsController.getFofo(request, categoryId, offset, limit, sort, brand, subCategoryId, queryTerm, hotDeal, endPoint, group));}@GetMapping("/online-deals")public ResponseEntity<ApiResponse<?>> getOnlineDeals(HttpServletRequest request,@RequestParam(value = "categoryId") String categoryId,@RequestParam(value = "offset") String offset,@RequestParam(value = "limit") String limit,@RequestParam(value = "sort", required = false) String sort,@RequestParam(value = "direction", required = false) String direction,@RequestParam(value = "filterData", required = false) String filterData) throws Throwable {return wrapResponse(dealsController.getOnlineDeals(request, categoryId, offset, limit, sort, direction, filterData));}@GetMapping("/brands")public ResponseEntity<ApiResponse<?>> getBrands(HttpServletRequest request,@RequestParam(value = "category_id") String category_id) throws Throwable {return wrapResponse(dealsController.getBrands(request, category_id));}@GetMapping("/deals/{id}")public ResponseEntity<ApiResponse<?>> getUnitDeal(HttpServletRequest request,@PathVariable(value = "id") long id) throws Throwable {return wrapResponse(dealsController.getUnitDeal(request, id));}@GetMapping("/partnerdeals/{id}")public ResponseEntity<ApiResponse<?>> getUnitFocoDeal(HttpServletRequest request,@PathVariable(value = "id") long id) throws Throwable {return wrapResponse(dealsController.getUnitFocoDeal(request, id));}@PostMapping("/suggestedPoDeals")public ResponseEntity<ApiResponse<?>> suggestedPoDeals(HttpServletRequest request,@RequestBody Set<Integer> catalogIds) throws Throwable {return wrapResponse(dealsController.suggestedPoDeals(request, catalogIds));}@GetMapping("/fofo/brands")public ResponseEntity<ApiResponse<?>> getBrandsToDisplay(HttpServletRequest request,@RequestParam(required = false, defaultValue = "0") int categoryId) throws Throwable {return wrapResponse(dealsController.getBrandsToDisplay(request, categoryId));}@GetMapping("/fofo/brandCatalog")public ResponseEntity<ApiResponse<?>> getBrandCatalog(HttpServletRequest request,@RequestParam(required = false, defaultValue = "0") int categoryId) throws Throwable {return wrapResponse(dealsController.getBrands(request, categoryId));}@GetMapping("/fofo/accessory/all-categories")public ResponseEntity<ApiResponse<?>> getSubCategoriesToDisplay(HttpServletRequest request) throws Throwable {return wrapResponse(dealsController.getSubCategoriesToDisplay(request));}@GetMapping("/fofo/categories")public ResponseEntity<ApiResponse<?>> getFofoCategories() throws Throwable {return wrapResponse(dealsController.getFofoCategories());}@GetMapping("/banners/{bannerType}")public ResponseEntity<ApiResponse<?>> getBanners(@PathVariable String bannerType) throws Throwable {return wrapResponse(dealsController.getBanners(bannerType));}@GetMapping("/deals/subCategories")public ResponseEntity<ApiResponse<?>> getSubcategoriesToDisplay() throws Throwable {return wrapResponse(dealsController.getSubcategoriesToDisplay());}@GetMapping("/deals/skus/{skus}")public ResponseEntity<ApiResponse<?>> getDealsBySkus(@PathVariable String skus) throws Throwable {return wrapResponse(dealsController.getDealsBySkus(skus));}@GetMapping("/partner/listing")public ResponseEntity<ApiResponse<?>> getPartnersListing(HttpServletRequest request) throws Throwable {return wrapResponse(dealsController.getPartnersListing(request));}@GetMapping("/combo")public ResponseEntity<ApiResponse<?>> getCombo(@RequestParam int catalogId,@RequestParam int warehouseId) throws Throwable {return wrapResponse(dealsController.getBanners(catalogId, warehouseId));}@GetMapping("/checkCombo")public ResponseEntity<ApiResponse<?>> checkCombo(HttpServletRequest request,@RequestParam int catalogId,@RequestParam int warehouseId,@RequestParam int qty) throws Throwable {return wrapResponse(dealsController.checkCombo(request, catalogId, warehouseId, qty));}@GetMapping("/partner/wodCompleteBrands")public ResponseEntity<ApiResponse<?>> getWodcompletBrands(HttpServletRequest request) throws Throwable {return wrapResponse(dealsController.getWodcompletBrands(request));}@PostMapping("/pinelabs/offers")public ResponseEntity<ApiResponse<?>> getPineLabsOffers(@RequestBody OfferDiscoveryRequest offerDiscoveryRequest) throws Throwable {return wrapResponse(dealsController.getPineLabsOffers(offerDiscoveryRequest));}@GetMapping("/pinelabs/offers/cache")public ResponseEntity<ApiResponse<?>> cachePineLabsOffers() throws Throwable {return wrapResponse(dealsController.cachePineLabsOffers());}@GetMapping("/pinelabs/offers/{itemId}")public ResponseEntity<ApiResponse<?>> pineLabsOfferById(@PathVariable int itemId) throws Throwable {return wrapResponse(dealsController.pineLabsOfferById(itemId));}}