Skip to content

Commit

Permalink
[chore] #140 ktlintformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook123 committed Oct 26, 2024
1 parent 2af212a commit bb6271f
Show file tree
Hide file tree
Showing 41 changed files with 212 additions and 130 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.example.exhibition.di

import com.example.exhibition.repository.ExhibitionRepositoryImpl
import com.example.exhibition.repository.SearchRepositoryImpl
import com.record.exhibition.repository.ExhibitionRepository
import com.record.exhibition.repository.SearchRepository
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
Expand All @@ -14,4 +16,8 @@ abstract class RepositoryModule {
@Binds
@Singleton
abstract fun bindsExhibitionRepository(exhibitionRepositoryImpl: ExhibitionRepositoryImpl): ExhibitionRepository

@Binds
@Singleton
abstract fun bindsSearchRepository(searchRepositoryImpl: SearchRepositoryImpl): SearchRepository
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.exhibition.model.remote.request


import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -15,5 +14,5 @@ data class RequestPatchExhibitionDto(
@SerialName("name")
val name: String,
@SerialName("startDate")
val startDate: String
val startDate: String,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.exhibition.model.remote.request


import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -15,5 +14,5 @@ data class RequestPostExhibitionDto(
@SerialName("placeId")
val placeId: Int,
@SerialName("startDate")
val startDate: String
val startDate: String,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.exhibition.model.remote.request


import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -15,5 +14,5 @@ data class RequestPostPlaceDto(
@SerialName("longitude")
val longitude: Int,
@SerialName("name")
val name: String
val name: String,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.exhibition.model.remote.response


import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -11,5 +10,5 @@ data class Location(
@SerialName("latitude")
val latitude: Double,
@SerialName("longitude")
val longitude: Double
val longitude: Double,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.exhibition.model.remote.response


import com.record.exhibition.model.Exhibition
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand All @@ -14,12 +13,15 @@ data class ResponseGetExhibitionsDto(
@SerialName("name")
val name: String,
@SerialName("startDate")
val startDate: String
val startDate: String,
@SerialName("endDate")
val endDate: String,
)

fun ResponseGetExhibitionsDto.toDomain() = Exhibition(
id = this.id,
isFree = this.isFree,
name = this.name,
startDate = this.startDate,
endDate = this.endDate,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.exhibition.model.remote.response

import com.record.model.Page
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.exhibition.model.remote.response


import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -19,5 +18,5 @@ data class ResponseGetPlaceDto(
@SerialName("platformId")
val platformId: String?,
@SerialName("recordSize")
val recordSize: Int
val recordSize: Int,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.exhibition.model.remote.response


import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -15,5 +14,5 @@ data class ResponseGetReviewsDto(
@SerialName("id")
val id: Int,
@SerialName("rating")
val rating: Int
val rating: Int,
)
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ExhibitionRepositoryImpl @Inject constructor(
recordCount = it.recordSize,
exhibitionRecord = result?.data?.map { it.toCore() },
)
}
},
)
}.recoverCatching { exception ->
when (exception) {
Expand All @@ -60,7 +60,7 @@ class ExhibitionRepositoryImpl @Inject constructor(
name = it.name,
exhibitionCount = it.exhibitionSize,
recordCount = it.recordSize,
exhibitionRecord = result?.data?.map { it.toCore() }
exhibitionRecord = result?.data?.map { it.toCore() },
)
}.recoverCatching { exception ->
when (exception) {
Expand All @@ -75,7 +75,7 @@ class ExhibitionRepositoryImpl @Inject constructor(
}

override suspend fun getExhibitions(placeId: Long, filter: ExhibitionFilter): Result<List<Exhibition>> = runCatching {
when(filter){
when (filter) {
ExhibitionFilter.DEFAULT -> remoteExhibitionDataSource.getExhibitionById(placeId.toInt())
ExhibitionFilter.FREE -> remoteExhibitionDataSource.getFreeExhibition(placeId.toInt())
ExhibitionFilter.CLOSING -> remoteExhibitionDataSource.getClosingExhibition(placeId.toInt())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ import com.example.exhibition.model.remote.response.ResponseGetExhibitionsDto

interface RemoteExhibitionDataSource {
suspend fun postExhibition(
requestPostExhibitionDto: RequestPostExhibitionDto
requestPostExhibitionDto: RequestPostExhibitionDto,
)

suspend fun getExhibitionById(
placeId: Int
placeId: Int,
): List<ResponseGetExhibitionsDto>

suspend fun getFreeExhibition(
placeId: Int
placeId: Int,
): List<ResponseGetExhibitionsDto>

suspend fun getClosingExhibition(
placeId: Int
placeId: Int,
): List<ResponseGetExhibitionsDto>

suspend fun patchExhibition(
requestPatchExhibitionDto: RequestPatchExhibitionDto
requestPatchExhibitionDto: RequestPatchExhibitionDto,
)

suspend fun deleteExhibition(
exhibitionId: Int
exhibitionId: Int,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ import com.example.exhibition.model.remote.response.ResponseGetReviewsDto

interface RemotePlaceDataSource {
suspend fun postPlace(
requestPostPlaceDto: RequestPostPlaceDto
requestPostPlaceDto: RequestPostPlaceDto,
)

suspend fun getPlaceById(
id: Int
id: Int,
): ResponseGetPlaceDto

suspend fun getReviewsById(
id: Int
id: Int,
): List<ResponseGetReviewsDto>

suspend fun getNearPlace(
number: Int,
size: Int,
latitude: Double,
longitude: Double,
distance: Double
distance: Double,
): ResponseGetPagingPlaceDto

suspend fun getHasInProgressExhibitionPlaces(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ data class Exhibition(
val id: Int,
val isFree: Boolean,
val name: String,
val startDate: String
val startDate: String,
val endDate: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package com.record.exhibition.model
enum class ExhibitionFilter {
DEFAULT,
FREE,
CLOSING
CLOSING,
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ data class Place(
val name: String,
val exhibitionCount: Int,
val recordCount: Int,
val exhibitionRecord: List<VideoData>?
val exhibitionRecord: List<VideoData>?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ fun VideoData.toCore() = com.record.model.VideoData(
location = this.location,
uploaderId = this.uploaderId,
nickname = this.nickname,
isMine = this.isMine
isMine = this.isMine,
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface VideoRepository {
suspend fun getAllVideos(cursorId: Long, pageSize: Int): Result<List<VideoData>>
suspend fun getRecentVideos(keywords: List<String>?, cursor: Long, pageSize: Int): Result<Cursor<VideoData>>
suspend fun getPopularVideos(keywords: List<String>?, pageNumber: Int, pageSize: Int): Result<Page<VideoData>>
suspend fun getPlaceVideos(placeId: Int, cursor:Long, pageSize: Int): Result<Cursor<VideoData>>
suspend fun getPlaceVideos(placeId: Int, cursor: Long, pageSize: Int): Result<Cursor<VideoData>>
suspend fun getUserVideos(otherUserId: Long, cursorId: Long, size: Int): Result<Cursor<VideoData>>
suspend fun getMyVideos(cursorId: Long, size: Int): Result<Cursor<VideoData>>
suspend fun getFollowingVideos(cursorId: Long, size: Int): Result<Cursor<VideoData>>
Expand Down
1 change: 1 addition & 0 deletions feature/detail/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ android {
}
dependencies {
implementation(projects.domain.video)
implementation(projects.domain.exhibition)
}
12 changes: 7 additions & 5 deletions feature/detail/src/main/java/com/record/detail/DetailScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun DetailRoute(
padding: PaddingValues,
modifier: Modifier = Modifier,
viewModel: DetailpageViewModel = hiltViewModel(),
navigateToUplaod: () -> Unit,
navigateToUpload: () -> Unit,
navigateToVideo: (VideoType, Long) -> Unit,
) {
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
Expand Down Expand Up @@ -82,7 +82,8 @@ fun DetailRoute(
navigateToVideo = viewModel::navigateToVideoDetail,
onLoadMoreReviews = viewModel::loadMoreReviewVideos,
onBookmarkClick = viewModel::bookmark,
navigateToUpload = navigateToUplaod,
navigateToUpload = navigateToUpload,
onChipSelected = viewModel::selectChip,
)
}
}
Expand All @@ -96,6 +97,7 @@ fun DetailpageScreen(
navigateToUpload: () -> Unit,
onLoadMoreReviews: () -> Unit,
onBookmarkClick: (Long) -> Unit,
onChipSelected: (ChipTab) -> Unit,
) {
val pagerState = rememberPagerState(
initialPage = state.detailpageTab.ordinal,
Expand Down Expand Up @@ -178,10 +180,10 @@ fun DetailpageScreen(
ListScreen(
exhibitionItems = state.exhibitionList,
exhibitionCount = state.exhibitionCount,
selectedChip = selectedChipState.value,
selectedChip = state.selectedChip,
onItemClick = {},
onChipSelected = { selectedChip ->
selectedChipState.value = selectedChip
onChipSelected(selectedChip)
},
)
}
Expand Down Expand Up @@ -220,7 +222,7 @@ fun CustomTabRow(

val animatedIndicatorWidth by animateDpAsState(
targetValue = tabWidth - 12.dp,
animationSpec = tween(200),
animationSpec = tween(0),
)

val density = LocalDensity.current
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
package com.record.detail

import com.record.detail.screen.ChipTab
import com.record.exhibition.model.Exhibition
import com.record.model.VideoData
import com.record.model.VideoType
import com.record.ui.base.SideEffect
import com.record.ui.base.UiState
import com.record.video.model.VideoData
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList

data class DetailpageState(
val placeName: String = "국립현대미술관",
val placeAddress: String = "서울특별시 종로구 삼청로 30",
val placeId: Long = 0,
val placeName: String = "",
val placeAddress: String = "",
val exhibitionCount: Int = 0,
val reviewVideoCount: Int = 0,
val reviewCursor: Long = 0,
val reviewIsEnd: Boolean = false,
val detailpageTab: DetailpageTab = DetailpageTab.LIST,
val exhibitionList: ImmutableList<Triple<String, String, String>> = emptyList<Triple<String, String, String>>().toImmutableList(),
val selectedChip: ChipTab = ChipTab.ALL,
val exhibitionList: ImmutableList<Exhibition> = emptyList<Exhibition>().toImmutableList(),
val reviewList: ImmutableList<VideoData> = emptyList<VideoData>().toImmutableList(),
) : UiState

Expand Down
Loading

0 comments on commit bb6271f

Please sign in to comment.