2026-05-02 13:02:38 +08:00

31 lines
768 B
Go

package notification
import (
"hyapp-admin-server/internal/model"
"hyapp-admin-server/internal/repository"
)
type NotificationService struct {
store *repository.Store
}
func NewService(store *repository.Store) *NotificationService {
return &NotificationService{store: store}
}
func (s *NotificationService) ListNotifications() ([]model.Notification, error) {
return s.store.ListNotifications()
}
func (s *NotificationService) MarkNotificationRead(id uint) (*model.Notification, error) {
return s.store.MarkNotificationRead(id)
}
func (s *NotificationService) MarkAllNotificationsRead() (int64, error) {
return s.store.MarkAllNotificationsRead()
}
func (s *NotificationService) DeleteNotification(id uint) error {
return s.store.DeleteNotification(id)
}