-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
9baf5ef
commit 9ec3f78
Showing
7 changed files
with
31 additions
and
19 deletions.
There are no files selected for viewing
10 changes: 0 additions & 10 deletions
10
...kotlin/com/bamyanggang/domainmodule/domain/experience/repository/StrongPointRepository.kt
This file was deleted.
Oops, something went wrong.
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
9 changes: 8 additions & 1 deletion
9
...otlin/com/bamyanggang/domainmodule/domain/strongpoint/repository/StrongPointRepository.kt
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,4 +1,11 @@ | ||
package com.bamyanggang.domainmodule.domain.strongpoint.repository | ||
|
||
import com.bamyanggang.domainmodule.domain.strongpoint.aggregate.StrongPoint | ||
import java.util.* | ||
|
||
interface StrongPointRepository { | ||
} | ||
fun save(newStrongPoint: StrongPoint): UUID | ||
fun findAllByUserId(userId: UUID): List<StrongPoint> | ||
fun deleteByStrongPointId(strongPointId: UUID) | ||
fun isExistByStrongPointId(strongPointId: UUID): Boolean | ||
} |
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
11 changes: 9 additions & 2 deletions
11
...main/kotlin/com/bamyanggang/domainmodule/domain/strongpoint/service/StrongPointRemover.kt
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,12 +1,19 @@ | ||
package com.bamyanggang.domainmodule.domain.strongpoint.service | ||
|
||
import com.bamyanggang.domainmodule.domain.experience.repository.StrongPointRepository | ||
import com.bamyanggang.domainmodule.domain.strongpoint.exception.StrongPointException | ||
import com.bamyanggang.domainmodule.domain.strongpoint.repository.StrongPointRepository | ||
import org.springframework.stereotype.Service | ||
import java.util.* | ||
|
||
@Service | ||
class StrongPointRemover( | ||
private val strongPointRepository: StrongPointRepository | ||
) { | ||
fun removeStrongPoint(strongPointId: UUID) = strongPointRepository.deleteByStrongPointId(strongPointId) | ||
fun removeStrongPoint(strongPointId: UUID) { | ||
if (!strongPointRepository.isExistByStrongPointId(strongPointId)) { | ||
throw StrongPointException.NotFoundStrongPoint() | ||
} | ||
|
||
strongPointRepository.deleteByStrongPointId(strongPointId) | ||
} | ||
} |
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