use of com.webstart.model.UserProfile in project FarmCloud by vratsasg.
the class UserController method getUserProfile.
@RequestMapping(value = "profile", method = RequestMethod.GET)
@ResponseBody
public UserProfile getUserProfile(HttpServletRequest httpServletRequest) {
Users user = new Users();
user = (Users) httpServletRequest.getSession().getAttribute("current_user");
UserProfile userprofile = usersService.getUserProfile(user.getUser_id());
return userprofile;
}
use of com.webstart.model.UserProfile in project FarmCloud by vratsasg.
the class UsersServiceImpl method getUserprofileuserByJson.
public String getUserprofileuserByJson(Integer userid) {
// JSONObject jsonObject = new JSONObject();
// Users user = usersJpaRepository.findOne(userid);
ObjectMapper mapper = new ObjectMapper();
// Object to JSON in String
String jsonInString = null;
UserProfile userprofile = userProfileJpaRepository.findOne(userid);
try {
jsonInString = mapper.writeValueAsString(userprofile);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return jsonInString;
}
Aggregations