Updated Apis, Code, Configurations for Notification.
This commit is contained in:
@@ -12,6 +12,8 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.hibernate.internal.util.collections.CollectionHelper.listOf;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class NotificationServiceImpl implements NotificationService {
|
||||
@@ -20,33 +22,37 @@ public class NotificationServiceImpl implements NotificationService {
|
||||
private NotificationDao notificationDao;
|
||||
|
||||
@Override
|
||||
public NotificationResponse sendNotification(Long userId, NotificationReq notificationReq) {
|
||||
public NotificationResponse sendNotification(Long userId, NotificationReq notificationReq, Long companyId) {
|
||||
|
||||
log.info("Sending notification to user {} with content: {}", userId, notificationReq.getMessage());
|
||||
notificationReq.setUserId(userId);
|
||||
NotificationResponse notificationResponse = notificationDao.sendNotification(notificationReq);
|
||||
return notificationResponse;
|
||||
notificationReq.setCompanyIds(listOf(companyId));
|
||||
return notificationDao.sendNotification(notificationReq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NotificationResponse getNotificationById(HttpServletRequest servletRequest, Long id) {
|
||||
|
||||
return notificationDao.getNotificationById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NotificationResponse> getNotificationByUserId(HttpServletRequest servletRequest, Long userId, Long companyId, List<NotificationEnum> statuses) {
|
||||
return notificationDao.getNotificationByUserId(userId,companyId,statuses);
|
||||
|
||||
return notificationDao.getNotificationByUserId(userId, companyId, statuses);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NotificationResponse updateNotificationStatus(HttpServletRequest request, Long id,NotificationEnum status) {
|
||||
return notificationDao.updateNotificationStatus(id,status);
|
||||
public NotificationResponse updateNotificationStatus(HttpServletRequest request, Long id, NotificationEnum status) {
|
||||
|
||||
return notificationDao.updateNotificationStatus(id, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteNotification(HttpServletRequest request, Long id) {
|
||||
notificationDao.deleteNotification(id);
|
||||
return;
|
||||
|
||||
notificationDao.deleteNotification(id);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user