- Timestamp:
- 01/24/22 21:08:32 (3 years ago)
- Branches:
- master
- Children:
- 76712b2
- Parents:
- bdd6491
- Location:
- trip-planner/src/main/java/finki/diplomska/tripplanner/service
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner/src/main/java/finki/diplomska/tripplanner/service/LocationService.java
rbdd6491 rb738035 25 25 List<Location> getVillages(); 26 26 List<Long> getAllLocationIdsForPlanner(Long plannerId); 27 List<Location> getLocationsForCity(Long cityId); 27 28 } -
trip-planner/src/main/java/finki/diplomska/tripplanner/service/PlannerService.java
rbdd6491 rb738035 4 4 import finki.diplomska.tripplanner.models.Planner; 5 5 import finki.diplomska.tripplanner.models.dto.PlannerDto; 6 import finki.diplomska.tripplanner.models.dto.PlannerLocationDto; 7 import org.springframework.http.ResponseEntity; 6 8 7 9 import java.util.List; … … 18 20 Optional<Planner> newPlanner(PlannerDto plannerDto, String username); 19 21 void deletePlannerById(Long id); 20 void deleteLocationFromPlanner(Long locationId);22 ResponseEntity deleteLocationFromPlanner(PlannerLocationDto plannerLocationDto); 21 23 } -
trip-planner/src/main/java/finki/diplomska/tripplanner/service/UserService.java
rbdd6491 rb738035 4 4 import finki.diplomska.tripplanner.models.dto.UserDto; 5 5 6 import java.util.List; 6 7 import java.util.Optional; 7 8 … … 10 11 11 12 User saveUser (User user); 12 13 List<String> getAllUsernames(); 14 Optional<String> getPassword(UserDto userDto); 15 Optional<User> findById(Long id); 13 16 } -
trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/LocationServiceImpl.java
rbdd6491 rb738035 183 183 return this.locationRepository.getAllLocationIdsForPlanner(plannerId); 184 184 } 185 186 @Override 187 public List<Location> getLocationsForCity(Long cityId) { 188 return this.locationRepository.getLocationsForCity(cityId); 189 } 185 190 } -
trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/PlannerServiceImpl.java
rbdd6491 rb738035 5 5 import finki.diplomska.tripplanner.models.User; 6 6 import finki.diplomska.tripplanner.models.dto.PlannerDto; 7 import finki.diplomska.tripplanner.models.dto.PlannerLocationDto; 7 8 import finki.diplomska.tripplanner.models.exceptions.LocationNotFoundException; 8 9 import finki.diplomska.tripplanner.models.exceptions.PlannerNotFoundException; … … 11 12 import finki.diplomska.tripplanner.repository.jpa.JpaUserRepository; 12 13 import finki.diplomska.tripplanner.service.PlannerService; 14 import org.springframework.http.ResponseEntity; 13 15 import org.springframework.stereotype.Service; 14 16 … … 67 69 68 70 @Override 69 public void deleteLocationFromPlanner(Long locationId) { 70 this.plannerRepository.deleteLocationFromPlanner(locationId); 71 public ResponseEntity deleteLocationFromPlanner(PlannerLocationDto plannerLocationDto) { 72 plannerRepository.deleteLocationFromPlanner(plannerLocationDto.getPlannerId(), plannerLocationDto.getLocationId()); 73 return null; 71 74 } 72 75 -
trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/UserServiceImpl.java
rbdd6491 rb738035 7 7 import finki.diplomska.tripplanner.service.UserService; 8 8 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.http.ResponseEntity; 9 10 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 10 11 import org.springframework.stereotype.Service; 11 12 13 import java.util.List; 12 14 import java.util.Optional; 13 15 … … 34 36 throw new UsernameAlreadyExistsException("Username '"+newUser.getUsername()+ "' already exists"); 35 37 } 38 } 36 39 40 @Override 41 public List<String> getAllUsernames() { 42 return this.userRepository.getAllUsernames(); 43 } 44 45 @Override 46 public Optional<String> getPassword(UserDto userDto) { 47 this.userRepository.getPassword(userDto.getUsername()); 48 return null; 49 } 50 51 @Override 52 public Optional<User> findById(Long id) { 53 return this.userRepository.findById(id); 37 54 } 38 55
Note:
See TracChangeset
for help on using the changeset viewer.