Subversion Repositories SmartDukaan

Rev

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

Rev 22905 Rev 22906
Line 116... Line 116...
116
			params.put("tag_ids", getCommaSeparateTags(userId));
116
			params.put("tag_ids", getCommaSeparateTags(userId));
117
		}
117
		}
118
		List<Object> responseObject = new ArrayList<>();
118
		List<Object> responseObject = new ArrayList<>();
119
		try {
119
		try {
120
			response = rc.get(uri, params);
120
			response = rc.get(uri, params);
121
		} catch (ProfitMandiBusinessException e) {
121
		} catch (Exception e) {
122
			logger.error("Unable to get deals", e);
122
			logger.error("Unable to get deals", e);
123
			final ProfitMandiResponse<?> profitMandiResponse = new ProfitMandiResponse<>(LocalDateTime.now(),
123
			final ProfitMandiResponse<?> profitMandiResponse = new ProfitMandiResponse<>(LocalDateTime.now(),
124
					request.getRequestURL().toString(), HttpStatus.INTERNAL_SERVER_ERROR.toString(),
124
					request.getRequestURL().toString(), HttpStatus.INTERNAL_SERVER_ERROR.toString(),
125
					HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, responseObject);
125
					HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, responseObject);
126
			return new ResponseEntity<>(profitMandiResponse, HttpStatus.INTERNAL_SERVER_ERROR);
126
			return new ResponseEntity<>(profitMandiResponse, HttpStatus.INTERNAL_SERVER_ERROR);
Line 250... Line 250...
250
			params.put("tag_ids", getCommaSeparateTags(userId));
250
			params.put("tag_ids", getCommaSeparateTags(userId));
251
		}*/
251
		}*/
252
		List<Object> responseObject = new ArrayList<>();
252
		List<Object> responseObject = new ArrayList<>();
253
		try {
253
		try {
254
			response = rc.get(uri, params);
254
			response = rc.get(uri, params);
255
		} catch (ProfitMandiBusinessException e) {
255
		} catch (Exception e) {
256
			logger.error("Unable to get deals", e);
256
			logger.error("Unable to get deals", e);
257
			final ProfitMandiResponse<?> profitMandiResponse = new ProfitMandiResponse<>(LocalDateTime.now(),
257
			final ProfitMandiResponse<?> profitMandiResponse = new ProfitMandiResponse<>(LocalDateTime.now(),
258
					request.getRequestURL().toString(), HttpStatus.INTERNAL_SERVER_ERROR.toString(),
258
					request.getRequestURL().toString(), HttpStatus.INTERNAL_SERVER_ERROR.toString(),
259
					HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, responseObject);
259
					HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, responseObject);
260
			return new ResponseEntity<>(profitMandiResponse, HttpStatus.INTERNAL_SERVER_ERROR);
260
			return new ResponseEntity<>(profitMandiResponse, HttpStatus.INTERNAL_SERVER_ERROR);
Line 318... Line 318...
318
		Map<String, String> params = new HashMap<>();
318
		Map<String, String> params = new HashMap<>();
319
		params.put("category_id", category_id);
319
		params.put("category_id", category_id);
320
		List<DealBrands> dealBrandsResponse = null;
320
		List<DealBrands> dealBrandsResponse = null;
321
		try {
321
		try {
322
			response = rc.get(uri, params);
322
			response = rc.get(uri, params);
323
		} catch (ProfitMandiBusinessException e) {
323
		} catch (Exception e) {
324
			logger.error("Unable to get deals", e);
324
			logger.error("Unable to get deals", e);
325
			final ProfitMandiResponse<?> profitMandiResponse = new ProfitMandiResponse<>(LocalDateTime.now(),
325
			final ProfitMandiResponse<?> profitMandiResponse = new ProfitMandiResponse<>(LocalDateTime.now(),
326
					request.getRequestURL().toString(), HttpStatus.INTERNAL_SERVER_ERROR.toString(),
326
					request.getRequestURL().toString(), HttpStatus.INTERNAL_SERVER_ERROR.toString(),
327
					HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, dealBrandsResponse);
327
					HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, dealBrandsResponse);
328
			return new ResponseEntity<>(profitMandiResponse, HttpStatus.INTERNAL_SERVER_ERROR);
328
			return new ResponseEntity<>(profitMandiResponse, HttpStatus.INTERNAL_SERVER_ERROR);
Line 347... Line 347...
347
		RestClient rc = new RestClient(SchemeType.HTTP, host, port);
347
		RestClient rc = new RestClient(SchemeType.HTTP, host, port);
348
		Map<String, String> params = new HashMap<>();
348
		Map<String, String> params = new HashMap<>();
349
		DealsResponse dealsResponse = null;
349
		DealsResponse dealsResponse = null;
350
		try {
350
		try {
351
			response = rc.get(uri, params);
351
			response = rc.get(uri, params);
352
		} catch (ProfitMandiBusinessException e) {
352
		} catch (Exception e) {
353
			logger.error("Unable to get deals", e);
353
			logger.error("Unable to get deals", e);
354
			final ProfitMandiResponse<?> profitMandiResponse = new ProfitMandiResponse<>(LocalDateTime.now(),
354
			final ProfitMandiResponse<?> profitMandiResponse = new ProfitMandiResponse<>(LocalDateTime.now(),
355
					request.getRequestURL().toString(), HttpStatus.INTERNAL_SERVER_ERROR.toString(),
355
					request.getRequestURL().toString(), HttpStatus.INTERNAL_SERVER_ERROR.toString(),
356
					HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, dealsResponse);
356
					HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, dealsResponse);
357
			return new ResponseEntity<>(profitMandiResponse, HttpStatus.INTERNAL_SERVER_ERROR);
357
			return new ResponseEntity<>(profitMandiResponse, HttpStatus.INTERNAL_SERVER_ERROR);