-
Notifications
You must be signed in to change notification settings - Fork 2
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
8 changed files
with
66 additions
and
17 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
14 changes: 13 additions & 1 deletion
14
moit-api/src/main/kotlin/com/mashup/moit/study/facade/StudyFacade.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,15 +1,27 @@ | ||
package com.mashup.moit.study.facade | ||
|
||
import com.mashup.moit.domain.moit.MoitService | ||
import com.mashup.moit.domain.study.StudyService | ||
import com.mashup.moit.domain.user.UserService | ||
import com.mashup.moit.study.controller.dto.StudyAttendanceKeywordResponse | ||
import com.mashup.moit.study.controller.dto.StudyDetailsResponse | ||
import org.springframework.stereotype.Component | ||
|
||
@Component | ||
class StudyFacade( | ||
private val studyService: StudyService | ||
private val moitService: MoitService, | ||
private val studyService: StudyService, | ||
private val userService: UserService | ||
) { | ||
fun getAttendanceKeyword(studyId: Long): StudyAttendanceKeywordResponse { | ||
return studyService.getAttendanceKeyword(studyId) | ||
.let { StudyAttendanceKeywordResponse.of(it) } | ||
} | ||
|
||
fun getDetails(studyId: Long): StudyDetailsResponse { | ||
val study = studyService.findById(studyId) | ||
val moit = moitService.findById(study.moitId) | ||
val firstAttendanceUserNickname = study.firstAttendanceUserId?.let(userService::findByIdOrNull)?.nickname | ||
return StudyDetailsResponse.of(moit, study, firstAttendanceUserNickname) | ||
} | ||
} |
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
14 changes: 11 additions & 3 deletions
14
moit-domain/src/main/kotlin/com/mashup/moit/domain/study/Study.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,15 @@ | ||
package com.mashup.moit.domain.study | ||
|
||
import java.time.LocalDateTime | ||
|
||
data class Study( | ||
val id: Long, | ||
val moitId: Long, | ||
val order: Int | ||
val id: Long, | ||
val moitId: Long, | ||
val order: Int, | ||
val startAt: LocalDateTime, | ||
val endAt: LocalDateTime, | ||
val remindAt: LocalDateTime?, | ||
val lateAt: LocalDateTime, | ||
val absenceAt: LocalDateTime, | ||
val firstAttendanceUserId: Long? = null | ||
) |
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