Subversion Repositories SmartDukaan

Rev

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

Rev 21461 Rev 21462
Line 58... Line 58...
58
	@ApiOperation(value = "Get deals")
58
	@ApiOperation(value = "Get deals")
59
	public ResponseEntity<?> getDeals(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 ){
59
	public ResponseEntity<?> getDeals(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 ){
60
		logger.info("Request "+request.getParameterMap());
60
		logger.info("Request "+request.getParameterMap());
61
		String response = null;
61
		String response = null;
62
		int userId = (int)request.getAttribute("userId");
62
		int userId = (int)request.getAttribute("userId");
63
		//move to properties
63
		//TODO: move to properties
64
		String uri = "/deals/"+userId;
64
		String uri = "/deals/"+userId;
65
		RestClient rc = new RestClient(SchemeType.HTTP, host , port);
65
		RestClient rc = new RestClient(SchemeType.HTTP, host , port);
66
		Map<String, String> params = new HashMap<>();
66
		Map<String, String> params = new HashMap<>();
67
		params.put("offset", offset);
67
		params.put("offset", offset);
68
		params.put("limit", limit);
68
		params.put("limit", limit);
Line 108... Line 108...
108
	})
108
	})
109
	@ApiOperation(value = "Get brand list and count for category")
109
	@ApiOperation(value = "Get brand list and count for category")
110
	public ResponseEntity<?> getBrands(HttpServletRequest request, @RequestParam(value="category_id") String category_id){
110
	public ResponseEntity<?> getBrands(HttpServletRequest request, @RequestParam(value="category_id") String category_id){
111
		logger.info("Request "+request.getParameterMap());
111
		logger.info("Request "+request.getParameterMap());
112
		String response = null;
112
		String response = null;
113
		//move to properties
113
		//TODO: move to properties
114
		String uri = ProfitMandiConstants.URL_BRANDS;
114
		String uri = ProfitMandiConstants.URL_BRANDS;
115
		RestClient rc = new RestClient(SchemeType.HTTP, host , port);
115
		RestClient rc = new RestClient(SchemeType.HTTP, host , port);
116
		Map<String, String> params = new HashMap<>();
116
		Map<String, String> params = new HashMap<>();
117
		params.put("category_id", category_id);
117
		params.put("category_id", category_id);
118
		List<DealBrands> dealBrandsResponse = null;
118
		List<DealBrands> dealBrandsResponse = null;
Line 134... Line 134...
134
				required = true, dataType = "string", paramType = "header")
134
				required = true, dataType = "string", paramType = "header")
135
	})
135
	})
136
	@ApiOperation(value = "Get unit deal object")
136
	@ApiOperation(value = "Get unit deal object")
137
	public ResponseEntity<?> getUnitDeal(HttpServletRequest request, @PathVariable(value="id") long id){
137
	public ResponseEntity<?> getUnitDeal(HttpServletRequest request, @PathVariable(value="id") long id){
138
		String response = null;
138
		String response = null;
139
		//move to properties
139
		//TODO: move to properties
140
		String uri = "getDealById/"+id;
140
		String uri = "getDealById/"+id;
141
		System.out.println("Unit deal "+uri);
141
		System.out.println("Unit deal "+uri);
142
		RestClient rc = new RestClient(SchemeType.HTTP, host , port);
142
		RestClient rc = new RestClient(SchemeType.HTTP, host , port);
143
		Map<String, String> params = new HashMap<>();
143
		Map<String, String> params = new HashMap<>();
144
		DealsResponse dealsResponse = null;
144
		DealsResponse dealsResponse = null;