Changeset 8a947b9 for src/main/java/com/example/skychasemk/services
- Timestamp:
- 03/16/25 20:56:44 (3 months ago)
- Branches:
- master
- Children:
- 3a74959
- Parents:
- c064a42
- Location:
- src/main/java/com/example/skychasemk/services
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/skychasemk/services/BookingService.java
rc064a42 r8a947b9 3 3 import com.example.skychasemk.model.Booking; 4 4 import com.example.skychasemk.repository.BookingRepository; 5 import jakarta.transaction.Transactional; 5 6 import org.springframework.beans.factory.annotation.Autowired; 6 7 import org.springframework.stereotype.Service; -
src/main/java/com/example/skychasemk/services/NotificationService.java
rc064a42 r8a947b9 15 15 private NotificationRepository notificationRepository; 16 16 17 // Get all notifications 18 public List<Notification> getAllNotifications() { 19 return notificationRepository.findAll(); 17 public List<Notification> getAllNotifications(Integer userId) { 18 return notificationRepository.findByUserId(userId); 20 19 } 21 20 22 // Get notification by ID23 public Optional<Notification> getNotificationById(Integer notificationID) {24 return notificationRepository.findById(notificationID);25 }26 27 // Save a new notification28 21 public Notification saveNotification(Notification notification) { 29 22 return notificationRepository.save(notification); 30 23 } 31 24 32 // Update an existing notification33 25 public Notification updateNotification(Integer notificationID, Notification notification) { 34 26 if (notificationRepository.existsById(notificationID)) { … … 40 32 } 41 33 42 // Delete notification43 34 public void deleteNotification(Integer notificationID) { 44 35 notificationRepository.deleteById(notificationID);
Note:
See TracChangeset
for help on using the changeset viewer.