Skip to content

Commit

Permalink
Merge branch 'develop' into feature/jaino/#75
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino committed Aug 4, 2024
2 parents 0dd13c9 + 73e7991 commit 42c1398
Show file tree
Hide file tree
Showing 66 changed files with 997 additions and 222 deletions.
4 changes: 4 additions & 0 deletions app/src/main/kotlin/com/bff/wespot/AppNavGraphs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import androidx.navigation.NavHostController
import com.bff.wespot.entire.screen.screen.destinations.AccountSettingScreenDestination
import com.bff.wespot.entire.screen.screen.destinations.EntireScreenDestination
import com.bff.wespot.entire.screen.screen.destinations.NotificationSettingScreenDestination
import com.bff.wespot.entire.screen.screen.destinations.RevokeConfirmScreenDestination
import com.bff.wespot.entire.screen.screen.destinations.RevokeScreenDestination
import com.bff.wespot.entire.screen.screen.destinations.SettingScreenDestination
import com.bff.wespot.message.screen.destinations.MessageEditScreenDestination
import com.bff.wespot.message.screen.destinations.MessageScreenDestination
Expand Down Expand Up @@ -80,6 +82,8 @@ object AppNavGraphs {
SettingScreenDestination,
NotificationSettingScreenDestination,
AccountSettingScreenDestination,
RevokeScreenDestination,
RevokeConfirmScreenDestination,
).routedIn(this)
.associateBy { it.route }
}
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/kotlin/com/bff/wespot/CommonNavGraphNavigator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import com.bff.wespot.entire.screen.screen.NotificationSettingNavigator
import com.bff.wespot.entire.screen.screen.SettingNavigator
import com.bff.wespot.entire.screen.screen.destinations.AccountSettingScreenDestination
import com.bff.wespot.entire.screen.screen.destinations.NotificationSettingScreenDestination
import com.bff.wespot.entire.screen.screen.destinations.RevokeConfirmScreenDestination
import com.bff.wespot.entire.screen.screen.destinations.RevokeScreenDestination
import com.bff.wespot.entire.screen.screen.destinations.SettingScreenDestination
import com.bff.wespot.entire.screen.screen.revoke.RevokeConfirmNavigator
import com.bff.wespot.entire.screen.screen.revoke.RevokeNavigator
import com.bff.wespot.message.screen.MessageNavigator
import com.bff.wespot.message.screen.MessageScreenArgs
import com.bff.wespot.message.screen.ReservedMessageNavigator
Expand Down Expand Up @@ -52,6 +56,8 @@ class CommonNavGraphNavigator(
SettingNavigator,
NotificationSettingNavigator,
AccountSettingNavigator,
RevokeNavigator,
RevokeConfirmNavigator,
VotingNavigator,
VoteResultNavigator,
VoteStorageNavigator,
Expand Down Expand Up @@ -114,6 +120,14 @@ class CommonNavGraphNavigator(
navController.navigate(AccountSettingScreenDestination within navGraph)
}

override fun navigateToRevokeScreen() {
navController.navigate(RevokeScreenDestination within navGraph)
}

override fun navigateToRevokeConfirmScreen() {
navController.navigate(RevokeConfirmScreenDestination within navGraph)
}

override fun navigateToVoteStorageScreen() {
navController.navigate(VoteStorageScreenDestination within navGraph)
}
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/kotlin/com/bff/wespot/NavigatorImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.bff.wespot

import android.content.Context
import android.content.Intent
import com.bff.wespot.auth.AuthActivity
import com.bff.wespot.navigation.Navigator
import com.bff.wespot.navigation.util.buildIntent
import javax.inject.Inject
Expand All @@ -14,4 +15,10 @@ class NavigatorImpl @Inject constructor() : Navigator {
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
return intent
}

override fun navigateToAuth(context: Context): Intent {
val intent = context.buildIntent<AuthActivity>()
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
return intent
}
}
6 changes: 6 additions & 0 deletions core/model/src/main/kotlin/com/bff/wespot/model/ReportType.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.bff.wespot.model

enum class ReportType {
MESSAGE,
VOTE,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.bff.wespot.model.auth.request

import kotlinx.serialization.Serializable

@Serializable
data class RevokeReasonListDto(
val revokeReasons: List<String>,
)
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
package com.bff.wespot.model.vote.response

import com.bff.wespot.model.user.response.ProfileCharacter

data class IndividualReceived(
val voteResult: ReceivedResult,
)

data class ReceivedResult(
val voteOption: VoteOption,
val user: ReceivedUser,
val user: VoteUser,
val rate: Int,
val voteCount: Int,
)

data class ReceivedUser(
val id: Int,
val name: String,
val introduction: String,
val profile: ProfileCharacter,
)
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
package com.bff.wespot.model.vote.response

import com.bff.wespot.model.user.response.ProfileCharacter

data class IndividualSent(
val voteResult: SentResult,
)

data class SentResult(
val voteOption: VoteOption,
val voteUsers: List<SentUser>,
)

data class SentUser(
val id: Int,
val name: String,
val profile: ProfileCharacter,
val voteUsers: List<VoteUser>,
)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ data class SentVoteStorage(
data class SentVoteResult(
override val voteOption: VoteOption,
override val voteCount: Int,
val user: VoteProfile,
val user: VoteUser,
) : StorageVoteResult(voteOption, voteCount)
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.bff.wespot.model.vote.response

import com.bff.wespot.model.user.response.ProfileCharacter

data class VoteResults(
val voteResults: List<VoteResult>,
)
Expand All @@ -12,13 +10,6 @@ data class VoteResult(
)

data class Result(
val user: VoteProfile,
val user: VoteUser,
val voteCount: Int,
)

data class VoteProfile(
val id: Int,
val name: String,
val introduction: String,
val profile: ProfileCharacter,
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import com.bff.wespot.model.user.response.ProfileCharacter
data class VoteUser(
val id: Int,
val name: String,
val introduction: String,
val profile: ProfileCharacter,
) {
constructor() : this(0, "", ProfileCharacter())
constructor() : this(0, "", "", ProfileCharacter())
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.content.Context
import android.content.Intent

interface Navigator {
fun navigateToMain(
context: Context
) : Intent
}
fun navigateToMain(context: Context) : Intent

fun navigateToAuth(context: Context): Intent
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.bff.wespot.navigation.util

const val EXTRA_TOAST_MESSAGE = "extra_toast_message"
63 changes: 63 additions & 0 deletions core/ui/src/main/kotlin/com/bff/wespot/ui/ReportBottomSheet.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.bff.wespot.ui

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.SheetState
import androidx.compose.material3.Text
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.bff.wespot.designsystem.theme.StaticTypeScale

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ReportBottomSheet(
closeSheet: () -> Unit,
sheetState: SheetState = rememberModalBottomSheetState(
skipPartiallyExpanded = true,
),
options: List<String>,
optionsClickable: List<() -> Unit>,
) {
require(options.size == optionsClickable.size) {
"options and optionsClickable must have the same size"
}

WSBottomSheet(closeSheet = closeSheet, sheetState = sheetState) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 20.dp, vertical = 28.dp),
) {
options.forEachIndexed { index, option ->
ReportSection(text = option, onClick = optionsClickable[index])
if (index != options.size - 1) {
HorizontalDivider(
color = Color(0xFF4F5157),
)
}
}
}
}
}

@Composable
private fun ReportSection(text: String, onClick: () -> Unit) {
Box(
modifier = Modifier
.fillMaxWidth()
.clickable { onClick.invoke() }
.padding(vertical = 16.dp),
contentAlignment = Alignment.Center,
) {
Text(text = text, style = StaticTypeScale.Default.body4)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ object ClientModule {
fun provideHttpClient(): HttpClient = HttpClient(CIO) {
defaultRequest {
header(HttpHeaders.ContentType, ContentType.Application.Json)
url("https://6b409150-3fee-4f26-9b7b-16162b8918cb.mock.pstmn.io/")
url(BuildConfig.MOCK_BASE_URL)
}

// TODO Token 연동
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.bff.wespot.data.remote.di

import com.bff.wespot.data.remote.source.CommonDataSource
import com.bff.wespot.data.remote.source.CommonDataSourceImpl
import com.bff.wespot.data.remote.source.auth.AuthDataSource
import com.bff.wespot.data.remote.source.auth.AuthDataSourceImpl
import com.bff.wespot.data.remote.source.message.MessageDataSource
Expand Down Expand Up @@ -56,4 +58,10 @@ abstract class DataRemoteModule {
abstract fun bindsNotificationDataSource(
notificationDataSourceImpl: NotificationDataSourceImpl
): NotificationDataSource
}

@Binds
@Singleton
abstract fun bindsCommonDataSource(
commonDataSourceImpl: CommonDataSourceImpl
): CommonDataSource
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.bff.wespot.data.remote.model

import kotlinx.serialization.Serializable

@Serializable
data class ProfanityDto (
val message: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.bff.wespot.data.remote.model

import com.bff.wespot.model.ReportType
import kotlinx.serialization.Serializable

@Serializable
data class ReportDto (
val type: ReportType,
val targetId: Int,
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.bff.wespot.data.remote.model.vote.response

import com.bff.wespot.data.remote.model.user.response.ProfileCharacterDto
import com.bff.wespot.model.vote.response.IndividualReceived
import com.bff.wespot.model.vote.response.ReceivedResult
import com.bff.wespot.model.vote.response.ReceivedUser
import kotlinx.serialization.Serializable

@Serializable
Expand All @@ -18,29 +16,14 @@ data class IndividualReceivedDto(
@Serializable
data class ReceivedResultDto(
val voteOption: VoteOptionDto,
val user: ReceivedUserDto,
val user: VoteUserDto,
val rate: Int,
val voteCount: Int,
) {
fun toReceivedResult() = ReceivedResult(
voteOption = voteOption.toVoteOption(),
user = user.toReceivedUser(),
user = user.toVoteUser(),
rate = rate,
voteCount = voteCount,
)
}

@Serializable
data class ReceivedUserDto(
val id: Int,
val name: String,
val introduction: String,
val profile: ProfileCharacterDto,
) {
fun toReceivedUser() = ReceivedUser(
id = id,
name = name,
introduction = introduction,
profile = profile.toProfileCharacter(),
)
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.bff.wespot.data.remote.model.vote.response

import com.bff.wespot.data.remote.model.user.response.ProfileCharacterDto
import com.bff.wespot.model.vote.response.IndividualSent
import com.bff.wespot.model.vote.response.SentResult
import com.bff.wespot.model.vote.response.SentUser
import com.bff.wespot.model.vote.response.VoteUser
import kotlinx.serialization.Serializable

@Serializable
Expand All @@ -28,18 +27,12 @@ data class SentResultDto(

@Serializable
data class SentUsersDto(
val user: SentUserDto,
val user: VoteUserDto,
) {
fun toSentUser() = SentUser (
fun toSentUser() = VoteUser (
id = user.id,
name = user.name,
introduction = user.introduction,
profile = user.profile.toProfileCharacter(),
)
}

@Serializable
data class SentUserDto(
val id: Int,
val name: String,
val profile: ProfileCharacterDto
)
Loading

0 comments on commit 42c1398

Please sign in to comment.