Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

package com.spice.profitmandi.web.v2.controller;

import com.spice.profitmandi.web.controller.guest.GuestController;
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;

@RestController
@RequestMapping("/v2")
public class V2GuestController extends V2BaseController {

    @Autowired
    private GuestController guestController;

    @GetMapping("/guest/deals")
    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(guestController.getFofo(request, categoryId, offset, limit, sort, brand, subCategoryId, queryTerm, hotDeal, endPoint, group));
    }
}