Notification Code.

This commit is contained in:
piyushkag
2024-12-13 20:57:58 +05:30
parent 2a5f344ea0
commit d8e51f3a70
25 changed files with 520 additions and 6 deletions

View File

@@ -0,0 +1,7 @@
package net.gepafin.tendermanagement.service;
import net.gepafin.tendermanagement.model.request.NotificationReq;
public interface NotificationService {
NotificationReq sendNotification(Long userId, NotificationReq notificationReq);
}

View File

@@ -0,0 +1,26 @@
package net.gepafin.tendermanagement.service.impl;
import lombok.extern.slf4j.Slf4j;
import net.gepafin.tendermanagement.dao.NotificationDao;
import net.gepafin.tendermanagement.model.request.NotificationReq;
import net.gepafin.tendermanagement.service.NotificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class NotificationServiceImpl implements NotificationService {
@Autowired
private NotificationDao notificationDao;
@Override
public NotificationReq sendNotification(Long userId, NotificationReq notificationReq) {
log.info("Sending notification to user {} with content: {}", userId, notificationReq.getMessage());
notificationReq.setUserId(userId);
notificationReq = notificationDao.sendNotification(notificationReq);
return notificationReq;
}
}