use of com.webstart.model.Users in project FarmCloud by vratsasg.
the class UsersServiceImpl method findUser.
public Users findUser(int userid) {
Users user;
user = usersJpaRepository.findOne(userid);
return user;
}
use of com.webstart.model.Users in project FarmCloud by vratsasg.
the class HomeController method getMeasuresByObsProperty.
@RequestMapping(value = "/{mydevice}/measures/last", method = RequestMethod.GET)
@ResponseBody
public List<ObservationMeasure> getMeasuresByObsProperty(@PathVariable("mydevice") String mydevice, HttpServletRequest request) {
Users users = (Users) request.getSession().getAttribute("current_user");
List<ObservationMeasure> sentData = new ArrayList<ObservationMeasure>();
try {
sentData = observationProperyService.getLastObservationbyIdentifier(users.getUser_id(), mydevice);
} catch (Exception e) {
e.printStackTrace();
return null;
}
return sentData;
}
use of com.webstart.model.Users in project FarmCloud by vratsasg.
the class IndexController method getObsProperties.
@RequestMapping(value = "/topbaruser", method = RequestMethod.GET)
public ResponseEntity<String> getObsProperties(HttpServletRequest request) throws JsonProcessingException {
Users users;
users = (Users) request.getSession().getAttribute("current_user");
//
JSONObject jsonObject;
jsonObject = usersService.userByJson(users.getUser_id());
return new ResponseEntity<String>(jsonObject.toJSONString(), HttpStatus.OK);
}
use of com.webstart.model.Users 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.Users in project FarmCloud by vratsasg.
the class UsersServiceImpl method findUser.
public Users findUser(String username, String password) {
Users user;
user = usersJpaRepository.findByUsernameAndPassword(username, password);
return user;
}
Aggregations