-
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
6 changed files
with
52 additions
and
29 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...tion/src/main/java/com/flow/sa46lll/fileshield/port/out/ReadExtensionPersistencePort.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,9 @@ | ||
package com.flow.sa46lll.fileshield.port.out; | ||
|
||
import com.flow.sa46lll.fileshield.domain.BlockedExtension; | ||
import java.util.List; | ||
|
||
public interface ReadExtensionPersistencePort { | ||
|
||
List<BlockedExtension> findAll(); | ||
} |
7 changes: 2 additions & 5 deletions
7
...ld/port/out/ExtensionPersistencePort.java → ...rt/out/WriteExtensionPersistencePort.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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
package com.flow.sa46lll.fileshield.port.out; | ||
|
||
import com.flow.sa46lll.fileshield.domain.BlockedExtension; | ||
import java.util.List; | ||
|
||
public interface ExtensionPersistencePort { | ||
|
||
List<BlockedExtension> findAll(); | ||
public interface WriteExtensionPersistencePort { | ||
|
||
Long blockCustomExtension(final BlockedExtension blockedExtension); | ||
|
||
void updateExtensionBlockStatus(final BlockedExtension blockedExtension); | ||
|
||
void deleteCustomExtensionById(final Long extensionId); | ||
|
||
boolean existsByExtension(String extension); | ||
boolean existsByExtension(final String extension); | ||
} |
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
25 changes: 25 additions & 0 deletions
25
...re/src/main/java/com/flow/sa46lll/fileshield/adapter/ReadExtensionPersistenceAdapter.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.flow.sa46lll.fileshield.adapter; | ||
|
||
import com.flow.sa46lll.fileshield.domain.BlockedExtension; | ||
import com.flow.sa46lll.fileshield.mapper.BlockedExtensionMapper; | ||
import com.flow.sa46lll.fileshield.port.out.ReadExtensionPersistencePort; | ||
import com.flow.sa46lll.fileshield.repository.BlockedExtensionRepository; | ||
import java.util.List; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class ReadExtensionPersistenceAdapter implements ReadExtensionPersistencePort { | ||
|
||
private final BlockedExtensionRepository blockedExtensionRepository; | ||
|
||
public ReadExtensionPersistenceAdapter(BlockedExtensionRepository blockedExtensionRepository) { | ||
this.blockedExtensionRepository = blockedExtensionRepository; | ||
} | ||
|
||
@Override | ||
public List<BlockedExtension> findAll() { | ||
return blockedExtensionRepository.findAll().stream() | ||
.map(BlockedExtensionMapper::toDomain) | ||
.toList()); | ||
} | ||
} |
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