From 0c042daa1c0f462822f03d5c193a83c613773896 Mon Sep 17 00:00:00 2001 From: Merel Steenbergen Date: Sun, 17 Mar 2019 18:31:55 +0100 Subject: [PATCH] DTO changed to Dto. Still some errors --- .../main/java/greenify/server/rest/UserController.java | 2 +- .../main/java/greenify/server/service/UserService.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Server/src/main/java/greenify/server/rest/UserController.java b/src/Server/src/main/java/greenify/server/rest/UserController.java index 5443de6..abb3a39 100644 --- a/src/Server/src/main/java/greenify/server/rest/UserController.java +++ b/src/Server/src/main/java/greenify/server/rest/UserController.java @@ -2,8 +2,8 @@ package greenify.server.rest; import greenify.common.UserDto; import greenify.server.data.model.User; -import greenify.server.data.repository.UserRepository; import greenify.server.service.UserService; +import greenify.server.data.repository.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/src/Server/src/main/java/greenify/server/service/UserService.java b/src/Server/src/main/java/greenify/server/service/UserService.java index cb6a895..578fc7d 100644 --- a/src/Server/src/main/java/greenify/server/service/UserService.java +++ b/src/Server/src/main/java/greenify/server/service/UserService.java @@ -1,7 +1,7 @@ package greenify.server.service; import greenify.common.ApplicationException; -import greenify.common.UserDTO; +import greenify.common.UserDto; import greenify.server.data.model.User; import greenify.server.data.repository.UserRepository; import org.slf4j.Logger; @@ -21,7 +21,7 @@ public class UserService { * @param password the password of the user * @return a userDTO of the registered user */ - public UserDTO registerUser(String name, String password) { + public UserDto registerUser(String name, String password) { User user = userRepository.findByName(name); if (user != null) { throw new ApplicationException("User already exists"); @@ -29,7 +29,7 @@ public class UserService { user = userRepository.save(new User(null, name, password, 0)); } logger.info("Created user id=" + user.getId() + ", name=" + user.getName()); - return new UserDTO(user.getId(), user.getName()); + return new UserDto(user.getId(), user.getName()); } @@ -39,7 +39,7 @@ public class UserService { * @param password the password of the user * @return a userDTO of the logged in user */ - public UserDTO loginUser(String name, String password) { + public UserDto loginUser(String name, String password) { User user = userRepository.findByName(name); if (user == null) { throw new ApplicationException("User does not exist"); @@ -48,7 +48,7 @@ public class UserService { throw new ApplicationException("Wrong password"); } } - return new UserDTO(user.getId(), user.getName()); + return new UserDto(user.getId(), user.getName()); } /**