Subversion Repositories SmartDukaan

Rev

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

Rev 33249 Rev 35435
Line 426... Line 426...
426
		return responseSender.ok(ResponseCodeHolder.getMessage("RTLR_OK_1003"));
426
		return responseSender.ok(ResponseCodeHolder.getMessage("RTLR_OK_1003"));
427
		
427
		
428
	}
428
	}
429
	
429
	
430
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_EMAIL_ID_OR_MOBILE_NUMBER, method = RequestMethod.GET)
430
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_EMAIL_ID_OR_MOBILE_NUMBER, method = RequestMethod.GET)
-
 
431
	@Transactional(readOnly = true)
431
	public ResponseEntity<?> getByEmailIdOrMobileNumber(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber)  throws ProfitMandiBusinessException{
432
	public ResponseEntity<?> getByEmailIdOrMobileNumber(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber)  throws ProfitMandiBusinessException{
432
		LOGGER.info("Request Received at url {} with emailIdOrMobileNumber {}", request.getRequestURI(), emailIdOrMobileNumber);
433
		LOGGER.info("Request Received at url {} with emailIdOrMobileNumber {}", request.getRequestURI(), emailIdOrMobileNumber);
433
		return responseSender.ok(retailerService.getByEmailIdOrMobileNumber(emailIdOrMobileNumber));
434
		return responseSender.ok(retailerService.getByEmailIdOrMobileNumber(emailIdOrMobileNumber));
434
	}
435
	}
435
	
436
	
436
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_ALL,method=RequestMethod.GET)
437
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_ALL,method=RequestMethod.GET)
-
 
438
	@Transactional(readOnly = true)
437
	public ResponseEntity<?> getAll(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.PAGE_NUMBER) int pageNumber, @RequestParam(name = ProfitMandiConstants.PAGE_SIZE) int pageSize){
439
	public ResponseEntity<?> getAll(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.PAGE_NUMBER) int pageNumber, @RequestParam(name = ProfitMandiConstants.PAGE_SIZE) int pageSize){
438
		LOGGER.info("requested url : "+request.getRequestURL().toString());
440
		LOGGER.info("requested url : "+request.getRequestURL().toString());
439
		return responseSender.ok(retailerRepository.selectAll(pageNumber, pageSize));
441
		return responseSender.ok(retailerRepository.selectAll(pageNumber, pageSize));
440
	}
442
	}
441
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_ID, method=RequestMethod.GET)
443
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_ID, method=RequestMethod.GET)
-
 
444
	@Transactional(readOnly = true)
442
	public ResponseEntity<?> getById(HttpServletRequest request, @RequestParam(name = "id") int id) throws ProfitMandiBusinessException{
445
	public ResponseEntity<?> getById(HttpServletRequest request, @RequestParam(name = "id") int id) throws ProfitMandiBusinessException{
443
		LOGGER.info("requested url : "+request.getRequestURL().toString());
446
		LOGGER.info("requested url : "+request.getRequestURL().toString());
444
		return responseSender.ok(retailerRepository.selectById(id));
447
		return responseSender.ok(retailerRepository.selectById(id));
445
	}
448
	}
446
	
449
	
447
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_NAME, method=RequestMethod.GET)
450
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_NAME, method=RequestMethod.GET)
-
 
451
	@Transactional(readOnly = true)
448
	public ResponseEntity<?> getByName(HttpServletRequest request, @RequestParam(name = "name") String name) throws ProfitMandiBusinessException{
452
	public ResponseEntity<?> getByName(HttpServletRequest request, @RequestParam(name = "name") String name) throws ProfitMandiBusinessException{
449
		LOGGER.info("requested url : "+request.getRequestURL().toString());
453
		LOGGER.info("requested url : "+request.getRequestURL().toString());
450
		return responseSender.ok(retailerRepository.selectByName(name));
454
		return responseSender.ok(retailerRepository.selectByName(name));
451
	}
455
	}
452
		
456
		
Line 538... Line 542...
538
		
542
		
539
	}
543
	}
540
	
544
	
541
	
545
	
542
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_DOCUMENT, method=RequestMethod.GET)
546
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_DOCUMENT, method=RequestMethod.GET)
-
 
547
	@Transactional(readOnly = true)
543
	public ResponseEntity<?> getDocumentById(HttpServletRequest request, @RequestParam(name = "retailerId") int retailerId) throws ProfitMandiBusinessException{
548
	public ResponseEntity<?> getDocumentById(HttpServletRequest request, @RequestParam(name = "retailerId") int retailerId) throws ProfitMandiBusinessException{
544
		LOGGER.info("requested url : "+request.getRequestURL().toString());
549
		LOGGER.info("requested url : "+request.getRequestURL().toString());
545
		return responseSender.ok(retailerRepository.selectDocumentById(retailerId));
550
		return responseSender.ok(retailerRepository.selectDocumentById(retailerId));
546
		
551
		
547
	}
552
	}
548
	
553
	
549
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_REGISTERED_ADDRESS, method=RequestMethod.GET)
554
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_REGISTERED_ADDRESS, method=RequestMethod.GET)
-
 
555
	@Transactional(readOnly = true)
550
	public ResponseEntity<?> getRegisteredAddressById(HttpServletRequest request, @RequestParam(name = "retailerId") int retailerId) throws ProfitMandiBusinessException{
556
	public ResponseEntity<?> getRegisteredAddressById(HttpServletRequest request, @RequestParam(name = "retailerId") int retailerId) throws ProfitMandiBusinessException{
551
		LOGGER.info("requested url : "+request.getRequestURL().toString());
557
		LOGGER.info("requested url : "+request.getRequestURL().toString());
552
		return responseSender.ok(retailerRegisteredAddressRepository.selectAddressIdByRetailerId(retailerId));
558
		return responseSender.ok(retailerRegisteredAddressRepository.selectAddressIdByRetailerId(retailerId));
553
		
559
		
554
	}
560
	}
555
	
561
	
556
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_SHOP_ALL, method=RequestMethod.GET)
562
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_SHOP_ALL, method=RequestMethod.GET)
-
 
563
	@Transactional(readOnly = true)
557
	public ResponseEntity<?> getAllShops(HttpServletRequest request, @RequestParam(name = "id") int id)throws ProfitMandiBusinessException{
564
	public ResponseEntity<?> getAllShops(HttpServletRequest request, @RequestParam(name = "id") int id)throws ProfitMandiBusinessException{
558
		LOGGER.info("requested url : "+request.getRequestURL().toString());
565
		LOGGER.info("requested url : "+request.getRequestURL().toString());
559
		return responseSender.ok(shopRepository.selectByRetailerId(id));
566
		return responseSender.ok(shopRepository.selectByRetailerId(id));
560
		
567
		
561
	}
568
	}
562
	
569
	
563
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_ADDRESS_ALL, method=RequestMethod.GET)
570
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_ADDRESS_ALL, method=RequestMethod.GET)
-
 
571
	@Transactional(readOnly = true)
564
	public ResponseEntity<?> getAllAddresses(HttpServletRequest request, @RequestParam(name = "id") int id) throws ProfitMandiBusinessException {
572
	public ResponseEntity<?> getAllAddresses(HttpServletRequest request, @RequestParam(name = "id") int id) throws ProfitMandiBusinessException {
565
		LOGGER.info("requested url : "+request.getRequestURL().toString());
573
		LOGGER.info("requested url : "+request.getRequestURL().toString());
566
		List<Integer> addressIds = retailerAddressRepository.selectAddressIdsByRetailerId(id);
574
		List<Integer> addressIds = retailerAddressRepository.selectAddressIdsByRetailerId(id);
567
		return responseSender.ok(addressRepository.selectByIds(addressIds));
575
		return responseSender.ok(addressRepository.selectByIds(addressIds));
568
	}
576
	}
569
	
577
	
570
	
578
	
571
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_BRAND_ALL, method=RequestMethod.GET)
579
	@RequestMapping(value = ProfitMandiConstants.URL_RETAILER_BRAND_ALL, method=RequestMethod.GET)
-
 
580
	@Transactional(readOnly = true)
572
	public ResponseEntity<?> getAllBrads(HttpServletRequest request, @RequestParam(name = "id") int id){
581
	public ResponseEntity<?> getAllBrads(HttpServletRequest request, @RequestParam(name = "id") int id){
573
		LOGGER.info("requested url : "+request.getRequestURL().toString());
582
		LOGGER.info("requested url : "+request.getRequestURL().toString());
574
		return responseSender.ok(retailerBrandRepository.selectBrandNamesByRetailerId(id));
583
		return responseSender.ok(retailerBrandRepository.selectBrandNamesByRetailerId(id));
575
	}
584
	}
576
 
585
 
Line 589... Line 598...
589
		LOGGER.info("requested url : "+request.getRequestURL().toString());
598
		LOGGER.info("requested url : "+request.getRequestURL().toString());
590
		return responseSender.ok(mongoClient.saveRetailerInterestOnFofo(retailerInterest));
599
		return responseSender.ok(mongoClient.saveRetailerInterestOnFofo(retailerInterest));
591
	}
600
	}
592
	
601
	
593
	@RequestMapping(value = "/retailer/hasRetailerShownInterest", method=RequestMethod.GET)
602
	@RequestMapping(value = "/retailer/hasRetailerShownInterest", method=RequestMethod.GET)
-
 
603
	@Transactional(readOnly = true)
594
	public ResponseEntity<?> getAllBrads(HttpServletRequest request) throws Throwable{
604
	public ResponseEntity<?> getAllBrads(HttpServletRequest request) throws Throwable{
595
		UserInfo userInfo = (UserInfo)request.getAttribute("userInfo");
605
		UserInfo userInfo = (UserInfo)request.getAttribute("userInfo");
596
		LOGGER.info("requested url : "+request.getRequestURL().toString());
606
		LOGGER.info("requested url : "+request.getRequestURL().toString());
597
		return responseSender.ok(mongoClient.hasRetailerShownInterest(userInfo.getUserId()));
607
		return responseSender.ok(mongoClient.hasRetailerShownInterest(userInfo.getUserId()));
598
	}
608
	}