-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...main/java/com/mookive/mookive_backend/record/application/service/RecordDeleteService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.mookive.mookive_backend.record.application.service; | ||
|
||
import com.mookive.mookive_backend.keyword.domain.service.KeywordDeleteService; | ||
import com.mookive.mookive_backend.record.domain.service.RecordDeleteDomainService; | ||
import jakarta.transaction.Transactional; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional | ||
public class RecordDeleteService { | ||
|
||
/** | ||
* 추후 annotation 도입 시 변경 예정 | ||
*/ | ||
private final RecordDeleteDomainService recordDeleteDomainService; | ||
private final KeywordDeleteService keywordDeleteService; | ||
|
||
public void deleteRecord(Long recordId) { | ||
keywordDeleteService.deleteAllByRecordId(recordId); | ||
recordDeleteDomainService.delete(recordId); | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...ain/java/com/mookive/mookive_backend/record/domain/service/RecordDeleteDomainService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.mookive.mookive_backend.record.domain.service; | ||
|
||
import com.mookive.mookive_backend.record.domain.repository.RecordRepository; | ||
import jakarta.transaction.Transactional; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional | ||
public class RecordDeleteDomainService { | ||
|
||
private final RecordRepository recordRepository; | ||
|
||
public void delete(Long recordId) { | ||
recordRepository.deleteById(recordId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters