Subversion Repositories SmartDukaan

Rev

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

Rev 26777 Rev 26783
Line 343... Line 343...
343
		webListing.setFofoCatalogResponses(dealResponse);
343
		webListing.setFofoCatalogResponses(dealResponse);
344
		return responseSender.ok(webListing);
344
		return responseSender.ok(webListing);
345
	}
345
	}
346
 
346
 
347
	@RequestMapping(value = "/store/otp/generateOTP", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
347
	@RequestMapping(value = "/store/otp/generateOTP", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
348
	public ResponseEntity<?> generateOtp(HttpServletRequest request, @RequestParam String email,
348
	public ResponseEntity<?> generateOtp(HttpServletRequest request, @RequestParam String mobile) throws Exception {
349
			@RequestParam String phone) throws Exception {
-
 
350
 
349
 
351
		return responseSender.ok(otpProcessor.generateOtp(email, phone, OtpType.PREBOOKING_ORDER));
350
		return responseSender.ok(otpProcessor.generateOtp(mobile, OtpType.PREBOOKING_ORDER));
352
 
351
 
353
	}
352
	}
354
 
353
 
355
	@RequestMapping(value = "/store/login/{mobile}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
354
	@RequestMapping(value = "/store/login/{mobile}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
356
	public ResponseEntity<?> generateOtp(HttpServletRequest request, @PathVariable String mobile) throws Exception {
355
	public ResponseEntity<?> checkRegistrationUsingMobile(HttpServletRequest request, @PathVariable String mobile) throws Exception {
357
		try {
356
		try {
358
			Customer customer = customerRepository.selectByMobileNumber(mobile);
357
			Customer customer = customerRepository.selectByMobileNumber(mobile);
359
			customer.setPasswordExist(StringUtils.isNotEmpty(customer.getPassword()));
358
			customer.setPasswordExist(StringUtils.isNotEmpty(customer.getPassword()));
360
			return responseSender.ok(new CustomerModel(true, customer));
359
			return responseSender.ok(new CustomerModel(true, customer));
361
		} catch (Exception e) {
360
		} catch (Exception e) {
Line 629... Line 628...
629
	}
628
	}
630
 
629
 
631
}
630
}
632
 
631
 
633
class CustomerModel {
632
class CustomerModel {
634
	
-
 
635
	
633
 
636
	@JsonProperty(required = false)
634
	@JsonProperty(required = false)
637
	private Customer customer;
635
	private Customer customer;
638
	@JsonProperty(required = true)
636
	@JsonProperty(required = true)
639
	private boolean exists;
637
	private boolean exists;
640
	
-
 
641
 
638
 
642
	public CustomerModel(boolean exists, Customer customer) {
639
	public CustomerModel(boolean exists, Customer customer) {
643
		super();
640
		super();
644
		this.customer = customer;
641
		this.customer = customer;
645
		this.exists = exists;
642
		this.exists = exists;