Subversion Repositories SmartDukaan

Rev

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

Rev 25015 Rev 25125
Line 296... Line 296...
296
			}
296
			}
297
		}
297
		}
298
		return responseSender.ok(responseObject);
298
		return responseSender.ok(responseObject);
299
	}
299
	}
300
 
300
 
301
	/*
-
 
302
	 * @RequestMapping(value = "/direct-deals", method=RequestMethod.GET,produces =
-
 
303
	 * MediaType.APPLICATION_JSON_VALUE)
-
 
304
	 * 
-
 
305
	 * @ApiImplicitParams({
-
 
306
	 * 
-
 
307
	 * @ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true,
-
 
308
	 * dataType = "string", paramType = "header") }) public ResponseEntity<?>
-
 
309
	 * getDirectDeals(HttpServletRequest request, @RequestParam(value="categoryId")
-
 
310
	 * String categoryId,@RequestParam(value="offset") String offset,
-
 
311
	 * 
-
 
312
	 * @RequestParam(value="limit") String limit, @RequestParam(value="sort",
-
 
313
	 * required=false) String sort, @RequestParam(value="direction", required=false)
-
 
314
	 * String direction,
-
 
315
	 * 
-
 
316
	 * @RequestParam(value="filterData", required=false) String filterData ){
-
 
317
	 * 
-
 
318
	 * return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK); }
-
 
319
	 */
-
 
320
 
-
 
321
	private Object toDealObject(JsonObject jsonObject) {
301
	private Object toDealObject(JsonObject jsonObject) {
322
		if (jsonObject.get("dealObject") != null && jsonObject.get("dealObject").asInt() == 1) {
302
		if (jsonObject.get("dealObject") != null && jsonObject.get("dealObject").asInt() == 1) {
323
			return new Gson().fromJson(jsonObject.toString(), DealObjectResponse.class);
303
			return new Gson().fromJson(jsonObject.toString(), DealObjectResponse.class);
324
		}
304
		}
325
		return new Gson().fromJson(jsonObject.toString(), DealsResponse.class);
305
		return new Gson().fromJson(jsonObject.toString(), DealsResponse.class);
Line 378... Line 358...
378
				AvailabilityInfo ai = iter.next();
358
				AvailabilityInfo ai = iter.next();
379
				if (ai.getAvailability() <= 0)
359
				if (ai.getAvailability() <= 0)
380
					iter.remove();
360
					iter.remove();
381
			}
361
			}
382
		}
362
		}
383
		/*
-
 
384
		 * final ProfitMandiResponse<?> profitMandiResponse = new
-
 
385
		 * ProfitMandiResponse<>(LocalDateTime.now(),
-
 
386
		 * request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK,
-
 
387
		 * ResponseStatus.SUCCESS, dealsResponse);
-
 
388
		 */
-
 
389
		return responseSender.ok(dealsResponse);
363
		return responseSender.ok(dealsResponse);
390
	}
364
	}
391
 
365
 
392
	@RequestMapping(value = "/partnerdeals/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
366
	@RequestMapping(value = "/partnerdeals/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
393
	@ApiImplicitParams({
367
	@ApiImplicitParams({
Line 449... Line 423...
449
		Map<String, String> params = new HashMap<>();
423
		Map<String, String> params = new HashMap<>();
450
		params.put("q", "categoryId_i:6");
424
		params.put("q", "categoryId_i:6");
451
		params.put("group", "true");
425
		params.put("group", "true");
452
		params.put("group.field", "subCategoryId_i");
426
		params.put("group.field", "subCategoryId_i");
453
		params.put("wt", "json");
427
		params.put("wt", "json");
-
 
428
		params.put("row", "50");
454
		params.put("fl", "subCategoryId_i");
429
		params.put("fl", "subCategoryId_i");
455
		String response = null;
430
		String response = null;
456
		try {
431
		try {
457
			response = rc.get(SchemeType.HTTP, "dtr", 8984, "solr/demo/select", params);
432
			response = rc.get(SchemeType.HTTP, "dtr", 8984, "solr/demo/select", params);
458
		} catch (HttpHostConnectException e) {
433
		} catch (HttpHostConnectException e) {