- Timestamp:
- 10/12/24 21:32:15 (5 weeks ago)
- Branches:
- master
- Parents:
- 743de55
- Location:
- src/main/java/finki/it/terapijamkbackend/spring/services
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/finki/it/terapijamkbackend/spring/services/CouponsService.java
r743de55 r43c9090 9 9 import java.util.List; 10 10 import java.util.Optional; 11 import java.util.stream.Collectors; 11 12 12 13 @Service … … 33 34 return couponRepository.findByTitle(identifier); 34 35 } 36 public List<String> getCouponNames() { 37 return couponRepository.findAll().stream() 38 .map(Coupon::getCode) 39 .collect(Collectors.toList()); 40 } 35 41 36 42 public void save(Coupon coupon) { -
src/main/java/finki/it/terapijamkbackend/spring/services/EventService.java
r743de55 r43c9090 1 1 package finki.it.terapijamkbackend.spring.services; 2 2 3 import finki.it.terapijamkbackend.spring.entities.Coupon;4 3 import finki.it.terapijamkbackend.spring.entities.Event; 5 4 import finki.it.terapijamkbackend.spring.repositories.EventRepository; 6 import finki.it.terapijamkbackend.spring.repositories.UserRepository;7 5 import jakarta.persistence.EntityNotFoundException; 8 6 import org.springframework.beans.factory.annotation.Autowired; -
src/main/java/finki/it/terapijamkbackend/spring/services/RequestService.java
r743de55 r43c9090 41 41 public List<Request> findRequestsByUsername(String username) { 42 42 User user=userRepository.findByUsername(username).orElse(null); 43 System.out.println(user.getId());44 43 return requestRepository.findRequestsForFreeAppointments(user.getId()); 45 44 } -
src/main/java/finki/it/terapijamkbackend/spring/services/UserService.java
r743de55 r43c9090 58 58 } 59 59 60 return userRepository.save(existingUser); // Save the updated user back to the database60 return userRepository.save(existingUser); 61 61 } else { 62 62 throw new UserNotFoundException("User not found with username: " + username);
Note:
See TracChangeset
for help on using the changeset viewer.