-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature/#146] 내 제보 기록 화면 구현 #151
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8e0e7e9
Feat: 제보 히스토리 UI 구현
l5x5l 1533248
FIX: 제보 히스토리 UI State 수정 - 선택된 카테고리/진행 상황에 따라 해당되는 제보 목록만 표시되도록 수정
l5x5l c472f16
Feat: 제보 카테고리 선택 bottomSheet구현, 제보 히스토리 ViewModel 뼈대 구현 및 적용
l5x5l 71aac61
Feat: 제보 목록 조회 UseCase 및 Repository 메서드 구현
l5x5l 91f55d4
Feat: 제보 목록 화면에 제보 목록 조회 UseCase 적용 및 마이페이지에서 제보 목록 화면 이동 로직 추가
l5x5l 59d500d
FIX: 제보 목록 날짜 표시 형식을 "25.11.03 월" 구조로 표시되도록 수정
l5x5l 40b9d87
FIX: ReportCategoryBottomSheet에서 구분선 표시 관련하여 잘못된 enum 참조 수정
l5x5l 18d6f61
FIX: BitnagilChip의 count인자 제거, 세부 코드 수정
l5x5l 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
60 changes: 60 additions & 0 deletions
60
...ignsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilChip.kt
This file contains hidden or 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,60 @@ | ||
| package com.threegap.bitnagil.designsystem.component.atom | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.threegap.bitnagil.designsystem.BitnagilTheme | ||
| import com.threegap.bitnagil.designsystem.modifier.clickableWithoutRipple | ||
|
|
||
| @Composable | ||
| fun BitnagilChip( | ||
| title: String, | ||
| isSelected: Boolean, | ||
| onCategorySelected: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Box( | ||
| contentAlignment = Alignment.Center, | ||
| modifier = modifier | ||
| .background( | ||
| color = if (!isSelected) BitnagilTheme.colors.white else BitnagilTheme.colors.coolGray10, | ||
| shape = RoundedCornerShape(20.dp), | ||
| ) | ||
| .height(36.dp) | ||
| .clickableWithoutRipple(onClick = onCategorySelected) | ||
| .padding( | ||
| vertical = 6.dp, | ||
| horizontal = 14.dp, | ||
| ), | ||
| ) { | ||
| Text( | ||
| text = title, | ||
| color = if (!isSelected) BitnagilTheme.colors.coolGray60 else BitnagilTheme.colors.white, | ||
| style = if (!isSelected) BitnagilTheme.typography.caption1Medium else BitnagilTheme.typography.caption1SemiBold, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun RecommendCategoryChipStatesPreview() { | ||
| Column( | ||
| verticalArrangement = Arrangement.spacedBy(8.dp), | ||
| ) { | ||
| BitnagilChip( | ||
| title = "맞춤 추천", | ||
| isSelected = true, | ||
| onCategorySelected = {}, | ||
| ) | ||
| } | ||
| } |
2 changes: 2 additions & 0 deletions
2
data/src/main/java/com/threegap/bitnagil/data/report/datasource/ReportDataSource.kt
This file contains hidden or 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 com.threegap.bitnagil.data.report.datasource | ||
|
|
||
| import com.threegap.bitnagil.data.report.model.request.ReportRequestDto | ||
| import com.threegap.bitnagil.data.report.model.response.ReportHistoriesPerDateDto | ||
|
|
||
| interface ReportDataSource { | ||
| suspend fun submitReport(reportRequestDto: ReportRequestDto): Result<Long> | ||
| suspend fun getReports(): Result<ReportHistoriesPerDateDto> | ||
| } |
This file contains hidden or 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
19 changes: 19 additions & 0 deletions
19
...c/main/java/com/threegap/bitnagil/data/report/model/response/ReportHistoriesPerDateDto.kt
This file contains hidden or 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,19 @@ | ||
| package com.threegap.bitnagil.data.report.model.response | ||
|
|
||
| import com.threegap.bitnagil.domain.report.model.ReportItem | ||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
| import java.time.LocalDate | ||
|
|
||
| @Serializable | ||
| data class ReportHistoriesPerDateDto( | ||
| @SerialName("reportInfos") | ||
| val reportInfos: Map<String, List<ReportItemDto>>, | ||
| ) | ||
|
|
||
| fun ReportHistoriesPerDateDto.toDomainMap(): Map<LocalDate, List<ReportItem>> = | ||
| this.reportInfos | ||
| .mapKeys { LocalDate.parse(it.key) } | ||
| .mapValues { entry -> | ||
| entry.value.map { it.toDomain() } | ||
| } | ||
l5x5l marked this conversation as resolved.
Show resolved
Hide resolved
|
||
33 changes: 33 additions & 0 deletions
33
data/src/main/java/com/threegap/bitnagil/data/report/model/response/ReportItemDto.kt
This file contains hidden or 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 com.threegap.bitnagil.data.report.model.response | ||
|
|
||
| import com.threegap.bitnagil.domain.report.model.ReportCategory | ||
| import com.threegap.bitnagil.domain.report.model.ReportItem | ||
| import com.threegap.bitnagil.domain.report.model.ReportStatus | ||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class ReportItemDto( | ||
| @SerialName("reportId") | ||
| val reportId: Int, | ||
| @SerialName("reportStatus") | ||
| val reportStatus: String, | ||
| @SerialName("reportTitle") | ||
| val reportTitle: String, | ||
| @SerialName("reportCategory") | ||
| val reportCategory: String, | ||
| @SerialName("reportLocation") | ||
| val reportLocation: String, | ||
| @SerialName("reportImageUrl") | ||
| val reportImageUrl: String, | ||
| ) | ||
|
|
||
| fun ReportItemDto.toDomain(): ReportItem = | ||
| ReportItem( | ||
| id = this.reportId, | ||
| status = ReportStatus.fromString(this.reportStatus), | ||
| title = this.reportTitle, | ||
| category = ReportCategory.fromString(this.reportCategory), | ||
| address = this.reportLocation, | ||
| imageUrl = this.reportImageUrl, | ||
| ) |
This file contains hidden or 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
data/src/main/java/com/threegap/bitnagil/data/report/service/ReportService.kt
This file contains hidden or 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,13 +1,18 @@ | ||
| package com.threegap.bitnagil.data.report.service | ||
|
|
||
| import com.threegap.bitnagil.data.report.model.request.ReportRequestDto | ||
| import com.threegap.bitnagil.data.report.model.response.ReportHistoriesPerDateDto | ||
| import com.threegap.bitnagil.network.model.BaseResponse | ||
| import retrofit2.http.Body | ||
| import retrofit2.http.GET | ||
| import retrofit2.http.POST | ||
|
|
||
| interface ReportService { | ||
| @POST("/api/v2/reports") | ||
| suspend fun submitReport( | ||
| @Body reportRequestDto: ReportRequestDto, | ||
| ): BaseResponse<Long> | ||
|
|
||
| @GET("/api/v2/reports") | ||
| suspend fun getReports(): BaseResponse<ReportHistoriesPerDateDto> | ||
| } |
10 changes: 10 additions & 0 deletions
10
domain/src/main/java/com/threegap/bitnagil/domain/report/model/ReportItem.kt
This file contains hidden or 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,10 @@ | ||
| package com.threegap.bitnagil.domain.report.model | ||
|
|
||
| data class ReportItem( | ||
| val id: Int, | ||
| val title: String, | ||
| val category: ReportCategory, | ||
| val status: ReportStatus, | ||
| val imageUrl: String, | ||
| val address: String, | ||
| ) |
27 changes: 27 additions & 0 deletions
27
domain/src/main/java/com/threegap/bitnagil/domain/report/model/ReportStatus.kt
This file contains hidden or 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,27 @@ | ||
| package com.threegap.bitnagil.domain.report.model | ||
|
|
||
| enum class ReportStatus { | ||
| Pending, | ||
| InProgress, | ||
| Completed, | ||
| ; | ||
|
|
||
| companion object { | ||
| fun fromString(value: String): ReportStatus { | ||
| return when (value) { | ||
| "PENDING" -> Pending | ||
| "IN_PROGRESS" -> InProgress | ||
| "COMPLETED" -> Completed | ||
| else -> throw IllegalArgumentException("Invalid ReportStatus value: $value") | ||
| } | ||
| } | ||
|
|
||
| fun toString(value: ReportStatus): String { | ||
| return when (value) { | ||
| Pending -> "PENDING" | ||
| InProgress -> "IN_PROGRESS" | ||
| Completed -> "COMPLETED" | ||
| } | ||
| } | ||
| } | ||
| } |
3 changes: 3 additions & 0 deletions
3
domain/src/main/java/com/threegap/bitnagil/domain/report/repository/ReportRepository.kt
This file contains hidden or 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,10 @@ | ||
| package com.threegap.bitnagil.domain.report.repository | ||
|
|
||
| import com.threegap.bitnagil.domain.report.model.Report | ||
| import com.threegap.bitnagil.domain.report.model.ReportItem | ||
| import java.time.LocalDate | ||
|
|
||
| interface ReportRepository { | ||
| suspend fun submitReport(report: Report): Result<Long> | ||
| suspend fun getReportHistories(): Result<Map<LocalDate, List<ReportItem>>> | ||
| } |
14 changes: 14 additions & 0 deletions
14
...in/src/main/java/com/threegap/bitnagil/domain/report/usecase/GetReportHistoriesUseCase.kt
This file contains hidden or 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,14 @@ | ||
| package com.threegap.bitnagil.domain.report.usecase | ||
|
|
||
| import com.threegap.bitnagil.domain.report.model.ReportItem | ||
| import com.threegap.bitnagil.domain.report.repository.ReportRepository | ||
| import java.time.LocalDate | ||
| import javax.inject.Inject | ||
|
|
||
| class GetReportHistoriesUseCase @Inject constructor( | ||
| private val reportRepository: ReportRepository, | ||
| ) { | ||
| suspend operator fun invoke(): Result<Map<LocalDate, List<ReportItem>>> { | ||
| return reportRepository.getReportHistories() | ||
| } | ||
| } |
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.