-
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
1 parent
a9ec7bb
commit 6d9fff6
Showing
6 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
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
5 changes: 5 additions & 0 deletions
5
...lin/xquare/app/xquareinfra/domain/deploy/adapter/dto/response/SimpleDeployListResponse.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package xquare.app.xquareinfra.domain.deploy.adapter.dto.response | ||
|
||
data class SimpleDeployListResponse( | ||
val deployList: List<SimpleDeployResponse> | ||
) |
9 changes: 9 additions & 0 deletions
9
.../kotlin/xquare/app/xquareinfra/domain/deploy/adapter/dto/response/SimpleDeployResponse.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package xquare.app.xquareinfra.domain.deploy.adapter.dto.response | ||
|
||
import xquare.app.xquareinfra.domain.deploy.domain.DeployStatus | ||
|
||
data class SimpleDeployResponse( | ||
val deployName: String, | ||
val repository: String, | ||
val deployStatus: DeployStatus | ||
) |
8 changes: 8 additions & 0 deletions
8
...in/xquare/app/xquareinfra/domain/deploy/application/port/in/FindAllDeployInTeamUseCase.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package xquare.app.xquareinfra.domain.deploy.application.port.`in` | ||
|
||
import xquare.app.xquareinfra.domain.deploy.adapter.dto.response.SimpleDeployListResponse | ||
import java.util.* | ||
|
||
interface FindAllDeployInTeamUseCase { | ||
fun findAllDeployInTime(teamId: UUID): SimpleDeployListResponse | ||
} |
2 changes: 2 additions & 0 deletions
2
src/main/kotlin/xquare/app/xquareinfra/domain/deploy/application/port/out/FindDeployPort.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,7 +1,9 @@ | ||
package xquare.app.xquareinfra.domain.deploy.application.port.out | ||
|
||
import xquare.app.xquareinfra.domain.deploy.domain.Deploy | ||
import xquare.app.xquareinfra.domain.team.domain.Team | ||
|
||
interface FindDeployPort { | ||
fun findByDeployName(deployName: String): Deploy? | ||
fun findAllByTeam(team: Team): List<Deploy> | ||
} |
33 changes: 33 additions & 0 deletions
33
...in/xquare/app/xquareinfra/domain/deploy/application/service/FindAllDeployInTeamService.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package xquare.app.xquareinfra.domain.deploy.application.service | ||
|
||
import org.springframework.stereotype.Service | ||
import org.springframework.transaction.annotation.Transactional | ||
import xquare.app.xquareinfra.domain.deploy.adapter.dto.response.SimpleDeployListResponse | ||
import xquare.app.xquareinfra.domain.deploy.adapter.dto.response.SimpleDeployResponse | ||
import xquare.app.xquareinfra.domain.deploy.application.port.`in`.FindAllDeployInTeamUseCase | ||
import xquare.app.xquareinfra.domain.deploy.application.port.out.FindDeployPort | ||
import xquare.app.xquareinfra.domain.team.application.port.out.FindTeamPort | ||
import xquare.app.xquareinfra.infrastructure.exception.BusinessLogicException | ||
import java.util.* | ||
|
||
@Transactional(readOnly = true) | ||
@Service | ||
class FindAllDeployInTeamService( | ||
private val findTeamPort: FindTeamPort, | ||
private val findDeployPort: FindDeployPort | ||
): FindAllDeployInTeamUseCase { | ||
override fun findAllDeployInTime(teamId: UUID): SimpleDeployListResponse { | ||
val team = findTeamPort.findById(teamId) ?: throw BusinessLogicException.TEAM_NOT_FOUND | ||
val deployList = findDeployPort.findAllByTeam(team) | ||
|
||
return SimpleDeployListResponse( | ||
deployList.map { | ||
SimpleDeployResponse( | ||
deployName = it.deployName, | ||
repository = it.repository, | ||
deployStatus = it.deployStatus | ||
) | ||
} | ||
) | ||
} | ||
} |