forked from wine-area/DMS-Backend
-
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
33 changed files
with
242 additions
and
114 deletions.
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
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
31 changes: 31 additions & 0 deletions
31
...ion/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ResetAllStudyRoomsUseCase.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,31 @@ | ||
package team.aliens.dms.domain.studyroom.usecase | ||
|
||
import team.aliens.dms.common.annotation.UseCase | ||
import team.aliens.dms.domain.studyroom.model.SeatStatus | ||
import team.aliens.dms.domain.studyroom.spi.CommandStudyRoomPort | ||
import team.aliens.dms.domain.studyroom.spi.QueryStudyRoomPort | ||
|
||
@UseCase | ||
class ResetAllStudyRoomsUseCase( | ||
private val commandStudyRoomPort: CommandStudyRoomPort, | ||
private val queryStudyRoomPort: QueryStudyRoomPort | ||
) { | ||
|
||
fun execute() { | ||
val studyRooms = queryStudyRoomPort.queryAllStudyRooms().map { | ||
it.copy( | ||
availableHeadcount = 0 | ||
) | ||
} | ||
|
||
val seats = queryStudyRoomPort.queryAllSeatsBySeatStatus(SeatStatus.IN_USE).map { | ||
it.copy( | ||
studentId = null, | ||
status = SeatStatus.AVAILABLE | ||
) | ||
} | ||
|
||
commandStudyRoomPort.saveAllStudyRooms(studyRooms) | ||
commandStudyRoomPort.saveAllSeat(seats) | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
dms-domain/src/main/kotlin/team/aliens/dms/common/error/ErrorStatus.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,11 @@ | ||
package team.aliens.dms.common.error | ||
|
||
object ErrorStatus { | ||
const val BAD_REQUEST = 400 | ||
const val UNAUTHORIZED = 401 | ||
const val FORBIDDEN = 403 | ||
const val NOT_FOUND = 404 | ||
const val CONFLICT = 409 | ||
const val TOO_MANY_REQUEST = 429 | ||
const val INTERNAL_SERVER_ERROR = 500 | ||
} |
17 changes: 9 additions & 8 deletions
17
dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/error/AuthErrorCode.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
7 changes: 4 additions & 3 deletions
7
dms-domain/src/main/kotlin/team/aliens/dms/domain/file/error/FileErrorCode.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
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: 3 additions & 2 deletions
5
dms-domain/src/main/kotlin/team/aliens/dms/domain/manager/error/ManagerErrorCode.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
5 changes: 3 additions & 2 deletions
5
dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/error/NoticeErrorCode.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
7 changes: 4 additions & 3 deletions
7
dms-domain/src/main/kotlin/team/aliens/dms/domain/point/error/PointHistoryErrorCode.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
7 changes: 4 additions & 3 deletions
7
dms-domain/src/main/kotlin/team/aliens/dms/domain/point/error/PointOptionErrorCode.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
Oops, something went wrong.