-
Notifications
You must be signed in to change notification settings - Fork 3
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
add usecase to set external camera ip [#55] #57
Changes from 3 commits
71a649d
f74e293
fe2ddb2
ae38dab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.foke.together.domain.input | ||
|
||
import com.foke.together.domain.interactor.entity.ExternalCameraIP | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface GetExternalCameraIPInterface { | ||
operator fun invoke(): Flow<ExternalCameraIP> | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.foke.together.domain.interactor | ||
|
||
|
||
import com.foke.together.domain.input.GetExternalCameraIPInterface | ||
import com.foke.together.domain.interactor.entity.ExternalCameraIP | ||
import com.foke.together.domain.output.AppPreferenceInterface | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.map | ||
import javax.inject.Inject | ||
|
||
class GetExternalCameraIPUseCase @Inject constructor( | ||
private val appPreference: AppPreferenceInterface | ||
): GetExternalCameraIPInterface { | ||
override fun invoke(): Flow<ExternalCameraIP> = | ||
appPreference.getExternalCameraIP().map { it } | ||
} | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. String 하나만 박아도 괜찮을까 싶긴 했지만, 다른걸 뭘 넣어야할지 아직 불확실해서 이대로 두었습니다. 예를들면 정상 String검증, Uint32타입으로의 변환, Port필드 추가 등의 아이디어는 있었지만, 현시점 구현에서 불필요할 것이라고도 생각되서요... There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. ExternalCameraIP를 지금 당장 지우고 raw String으로 바꾸는 것도 잠깐 고민했는데, 혹시 모를 확장성을 위해 남겨두도록 하겠습니다! 나중에 잘 판단해서 작업 부탁드립니다ㅎㅎ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.foke.together.domain.interactor.entity | ||
|
||
data class ExternalCameraIP ( | ||
val address: String, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
package com.foke.together.domain.output | ||
|
||
import com.foke.together.domain.interactor.entity.CameraSourceType | ||
import com.foke.together.domain.interactor.entity.ExternalCameraIP | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface AppPreferenceInterface { | ||
fun getCameraSourceType(): Flow<CameraSourceType> | ||
suspend fun setCameraSourceType(type: CameraSourceType) | ||
|
||
fun getExternalCameraIP(): Flow<ExternalCameraIP> | ||
suspend fun setExternalCameraIP(ip: ExternalCameraIP) | ||
|
||
suspend fun clearAll() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.foke.together.presenter.theme | ||
|
||
// Defines commonly used or recycled values | ||
// ex> https://github.com/android/compose-samples/blob/main/JetNews/app/src/main/java/com/example/jetnews/ui/theme/Shape.kt | ||
// e.g. https://github.com/android/compose-samples/blob/main/JetNews/app/src/main/java/com/example/jetnews/ui/theme/Shape.kt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.foke.together.util | ||
|
||
object AppPolicy { | ||
const val DEFAULT_EXTERNAL_CAMERA_IP = "0.0.0.0" | ||
} |
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.
특히 이부분 동작을 어떻게 확인해야하는지 모르겠습니다... 프로토 버프 잘 저장되려나요?ㅋㅋㅋ @DokySp
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.
대신 검증해주셔서 감사합니다!