-
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.
* feat: deleteAllByUserJpaEntity 구현 * feat: DeleteCompletedCreditPort 구현 * fix: 유저 탈퇴 오류 수정 - deleteUserCompletedCredits 로직 추가
- Loading branch information
Showing
6 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...raduate/myongjigraduatebe/completedcredit/application/port/DeleteCompletedCreditPort.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,8 @@ | ||
package com.plzgraduate.myongjigraduatebe.completedcredit.application.port; | ||
|
||
import com.plzgraduate.myongjigraduatebe.user.domain.model.User; | ||
|
||
public interface DeleteCompletedCreditPort { | ||
|
||
void deleteAllCompletedCredits(User user); | ||
} |
25 changes: 25 additions & 0 deletions
25
...igraduatebe/completedcredit/infrastructure/persistence/DeletedCompletedCreditAdapter.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.plzgraduate.myongjigraduatebe.completedcredit.infrastructure.persistence; | ||
|
||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import com.plzgraduate.myongjigraduatebe.completedcredit.application.port.DeleteCompletedCreditPort; | ||
import com.plzgraduate.myongjigraduatebe.completedcredit.infrastructure.persistence.repository.CompletedCreditRepository; | ||
import com.plzgraduate.myongjigraduatebe.core.meta.PersistenceAdapter; | ||
import com.plzgraduate.myongjigraduatebe.user.domain.model.User; | ||
import com.plzgraduate.myongjigraduatebe.user.infrastructure.adapter.persistence.mapper.UserMapper; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@PersistenceAdapter | ||
@Transactional | ||
@RequiredArgsConstructor | ||
public class DeletedCompletedCreditAdapter implements DeleteCompletedCreditPort { | ||
|
||
private final CompletedCreditRepository completedCreditRepository; | ||
private final UserMapper userMapper; | ||
|
||
@Override | ||
public void deleteAllCompletedCredits(User user) { | ||
completedCreditRepository.deleteAllByUserJpaEntity(userMapper.mapToJpaEntity(user)); | ||
} | ||
} |
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
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
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
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