-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCountNotificationService.java
More file actions
29 lines (23 loc) · 1.19 KB
/
CountNotificationService.java
File metadata and controls
29 lines (23 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package clap.server.application.service.notification;
import clap.server.adapter.inbound.web.dto.notification.response.CountNotificationResponse;
import clap.server.application.mapper.response.NotificationResponseMapper;
import clap.server.application.port.inbound.domain.MemberService;
import clap.server.application.port.inbound.notification.CountNotificationUseCase;
import clap.server.application.port.outbound.notification.LoadNotificationPort;
import clap.server.common.annotation.architecture.ApplicationService;
import lombok.RequiredArgsConstructor;
import org.springframework.transaction.annotation.Transactional;
@ApplicationService
@Transactional(readOnly = true)
@RequiredArgsConstructor
public class CountNotificationService implements CountNotificationUseCase {
private final MemberService memberService;
private final LoadNotificationPort loadNotificationPort;
@Transactional
@Override
public CountNotificationResponse countNotification(Long memberId) {
memberService.findActiveMember(memberId);
Integer count = loadNotificationPort.countNotification(memberId);
return NotificationResponseMapper.toCountNotificationResponse(memberId, count);
}
}