-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAddLabelService.java
More file actions
27 lines (23 loc) · 1.04 KB
/
AddLabelService.java
File metadata and controls
27 lines (23 loc) · 1.04 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
package clap.server.application.service.label;
import clap.server.adapter.inbound.web.dto.label.AddAndEditLabelRequest;
import clap.server.application.port.inbound.admin.AddLabelUsecase;
import clap.server.application.port.inbound.domain.MemberService;
import clap.server.application.port.outbound.task.CommandLabelPort;
import clap.server.common.annotation.architecture.ApplicationService;
import clap.server.domain.model.member.Member;
import clap.server.domain.model.task.Label;
import lombok.RequiredArgsConstructor;
import org.springframework.transaction.annotation.Transactional;
@ApplicationService
@RequiredArgsConstructor
public class AddLabelService implements AddLabelUsecase {
private final MemberService memberService;
private final CommandLabelPort commandLabelPort;
@Transactional
@Override
public void addLabel(Long adminId, AddAndEditLabelRequest request) {
Member admin = memberService.findActiveMember(adminId);
Label label = Label.addLabel(admin, request);
commandLabelPort.save(label);
}
}