Пример #1
0
 @RequestMapping(value = "/userLogin", method = RequestMethod.POST, consumes = "application/json")
 public User userLogin(@RequestBody User user) {
   User loginUser = null;
   List<User> users = userService.userLogin(user);
   if (users != null && users.size() > 0) {
     loginUser = users.get(0);
   }
   return loginUser;
 }
Пример #2
0
 @RequestMapping(
     value = "/userRegister",
     method = RequestMethod.POST,
     consumes = "application/json")
 public User userRegister(@RequestBody User user) {
   if (UtilTools.validUser(user)) {
     userService.userRegister(user);
   }
   return user;
 }
Пример #3
0
 @RequestMapping(value = "/getUserById")
 public User getUserById(@RequestParam(value = "userId") long userId) {
   List<User> users = userService.getUserById(userId);
   return users.get(0);
 }