| Line 41... |
Line 41... |
| 41 |
import com.spice.profitmandi.dao.repository.dtr.RoleRepository;
|
41 |
import com.spice.profitmandi.dao.repository.dtr.RoleRepository;
|
| 42 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
42 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| 43 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
43 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| 44 |
import com.spice.profitmandi.dao.repository.dtr.UserRoleRepository;
|
44 |
import com.spice.profitmandi.dao.repository.dtr.UserRoleRepository;
|
| 45 |
import com.spice.profitmandi.dao.util.UserToRetailerMigrationUtil;
|
45 |
import com.spice.profitmandi.dao.util.UserToRetailerMigrationUtil;
|
| - |
|
46 |
import com.spice.profitmandi.service.UserService;
|
| 46 |
import com.spice.profitmandi.web.enumuration.UserStatus;
|
47 |
import com.spice.profitmandi.web.enumuration.UserStatus;
|
| 47 |
import com.spice.profitmandi.web.processor.GoogleLoginProcessor;
|
48 |
import com.spice.profitmandi.web.processor.GoogleLoginProcessor;
|
| 48 |
import com.spice.profitmandi.web.req.UserAddRoleRequest;
|
49 |
import com.spice.profitmandi.web.req.UserAddRoleRequest;
|
| 49 |
import com.spice.profitmandi.web.req.UserRequest;
|
50 |
import com.spice.profitmandi.web.req.UserRequest;
|
| 50 |
|
51 |
|
| Line 88... |
Line 89... |
| 88 |
@Autowired
|
89 |
@Autowired
|
| 89 |
GoogleLoginProcessor googleLoginProcessor;
|
90 |
GoogleLoginProcessor googleLoginProcessor;
|
| 90 |
|
91 |
|
| 91 |
@Autowired
|
92 |
@Autowired
|
| 92 |
UserToRetailerMigrationUtil userToRetailerMigrationUtil;
|
93 |
UserToRetailerMigrationUtil userToRetailerMigrationUtil;
|
| - |
|
94 |
|
| - |
|
95 |
@Autowired
|
| - |
|
96 |
UserService userService;
|
| 93 |
|
97 |
|
| 94 |
@SuppressWarnings("unchecked")
|
98 |
@SuppressWarnings("unchecked")
|
| 95 |
@RequestMapping(value = ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, method = RequestMethod.POST)
|
99 |
@RequestMapping(value = ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, method = RequestMethod.POST)
|
| 96 |
public ResponseEntity<?> googleLogin(HttpServletRequest request) {
|
100 |
public ResponseEntity<?> googleLogin(HttpServletRequest request) {
|
| 97 |
LOGGER.info("requested url : " + request.getRequestURL().toString());
|
101 |
LOGGER.info("requested url : " + request.getRequestURL().toString());
|
| Line 246... |
Line 250... |
| 246 |
} catch (ProfitMandiBusinessException profitMandiBusinessException) {
|
250 |
} catch (ProfitMandiBusinessException profitMandiBusinessException) {
|
| 247 |
LOGGER.error("ProfitMandi error: ", profitMandiBusinessException);
|
251 |
LOGGER.error("ProfitMandi error: ", profitMandiBusinessException);
|
| 248 |
return responseSender.badRequest(profitMandiBusinessException);
|
252 |
return responseSender.badRequest(profitMandiBusinessException);
|
| 249 |
}
|
253 |
}
|
| 250 |
}
|
254 |
}
|
| - |
|
255 |
|
| - |
|
256 |
|
| 251 |
|
257 |
|
| 252 |
/*@ApiImplicitParams({
|
258 |
@ApiImplicitParams({
|
| 253 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
259 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 254 |
@RequestMapping(value = ProfitMandiConstants.URL_USER_ACTIVATE, method = RequestMethod.POST)
|
260 |
@RequestMapping(value = ProfitMandiConstants.URL_USER_ACTIVATE, method = RequestMethod.POST)
|
| 255 |
public ResponseEntity<?> activateUser(HttpServletRequest request,
|
261 |
public ResponseEntity<?> activateUser(HttpServletRequest request,
|
| 256 |
@RequestParam(name = "activationCode") String activationCode) {
|
262 |
@RequestParam(name = "activationCode") String activationCode) throws Throwable {
|
| 257 |
Map<String, Object> response = new HashMap<>();
|
- |
|
| 258 |
boolean activated = false;
|
- |
|
| 259 |
|
- |
|
| 260 |
int userId = (int)request.getAttribute("userId");
|
263 |
int userId = (int)request.getAttribute("userId");
|
| 261 |
UserCart uc = userAccountRepository.getUserCart(userId);
|
264 |
UserCart uc = userAccountRepository.getUserCart(userId);
|
| 262 |
Client client = new TransactionClient().getClient();
|
- |
|
| 263 |
if (client.registerRsa(uc.getUserId(),activationCode)){
|
265 |
return responseSender.ok(userService.updateActivation(userId, uc.getUserId(), activationCode));
|
| 264 |
activated = true;
|
- |
|
| 265 |
}
|
- |
|
| 266 |
else{
|
- |
|
| 267 |
|
- |
|
| 268 |
}
|
266 |
}
|
| 269 |
return responseSender.ok(null);
|
- |
|
| 270 |
}*/
|
- |
|
| 271 |
|
267 |
|
| 272 |
@RequestMapping(value = ProfitMandiConstants.URL_USER_IS_EXIST_MOBILE_NUMBER, method = RequestMethod.GET)
|
268 |
@RequestMapping(value = ProfitMandiConstants.URL_USER_IS_EXIST_MOBILE_NUMBER, method = RequestMethod.GET)
|
| 273 |
public ResponseEntity<?> isMobileNumberExist(HttpServletRequest request,
|
269 |
public ResponseEntity<?> isMobileNumberExist(HttpServletRequest request,
|
| 274 |
@RequestParam(name = "mobileNumber") String mobileNumber) {
|
270 |
@RequestParam(name = "mobileNumber") String mobileNumber) {
|
| 275 |
LOGGER.info("requested url : " + request.getRequestURL().toString());
|
271 |
LOGGER.info("requested url : " + request.getRequestURL().toString());
|