| Line 38... |
Line 38... |
| 38 |
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
|
38 |
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
|
| 39 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
39 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
| 40 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
40 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 41 |
import com.spice.profitmandi.dao.repository.webRepository.NavBarRepository;
|
41 |
import com.spice.profitmandi.dao.repository.webRepository.NavBarRepository;
|
| 42 |
import com.spice.profitmandi.dao.service.BidService;
|
42 |
import com.spice.profitmandi.dao.service.BidService;
|
| - |
|
43 |
import com.spice.profitmandi.dao.service.OTPResponse;
|
| 43 |
import com.spice.profitmandi.service.CustomerService;
|
44 |
import com.spice.profitmandi.service.CustomerService;
|
| 44 |
import com.spice.profitmandi.service.EmailService;
|
45 |
import com.spice.profitmandi.service.EmailService;
|
| 45 |
import com.spice.profitmandi.service.NotificationService;
|
46 |
import com.spice.profitmandi.service.NotificationService;
|
| 46 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
47 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 47 |
import com.spice.profitmandi.service.catalog.BiddingModel;
|
48 |
import com.spice.profitmandi.service.catalog.BiddingModel;
|
| Line 324... |
Line 325... |
| 324 |
return responseSender.ok(otpProcessor.generateOtp(mobile, OtpType.REGISTRATION));
|
325 |
return responseSender.ok(otpProcessor.generateOtp(mobile, OtpType.REGISTRATION));
|
| 325 |
|
326 |
|
| 326 |
}
|
327 |
}
|
| 327 |
|
328 |
|
| 328 |
@RequestMapping(value = "/store/checkmobile/{mobile}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
329 |
@RequestMapping(value = "/store/checkmobile/{mobile}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 329 |
public ResponseEntity<?> checkRegistrationUsingMobile(HttpServletRequest request, @PathVariable String mobile) throws Exception {
|
330 |
public ResponseEntity<?> checkRegistrationUsingMobile(HttpServletRequest request, @PathVariable String mobile ,@RequestParam(required = false, defaultValue = "false") boolean isSmartSeller) throws Exception {
|
| 330 |
try {
|
331 |
try {
|
| 331 |
Customer customer = customerRepository.selectByMobileNumber(mobile);
|
332 |
Customer customer = customerRepository.selectByMobileNumber(mobile);
|
| 332 |
customer.setPasswordExist(StringUtils.isNotEmpty(customer.getPassword()));
|
333 |
customer.setPasswordExist(StringUtils.isNotEmpty(customer.getPassword()));
|
| - |
|
334 |
if(isSmartSeller){
|
| - |
|
335 |
customer.setSmartSeller(isSmartSeller);
|
| - |
|
336 |
}
|
| 333 |
return responseSender.ok(new CustomerModel(true, customer));
|
337 |
return responseSender.ok(new CustomerModel(true, customer));
|
| 334 |
} catch (Exception e) {
|
338 |
} catch (Exception e) {
|
| 335 |
return responseSender.ok(new CustomerModel(false, null));
|
339 |
return responseSender.ok(new CustomerModel(false, null));
|
| 336 |
}
|
340 |
}
|
| 337 |
}
|
341 |
}
|
| Line 390... |
Line 394... |
| 390 |
customer.setPassword(userModel.getPassword());
|
394 |
customer.setPassword(userModel.getPassword());
|
| 391 |
customer.setEmailId(userModel.getEmail());
|
395 |
customer.setEmailId(userModel.getEmail());
|
| 392 |
customer.setFirstName(userModel.getFirstName());
|
396 |
customer.setFirstName(userModel.getFirstName());
|
| 393 |
customer.setLastName(userModel.getLastName());
|
397 |
customer.setLastName(userModel.getLastName());
|
| 394 |
customer.setMobileNumber(userModel.getMobile());
|
398 |
customer.setMobileNumber(userModel.getMobile());
|
| - |
|
399 |
customer.setSmartSeller(userModel.getIsSmartSeller());
|
| 395 |
return responseSender.ok(customerService.addCustomer(customer));
|
400 |
return responseSender.ok(customerService.addCustomer(customer));
|
| 396 |
}
|
401 |
}
|
| - |
|
402 |
@RequestMapping(value = "/store/signinWithOtp", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| - |
|
403 |
public ResponseEntity<?> signInWithOtp(HttpServletRequest request,
|
| - |
|
404 |
@RequestBody OtpLoginRequest otpLoginRequest) throws Exception {
|
| - |
|
405 |
OTPResponse otpResponse = otpProcessor.validateOtp(
|
| - |
|
406 |
otpLoginRequest.getReferenceId(),
|
| - |
|
407 |
otpLoginRequest.getMobile(),
|
| - |
|
408 |
otpLoginRequest.getOtp()
|
| - |
|
409 |
);
|
| - |
|
410 |
if (otpResponse.isResult()) {
|
| - |
|
411 |
return responseSender.ok(true);
|
| - |
|
412 |
} else {
|
| - |
|
413 |
return responseSender.badRequest("Invalid otp please check again");
|
| - |
|
414 |
}
|
| - |
|
415 |
}
|
| 397 |
|
416 |
|
| 398 |
@RequestMapping(value = "/store/checkplans", method = RequestMethod.GET)
|
417 |
@RequestMapping(value = "/store/checkplans", method = RequestMethod.GET)
|
| 399 |
public ResponseEntity<?> getInsurancePrices(HttpServletRequest request, @RequestParam float price, Model model,
|
418 |
public ResponseEntity<?> getInsurancePrices(HttpServletRequest request, @RequestParam float price, Model model,
|
| 400 |
@RequestParam int itemId) throws ProfitMandiBusinessException {
|
419 |
@RequestParam int itemId) throws ProfitMandiBusinessException {
|
| 401 |
logger.info("Request received at url : {}", request.getRequestURI());
|
420 |
logger.info("Request received at url : {}", request.getRequestURI());
|