| Line 9... |
Line 9... |
| 9 |
import org.slf4j.LoggerFactory;
|
9 |
import org.slf4j.LoggerFactory;
|
| 10 |
import org.springframework.beans.factory.annotation.Autowired;
|
10 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 11 |
import org.springframework.http.HttpStatus;
|
11 |
import org.springframework.http.HttpStatus;
|
| 12 |
import org.springframework.http.ResponseEntity;
|
12 |
import org.springframework.http.ResponseEntity;
|
| 13 |
import org.springframework.stereotype.Controller;
|
13 |
import org.springframework.stereotype.Controller;
|
| - |
|
14 |
import org.springframework.web.bind.annotation.RequestBody;
|
| 14 |
import org.springframework.web.bind.annotation.RequestMapping;
|
15 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 15 |
import org.springframework.web.bind.annotation.RequestMethod;
|
16 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 16 |
import org.springframework.web.bind.annotation.RequestParam;
|
17 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 17 |
|
18 |
|
| 18 |
import com.spice.profitmandi.common.ResponseCodeHolder;
|
19 |
import com.spice.profitmandi.common.ResponseCodeHolder;
|
| Line 23... |
Line 24... |
| 23 |
import com.spice.profitmandi.dao.repository.UserRepository;
|
24 |
import com.spice.profitmandi.dao.repository.UserRepository;
|
| 24 |
import com.spice.profitmandi.web.model.ProfitMandiResponse;
|
25 |
import com.spice.profitmandi.web.model.ProfitMandiResponse;
|
| 25 |
import com.spice.profitmandi.web.model.Response;
|
26 |
import com.spice.profitmandi.web.model.Response;
|
| 26 |
import com.spice.profitmandi.web.model.ResponseStatus;
|
27 |
import com.spice.profitmandi.web.model.ResponseStatus;
|
| 27 |
import com.spice.profitmandi.web.processor.GoogleLoginProcessor;
|
28 |
import com.spice.profitmandi.web.processor.GoogleLoginProcessor;
|
| - |
|
29 |
import com.spice.profitmandi.web.req.UserRequest;
|
| 28 |
|
30 |
|
| 29 |
/**
|
31 |
/**
|
| 30 |
* @author ashikali
|
32 |
* @author ashikali
|
| 31 |
*
|
33 |
*
|
| 32 |
*/
|
34 |
*/
|
| Line 100... |
Line 102... |
| 100 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
|
102 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
|
| 101 |
}
|
103 |
}
|
| 102 |
}
|
104 |
}
|
| 103 |
|
105 |
|
| 104 |
@RequestMapping(value = ProfitMandiConstants.URL_USER, method=RequestMethod.POST)
|
106 |
@RequestMapping(value = ProfitMandiConstants.URL_USER, method=RequestMethod.POST)
|
| 105 |
public ResponseEntity<?> createUser(HttpServletRequest request){
|
107 |
public ResponseEntity<?> createUser(HttpServletRequest request, @RequestBody UserRequest userRequest){
|
| 106 |
LOGGER.info("requested url : "+request.getRequestURL().toString());
|
108 |
LOGGER.info("requested url : "+request.getRequestURL().toString());
|
| 107 |
final User user = (User)request.getAttribute(ProfitMandiConstants.USER);
|
109 |
final User user = (User)request.getAttribute(ProfitMandiConstants.USER);
|
| 108 |
request.removeAttribute(ProfitMandiConstants.USER);
|
110 |
request.removeAttribute(ProfitMandiConstants.USER);
|
| 109 |
try {
|
111 |
try {
|
| 110 |
user.setCreateTimestamp(LocalDateTime.now());
|
112 |
user.setCreateTimestamp(LocalDateTime.now());
|