-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TNT-181] 트레이니 홈 화면 일별 기록 UI 구현 #71
Merged
Merged
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
29157f1
[TNT-181] refactor: RecordChip에 ChipStyle 추가
SeonJeongk a8f4659
[TNT-181] feat: 선택된 날짜의 PT수업과 기록 UI 구현
SeonJeongk 04f8216
[TNT-181] fix: 기록/일정 있는 날짜에 icon 보이도록 수정
SeonJeongk 49f681d
[TNT-181] fix: 배경색 수정
SeonJeongk 6a1f84e
[TNT-181] fix: lint 오류 해결
SeonJeongk 6f6d237
[TNT-181] refactor: Scaffold 대신 LazyColumn으로 구현
SeonJeongk 73e1705
[TNT-181] feat: 트레이니 홈화면 기록 관련 data class 구현
SeonJeongk 517dd69
[TNT-181] feat: TraineeRepository 생성
SeonJeongk e3c2e6a
[TNT-181] fix: Repository에서 UI 데이터 받아오도록 수정
SeonJeongk aa7d45f
[TNT-181] refactor: 변수명 수정
SeonJeongk bb70441
[TNT-181] fix: 선택된 날짜 관리 state로 통일
SeonJeongk 07fce7d
[TNT-181] fix: import 순서 변경
SeonJeongk 9c5913d
[TNT-181] refactor: composable 분리
SeonJeongk 5928b51
[TNT-181] refactor: 화면 간격 수정
SeonJeongk 7f7bb7a
[TNT-181] fix: 기록 데이터 null 허용 제거
SeonJeongk d2cde4c
[TNT-181] fix: 주간 이동 시 선택된 날짜 변경되지 않도록 수정
SeonJeongk ca33ad3
[TNT-181] feat: develop branch DataFormatter 코드 추가
SeonJeongk 896295e
[TNT-181] feat: 데이터 클래스 리팩토링 및 도메인 변환 구현
SeonJeongk 0514a9f
[TNT-181] refactor: 변수명 변경
SeonJeongk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
160 changes: 160 additions & 0 deletions
160
data/repository/src/main/java/co/kr/data/repository/TraineeRepositoryImpl.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,160 @@ | ||
package co.kr.data.repository | ||
|
||
import co.kr.tnt.domain.model.RecordType | ||
import co.kr.tnt.domain.model.trainee.DailyDataStatus | ||
import co.kr.tnt.domain.model.trainee.DailyRecord | ||
import co.kr.tnt.domain.model.trainee.PtSession | ||
import co.kr.tnt.domain.model.trainee.TraineeDailyLog | ||
import co.kr.tnt.domain.repository.TraineeRepository | ||
import java.time.LocalDate | ||
import java.time.YearMonth | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
internal class TraineeRepositoryImpl @Inject constructor() : TraineeRepository { | ||
// TODO : API에 맞춰 수정 | ||
override suspend fun getDailyDataStatus(yearMonth: YearMonth): DailyDataStatus { | ||
val result = DailyDataStatus( | ||
date = listOf( | ||
LocalDate.of(2025, 2, 3), | ||
LocalDate.of(2025, 2, 8), | ||
LocalDate.of(2025, 2, 10), | ||
LocalDate.of(2025, 2, 15), | ||
LocalDate.of(2025, 2, 23), | ||
), | ||
) | ||
|
||
return result | ||
} | ||
|
||
override suspend fun getTraineeDailyLog(day: LocalDate): TraineeDailyLog { | ||
val result = listOf( | ||
TraineeDailyLog( | ||
date = LocalDate.of(2025, 2, 3), | ||
ptSession = PtSession( | ||
ptSessionId = "CDE35K32", | ||
trainerName = "김헬스", | ||
trainerImage = "https://buly.kr/44x6xFN", | ||
session = 12, | ||
startTime = "2025-02-03T08:00:00.000Z", | ||
endTime = "2025-02-03T09:00:00.000Z", | ||
hasRecord = true, | ||
), | ||
record = listOf( | ||
DailyRecord( | ||
recordId = "VDF1D907", | ||
recordType = RecordType.MealType.BREAKFAST, | ||
recordTime = "2025-02-03T08:00:00.000Z", | ||
recordImage = "https://buly.kr/BpESNP5", | ||
recordContents = "아침으로 계란 2개 먹었습니다.", | ||
feedbackCount = 1, | ||
), | ||
DailyRecord( | ||
recordId = "VDF1D907", | ||
recordType = RecordType.MealType.LUNCH, | ||
recordTime = "2025-02-03T13:00:00.000Z", | ||
recordImage = "https://buly.kr/BpESNP5", | ||
recordContents = "점심으로 계란 5개 먹었습니다.", | ||
feedbackCount = 0, | ||
), | ||
), | ||
), | ||
TraineeDailyLog( | ||
date = LocalDate.of(2025, 2, 8), | ||
ptSession = null, | ||
record = listOf( | ||
DailyRecord( | ||
recordId = "VDF1D907", | ||
recordType = RecordType.MealType.BREAKFAST, | ||
recordTime = "2025-02-08T13:00:00.000Z", | ||
recordImage = "https://buly.kr/BpESNP5", | ||
recordContents = "계란 2개 먹었습니다.", | ||
feedbackCount = 1, | ||
), | ||
DailyRecord( | ||
recordId = "VDF1D907", | ||
recordType = RecordType.MealType.SNACK, | ||
recordTime = "2025-02-08T15:00:00.000Z", | ||
recordImage = "https://buly.kr/BpESNP5", | ||
recordContents = "계란 반개 먹었습니다.", | ||
feedbackCount = 0, | ||
), | ||
DailyRecord( | ||
recordId = "VDF1D907", | ||
recordType = RecordType.MealType.DINNER, | ||
recordTime = "2025-02-08T18:40:00.000Z", | ||
recordImage = null, | ||
recordContents = "저녁으로 소고기 먹었습니다.", | ||
feedbackCount = 2, | ||
), | ||
), | ||
), | ||
TraineeDailyLog( | ||
date = LocalDate.of(2025, 2, 15), | ||
ptSession = PtSession( | ||
ptSessionId = "OSI93DG1", | ||
trainerName = "이강사", | ||
trainerImage = null, | ||
session = 15, | ||
startTime = "2025-02-15T18:00:00.000Z", | ||
endTime = "2025-02-15T19:00:00.000Z", | ||
hasRecord = true, | ||
), | ||
record = listOf( | ||
DailyRecord( | ||
recordId = "VDF1D907", | ||
recordType = RecordType.MealType.LUNCH, | ||
recordTime = "2025-02-15T13:00:00.000Z", | ||
recordImage = null, | ||
recordContents = "비빔밥, 바나나 1개", | ||
feedbackCount = 1, | ||
), | ||
DailyRecord( | ||
recordId = "VDF1D907", | ||
recordType = RecordType.MealType.DINNER, | ||
recordTime = "2025-02-03T20:00:00.000Z", | ||
recordImage = "https://buly.kr/BpESNP5", | ||
recordContents = "계란 5개 먹었습니다.", | ||
feedbackCount = 0, | ||
), | ||
), | ||
), | ||
TraineeDailyLog( | ||
date = LocalDate.of(2025, 2, 10), | ||
ptSession = PtSession( | ||
ptSessionId = "CDK392DF", | ||
trainerName = "박트레이너", | ||
trainerImage = null, | ||
session = 10, | ||
startTime = "2025-02-10T14:30:00.000Z", | ||
endTime = "2025-02-10T15:30:00.000Z", | ||
hasRecord = false, | ||
), | ||
record = null, | ||
), | ||
TraineeDailyLog( | ||
date = LocalDate.of(2025, 2, 23), | ||
ptSession = PtSession( | ||
ptSessionId = "CDE35K32", | ||
trainerName = "정트레이너", | ||
trainerImage = "https://buly.kr/44x6xFN", | ||
session = 25, | ||
startTime = "2025-02-23T06:00:00.000Z", | ||
endTime = "2025-02-23T06:50:00.000Z", | ||
hasRecord = true, | ||
), | ||
record = null, | ||
), | ||
) | ||
|
||
val filteredRecord = result.find { it.date == day } | ||
val noData = TraineeDailyLog( | ||
date = day, | ||
ptSession = null, | ||
record = null, | ||
) | ||
|
||
return filteredRecord ?: noData | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
domain/src/main/java/co/kr/tnt/domain/model/trainee/DailyDataStatus.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,7 @@ | ||
package co.kr.tnt.domain.model.trainee | ||
|
||
import java.time.LocalDate | ||
|
||
data class DailyDataStatus( | ||
val date: List<LocalDate>, | ||
) |
30 changes: 30 additions & 0 deletions
30
domain/src/main/java/co/kr/tnt/domain/model/trainee/TraineeDailyLog.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,30 @@ | ||
package co.kr.tnt.domain.model.trainee | ||
|
||
import co.kr.tnt.domain.model.RecordType | ||
import java.time.LocalDate | ||
|
||
data class TraineeDailyLog( | ||
val date: LocalDate, | ||
val ptSession: PtSession?, | ||
val record: List<DailyRecord>?, | ||
) | ||
|
||
data class PtSession( | ||
val ptSessionId: String, | ||
val trainerName: String, | ||
val trainerImage: String?, | ||
val session: Int, | ||
val startTime: String, | ||
val endTime: String, | ||
val hasRecord: Boolean, | ||
) | ||
|
||
// TODO: RecordType 매핑 | ||
data class DailyRecord( | ||
val recordId: String, | ||
val recordType: RecordType, | ||
val recordTime: String, | ||
val recordImage: String?, | ||
val recordContents: String, | ||
val feedbackCount: Int, | ||
) |
12 changes: 12 additions & 0 deletions
12
domain/src/main/java/co/kr/tnt/domain/repository/TraineeRepository.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,12 @@ | ||
package co.kr.tnt.domain.repository | ||
|
||
import co.kr.tnt.domain.model.trainee.DailyDataStatus | ||
import co.kr.tnt.domain.model.trainee.TraineeDailyLog | ||
import java.time.LocalDate | ||
import java.time.YearMonth | ||
|
||
interface TraineeRepository { | ||
suspend fun getDailyDataStatus(yearMonth: YearMonth): DailyDataStatus | ||
|
||
suspend fun getTraineeDailyLog(date: LocalDate): TraineeDailyLog | ||
} |
13 changes: 9 additions & 4 deletions
13
feature/trainee/home/src/main/java/co/kr/tnt/trainee/home/TraineeHomeContract.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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요 상태가 어떤 역할을 하는지 이해하지 못했어요 ㅜ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectedDay
는 현재 달력에서 선택된 날짜이고,dailyDataState
는 달력에 PT 수업 혹은 기록이 있으면 icon을 표시하기 위해 해당하는 날짜들을 담고있습니다..!