Subversion Repositories SmartDukaan

Rev

Rev 35435 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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