-
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
#219/feature/jsp/backend #222
base: android_develop
Are you sure you want to change the base?
Conversation
โฆurce๋ฅผ aws์ ๋ง๊ฒ ์์
โฆ ์ ๋ณด(ํ ํฐ)๋ฅผ ๊ฐ์ง๊ณ ์๋ ๋ ํฌ์งํ ๋ฆฌ
โฆ๋ฅ๋ก ๊ฐ์ ์ด ๋์ง ์๋ ๋ฌธ์ ์์
ํ์ผ ์ฒด์ธ์ง๋ ๋ฏธ๋ฅด์ฐ๋ค ๋์ค์ ์นดํ๊ฐ์ ํ์ธํด๋ณผ๊ฒ์ฉ |
import kotlinx.coroutines.flow.StateFlow | ||
|
||
interface AccountSessionRepository { | ||
val lastSavedEmail: Flow<String> |
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.
๋ก๊ทธ์ธ ํ๋ฉด์์ ์์ด๋ ์ ์ฅ ๋๋ ์ ๋ ์๋์
๋ ฅ๋๋ ์ด๋ฉ์ผ์ธ๋ฐ
์ด๊ฑฐ๋ SignRepository๋ก ๊ฐ๋๊ฒ ๋ง๊ฒ ๋ค์
์ด ๋ ํฌ๋ ํ์ฌ ๋ก๊ทธ์ธ ์ธ์
๊ด๋ฆฌํ๋ ๋ชฉ์ ์ธ๋ฐ ์ง๊ธ ์ฌ๊ธฐ์ ์์ฐ์ด๊ธฐ๋ ํ๊ณ ๊ด๋ จ์ด ์๋ค์
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.
๋๊ธ ๊ด๋ จ ์ฝ๋๋ค์ ํ์ฌ ๋ก๊ทธ์ธ ์ธ์
์ํ๋ ์ฐ๋ํ๋ ๋ก์ง์ ์ฌ ๊ตฌํํด์ผ ํ๋ ๋ถ๋ถ๋๋ฌธ์ ํฐ ๊ณต์ฌ๊ฐ ๋ ๊ฑฐ ๊ฐ์
๋ก๊ทธ์ธ/ํ์๊ฐ์
๊ตฌํ๋ถํฐ ๋จผ์ ํ๊ณ ์ ์์๋ก ์ฃผ์์ฒ๋ฆฌ ํด๋์๊ฒ ๋ง์ต๋๋ค
class ChangePasswordParameter( | ||
val newPassword: ByteArray, | ||
) |
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.
core/model/requestparameters
ํจํค์ง ๋ด ๋ชจ๋ ํ์ผ์ ๋ํด์ ๊ฐ์ ๋ด์ฉ์
๋๋ค
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.
@pknujsp ๊ทธ๊ฒ ๋ง๋ ๊ฒ ๊ฐ์์. ๊ทธ๋ฅ ํ๋ผ๋ฏธํฐ๋ก ์ ๋ฌํ๊ณ datasource์์ ์์ฒญ ๋ณด๋ด๋ ๊ฒ ํจ์ฌ ๊ฐ๋จํ ๊ฒ ๊ฐ๋ค์.
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.
์ด ๋ถ๋ถ ์์ ํด์ ๋ค์ PR์ ๋ฐ์ํ ๊ฒ์
|
||
<TextView | ||
android:id="@+id/positiveButton" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginEnd="15dp" | ||
android:background="@drawable/radius_main_5" | ||
android:gravity="center" | ||
android:paddingVertical="10dp" | ||
android:text="@string/complete" | ||
android:textColor="@color/white" | ||
android:textSize="18sp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="@id/guideline" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
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.
์ด๋ฐ ์์ผ๋ก ๋์ด๊ฐ๋ฉด ๋ถ๋ช ๊น๋จน๊ธด ํฉ๋๋ค๋ง,
๊ทธ๊ฒ์ ๋ฐฉ์งํ๊ธฐ ์ํด์ ์ด๋ ์จ๋๋๊ฐ ํด์ผ๊ฒ ์ด์.
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.
์๊ฐ์ด ์ง๋๊ณ ๋ณด๋๊น...
๋๋ฌด ์ปจ๋ฒค์ ์ด ๋ถ์กฑํ๊ณ .. ์ฝ๋์ ํ์ง์ด ๋ง์ด ๋ฎ์๋ค๋ ๊ฒ์ ๊นจ๋ซ๊ฒ ๋๋ค์..
๊ทธ ๋งํผ ์ ํฌ๊ฐ ๋ง์ด ์ฑ์ฅํ๋ค๋ ์ฆ๊ฑฐ๊ฒ ์ฃ ...?!
์์ํ ์ฝ๋ฉํธ ๋จ๊ฒจ๋ดค์ต๋๋ค.
๊ณ ๋ด๋ฐฅ PR์ ์กฐ๊ธ ํ๋๋ค์ ํํ...
๊ณ ์ํ์ จ์๋๋ค์ ~ ๐๐๐
@@ -88,7 +88,6 @@ dependencies { | |||
|
|||
implementation(libs.bundles.lifecycles) | |||
implementation(libs.bundles.materials) | |||
implementation(libs.bundles.composes) |
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.
compose import ์ ๊ฑฐํ์ ์ด์ ๊ฐ ๋ฐ๋ก ์์๊น์?
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.
app ๋ชจ๋์์๋ ์ปดํฌ์ฆ ๊ด๋ จ ์ฝ๋๊ฐ ํ๋๋ ์์ด์ ์ ๊ฑฐํ์์ต๋๋ค
cameraExecutor = newSingleThreadExecutor() | ||
_mImageAnalyzer = | ||
ImageAnalysis.Builder().setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST).setTargetRotation(mPreviewView.display.rotation) | ||
.setOutputImageFormat(ImageAnalysis.OUTPUT_IMAGE_FORMAT_RGBA_8888).build() | ||
|
||
_mImageAnalyzer = ImageAnalysis.Builder().setOutputImageRotationEnabled(true).setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST) | ||
.setTargetResolution(Size(720, 1280)).setTargetRotation(Surface.ROTATION_0) | ||
.setOutputImageFormat(ImageAnalysis.OUTPUT_IMAGE_FORMAT_RGBA_8888).build() | ||
mImageAnalyzer.setAnalyzer(cameraExecutor!!) { image -> | ||
if (_bitmapBuffer == null) _bitmapBuffer = Bitmap.createBitmap(image.width, image.height, Bitmap.Config.ARGB_8888) | ||
image.use { | ||
bitmapBuffer.copyPixelsFromBuffer(it.planes[0].buffer) | ||
} | ||
detect(image) | ||
detect() | ||
} | ||
|
||
_mPreview = Preview.Builder().setTargetRotation(mPreviewView.display.rotation).build() | ||
_mPreview = Preview.Builder().setTargetResolution(Size(720, 1280)).setTargetRotation(Surface.ROTATION_0).build() | ||
mCameraProvider.bindToLifecycle(fragmentLifeCycleOwner, mCameraSelector, mPreview, mImageAnalyzer) | ||
mPreview.setSurfaceProvider(mPreviewView.surfaceProvider) | ||
} |
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.
๋ง์์ ์ ๋ฐ์ ์ผ๋ก ์ฝ๋ ๊ฐ๋
์ฑ์ด ๋จ์ด์ง๋ค์
๊ฐํ ๋ฃ์ด์ ๊ฐ๋
์ฑ ๋์ด๊ณ ๋ถํ์ํ ์ฝ๋๋ ๋ค์ ์ ๋ฆฌํ๊ฒ ์ต๋๋ค
data class Object( | ||
val boundingBox: RectF, | ||
val confidence: Int, | ||
val label: String, | ||
) |
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.
object๋ฅผ interface์์ ๋ฃ์ผ์ ์ด์ ๊ฐ ์ด์ ใน๊น์?
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.
OnDetectionListener์ ๋ชฉ์ ์ด ๋ทฐ์์ ์ฝ์ ์์น์ ์ฌ๊ฐํ ๋ฐ์ค๋ฅผ ๊ทธ๋ฆฌ๋ ๊ฑด๋ฐ์.
์ด ๋ ํ๋ฉด ์์์ ์ฝ์ ์์น ์ขํ๊ฐ๋ฅผ ๋ด๊ณ ์๋๊ฒ Object ํด๋์ค์ธ๋ฐ
์ด ์ธํฐํ์ด์ค์์๋ง ์ฐ์ด๊ธฐ ๋๋ฌธ์ ๊ด๊ณ๋ฅผ ํ์คํ๊ฒ ์ ํด์ฃผ๊ณ ์ ์ด๋ ๊ฒ ์์ฑํ์ต๋๋ค.
์ค์ ๋ก ์ด๋ป๊ฒ ์ฐ์ด๊ณ ์๋์ง ์ฝ๋ ๊ฐ์ ์ ๊ณ ๋ฏผ ํด๋ณผ๊ฒธ ์์ฑํด๋ดค์ต๋๋ค.
๋ฐ์ ์ฌ์ง์ฒ๋ผ Ai๊ฐ ์ฝ์ ์ธ์ํ์๋ ๋ทฐ์์ ์ฝ์ ๋ํด์ ๋ฐ์ด๋ฉ ๋ฐ์ค๋ฅผ ์ณ์ฃผ๊ธฐ ์ํ ์ ๋ณด๋ฅผ ์ฝ ๋ณ๋ก ๋ด๋ ๊ฑด๋ฐ์.
์ด ํด๋์ค๊ฐ ์๋ OnDetectionListener๋ ์นด๋ฉ๋ผ๋ฅผ ๋ณด์ฌ์ฃผ๋ MedicinesDetectorFragment์์ ๊ตฌํํด์ ์ฐ์ด๊ณ ์์ต๋๋ค. ์ด ํ๋๊ทธ๋จผํธ์์ **onDetect()**๋ฅผ ํธ์ถ๋ฐ์์ ๋ ๋ทฐ์ ๊ทธ๋ฆฌ๊ฒ ๋์ด์์ด์.
์ฝ๋๋ฅผ ์ฝ์ด๋ณด๋๊น ๋ ๊ฐ์ ํ ์ ์๋ ์ฝ๋๊ฐ ๋ค์์ธ ๊ฑฐ ๊ฐ์ต๋๋ค. ๊ธฐ๋ฅ์ด ๋์ํ๋ ์ง๊ธ ๋น์ฅ ์์ ์ ํ์ง ์๋๊ฒ ์ข์๊ฑฐ ๊ฐ๊ณ ๋ค์์ MVP๋จ๊ณ์์ ๊ฐ์ ํด๋ณด๊ฒ ์ต๋๋ค.
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.
OnDetectionListener์ ๋ชฉ์ ์ด ๋ทฐ์์ ์ฝ์ ์์น์ ์ฌ๊ฐํ ๋ฐ์ค๋ฅผ ๊ทธ๋ฆฌ๋ ๊ฑด๋ฐ์. ์ด ๋ ํ๋ฉด ์์์ ์ฝ์ ์์น ์ขํ๊ฐ๋ฅผ ๋ด๊ณ ์๋๊ฒ Object ํด๋์ค์ธ๋ฐ ์ด ์ธํฐํ์ด์ค์์๋ง ์ฐ์ด๊ธฐ ๋๋ฌธ์ ๊ด๊ณ๋ฅผ ํ์คํ๊ฒ ์ ํด์ฃผ๊ณ ์ ์ด๋ ๊ฒ ์์ฑํ์ต๋๋ค.
์ค์ ๋ก ์ด๋ป๊ฒ ์ฐ์ด๊ณ ์๋์ง ์ฝ๋ ๊ฐ์ ์ ๊ณ ๋ฏผ ํด๋ณผ๊ฒธ ์์ฑํด๋ดค์ต๋๋ค.
๋ฐ์ ์ฌ์ง์ฒ๋ผ Ai๊ฐ ์ฝ์ ์ธ์ํ์๋ ๋ทฐ์์ ์ฝ์ ๋ํด์ ๋ฐ์ด๋ฉ ๋ฐ์ค๋ฅผ ์ณ์ฃผ๊ธฐ ์ํ ์ ๋ณด๋ฅผ ์ฝ ๋ณ๋ก ๋ด๋ ๊ฑด๋ฐ์.
์ด ํด๋์ค๊ฐ ์๋ OnDetectionListener๋ ์นด๋ฉ๋ผ๋ฅผ ๋ณด์ฌ์ฃผ๋ MedicinesDetectorFragment์์ ๊ตฌํํด์ ์ฐ์ด๊ณ ์์ต๋๋ค. ์ด ํ๋๊ทธ๋จผํธ์์ **onDetect()**๋ฅผ ํธ์ถ๋ฐ์์ ๋ ๋ทฐ์ ๊ทธ๋ฆฌ๊ฒ ๋์ด์์ด์.
์ฝ๋๋ฅผ ์ฝ์ด๋ณด๋๊น ๋ ๊ฐ์ ํ ์ ์๋ ์ฝ๋๊ฐ ๋ค์์ธ ๊ฑฐ ๊ฐ์ต๋๋ค. ๊ธฐ๋ฅ์ด ๋์ํ๋ ์ง๊ธ ๋น์ฅ ์์ ์ ํ์ง ์๋๊ฒ ์ข์๊ฑฐ ๊ฐ๊ณ ๋ค์์ MVP๋จ๊ณ์์ ๊ฐ์ ํด๋ณด๊ฒ ์ต๋๋ค.
์กฐ์ค์ฟ์ต๋๋ค. !
it.boundingBox, | ||
it.confidence, | ||
it.label, | ||
) | ||
}, | ||
detectionResultEntity.inferencedImageSize.width, detectionResultEntity.inferencedImageSize.height, | ||
) | ||
} | ||
} | ||
|
||
fun interface OnDetectionListener { |
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.
์์ฐ fun interface
๋ ์ด๋ค ๊ธฐ๋ฅ์ธ๊ฐ์..?
abstract fun
์ด๋ ๋น์ทํ๊ฑด๊ฐ..
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.
์ธํฐํ์ด์ค์ ๋ฉ์๋๊ฐ ํ๋์ผ ๋
์ด๊ฑธ ๋ค๋ฅธ ๋ฉ์๋์ ๋๋ค ์ธ์๋ก ๋ฃ์ด์ ํธํ๊ฒ ์ธ์๊ฐ ์๊ฒ ๋ผ์
private var _aiModels: List<Module>? = null | ||
private val aiModels get() = _aiModels!! | ||
|
||
private var _aiModel: Module? = null | ||
private val aiModel get() = _aiModel!! | ||
|
||
private var _metaData: ClassificationMetaDataEntity? = null | ||
private var _metaData: List<ClassificationMetaDataEntity>? = null |
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.
์ด๊ฑฐ ์ด๊ธฐ๊ฐ null๋ก ์ฃผ์ ์ด์ ๊ฐ ์๋์?
binding๊ฐ์ ๊ฒ๋ค์ nulll๋ก ์ค์ onDestroy
์์ null๋ค์ ๋์
ํด์ ๋ฉ๋ชจ๋ฆฌ ํ์ํ๋๋ฐ,
์ด ๋ถ๋ถ์ ์ ๊ฐ ์ ๋ชจ๋ฅด๋ ๋ถ๋ถ์ด๋ผ ๊ทธ๋ฐ๋ฐ.. ๋ค์ null ์ฒ๋ฆฌํด์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ฐํํ ํ์๋ ์์๊น์ ?
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.
MedicineClassifierImpl๋ ์ฝ์ ์ค์ ๋ก Ai๊ฐ ๋ถ๋ฅํ๋ ์ฝ๋๋ฅผ ๊ฐ์ง๊ณ ์๋ ํด๋์ค์ ๋๋ค.
์ด ํด๋์ค์์ 80MB ๊ฐ๋๋๋ Ai๋ชจ๋ธ์ ์ฝ์ด์์ ๋ฉ๋ชจ๋ฆฌ ์์ ์ฌ๋ฆฌ๋ ๋ก์ง์ ํฌํจํ๊ณ ์์ด์.
๋งํ์ ๊ฒ ์ฒ๋ผ ๋ฉค๋ฒ๋ณ์์ null์ ๋ฃ๋ ๊ฒฝ์ฐ๋ ์ด ์ธ์คํด์ค๊ฐ ํ์์์ด์ ์ง์ธ ๋ ์ผํ ๋ฐ
๋ชจ๋ธ ํ์ผ ์ฉ๋์ด ์ข ํฌ๋ค๋ณด๋ null์ฒ๋ฆฌ๋ก ๋ฉ๋ชจ๋ฆฌ์์ ์ญ์ , ํ ๋น์ ์ฌ๋ฌ ๋ฒ ๋ฐ๋ณตํ๋ ๊ฑด ๋นํจ์จ์ ์ธ๊ฑฐ ๊ฐ์์
๋ฉ๋ชจ๋ฆฌ์ ๊ณ์ ์ฌ๋ ค๋๊ณ ์ ์ง๊ธ์ฒ๋ผ ๊ตฌํํ๊ณ objectํด๋์ค๋ก ์์ฑํ์ต๋๋ค.
์ฝ๋ ๋ค์ ๋ณด๋ ๋ฐ์ ์ฒ๋ผ getํ๋๊ฐ ์๋๋ฐ ๊ผญ ํ์ํ๊ฒ ์๋๋ผ์
์ด๊ฑธ ์์ ๊ณ Delegates.notNull()
๋ฅผ ์ฌ์ฉํด์ ์ฝ๋๋ฅผ ์ข ๋ ์ค์ฌ๋ณด๊ฒ ์ต๋๋ค.
private var _aiModels: List<Module>? = null
private val aiModels get() = _aiModels!!
private var _metaData: List<ClassificationMetaDataEntity>? = null
private val metaData get() = _metaData!!
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.
@pknujsp ์๋๋ฉด lateinit var
๊ฐ์ ๊ฒ์ ์จ๋ ๋์ง ์์๊น์ ํ๋ฒ๋ง ๋์
ํ๋ ๊ฑฐ๋ผ๋ฉด
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.
๊ทธ๋ ๋ค์
ํ์
์ด int๊ฐ์๊ฒ ์๋๋ผ์ ์์๋ง๊ณ lateinit์ฐ๋๊ฒ ๋ง์์
class LoginRequest( | ||
val email: String, | ||
val password: ByteArray, | ||
) | ||
|
||
class LoginResponse( | ||
val userSession: CognitoUserSession, | ||
val attr: CognitoUserDetails, | ||
val newDevice: CognitoDevice? = null, | ||
) |
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.
์๋ค๋ data class๋ ์๋๊ณ ๊ฐ์๊ธฐ ํ ํ์ผ ์์ ์ฌ๋ฌ ๊ฐ์ DTO๋ค์ด ์์ด์.
์ ํฌ ์๋ ์ด๋ ๊ฒ ํ์์๋์ ๋ ์ค๋๋์ ๊ธฐ์ต์ด..
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.
ํ์ ์์ํ ๋ ์ปจ๋ฒค์
์ ๊ตฌ์ฒด์ ์ผ๋ก ํฌ๊ฒ ์ ํ๊ณ ๊ฐ์ง ์์์์ด์
์ด ๋ถ๋ถ ์ค์์ฑ ํฌ๊ฒ ๋๋ผ๊ณ ๊ฐ๋ค์
return getSession(request).fold( | ||
onSuccess = { userSession -> | ||
getUserAttr(userSession).fold( | ||
onSuccess = { userAttr -> | ||
Result.success(LoginResponse(userSession, userAttr)) | ||
}, | ||
onFailure = { Result.failure(it) }, | ||
) | ||
}, | ||
onFailure = { Result.failure(it) }, | ||
) | ||
} |
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.
fold()
๋ฅผ ์ฐ์ง ์๊ณ onSuccess, onFailure๋ฅผ ์ฌ์ฉํด์ ๋๊ฐ์ ๋ก์ง์ ๋ง๋ค ์ ์๋๋ฐ
ํน์ fold()
๋ฅผ ์ฒ์์ ์ฌ์ฉํ์ ์ด์ ๊ฐ ์์๊น์?!
์ ๋ ์๋ฌด๊ฒ๋ ๋ชจ๋ฅด๊ณ ์ฌ์ฉํ๋ค๊ฐ ์งํธ๋์ด๋ ํ๋ก์ ํธ ํ๋ฉด์ ๊ณ ์ณค์ด์ ใ ใ
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.
getSeesion()
, getUserAttr()
์ด ๋ ๊ฐ๊ฐ ๋ฐํ ํ์
์ด ๋ฌ๋ผ์ onSuccess
๋ก ๊ตฌํํ๊ธฐ์๋ ์ข ์ด๋ ค์์ด ์์ด์ fold
๋ฅผ ์ผ์ด์.
mapCatching
๋ก ๋ฐ๊พธ๊ณ getUserAttr()
๊ฒฐ๊ณผ๊ฐ ์คํจ์ผ ๋ ์์ธ๋ฅผ ๋์ ธ์ ์ง๊ธ ์ฝ๋์ fold ๋ด์ fold์์ ๋์ํ๋ ๊ฑฐ๋
๋๊ฐ์ ๋์์ ํ๋๋ก ๋ฐ๊ฟ์ ๋ฐ์ํ ๊ฒ์ฉ
override suspend fun login(request: LoginRequest): Result<LoginResponse> = getSession(request).mapCatching { userSession ->
LoginResponse(userSession, getUserAttr(userSession).getOrElse { throw it })
}
override suspend fun changeNickname(changeNicknameParameter: ChangeNicknameParameter): Flow<Result<ChangeNicknameResponse>> = channelFlow { | ||
awsNetworkApi.changeNickname(changeNicknameParameter).onResponse() | ||
.fold(onSuccess = { Result.success(it) }, onFailure = { Result.failure(it) }).also { trySend(it) } | ||
} | ||
|
||
override suspend fun changePassword(changePasswordParameter: ChangePasswordParameter): Flow<Result<ChangePasswordResponse>> = channelFlow { | ||
/* val password = WeakReference(aesCoder.encodePassword(changePasswordParameter.email, changePasswordParameter.newPassword)).get()!! | ||
awsNetworkApi.changePassword(ChangePasswordParameter(password.toCharArray())).onResponse() | ||
.fold(onSuccess = { Result.success(it) }, onFailure = { Result.failure(it) }).also { trySend(it) }*/ | ||
} |
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.
์ฌ๊ธฐ๋ ์ฌ์ค flow๋ฅผ ์ฌ์ฉํ ํ์๊ฐ ์ ํ ์๋ ๋ถ๋ถ์ด์๋ค์..
ํํ,.. ์ด ๋ถ๋ถ๋ ๋ค suspend๋ก ๊ณ ์ณ์ผํ๋ ๋ถ๋ถ์ธ ๊ฒ ๊ฐ์์.
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.
lateinit var title: TextView | ||
lateinit var redPoint: TextView | ||
lateinit var inputData: EditText | ||
var title: TextView | ||
var redPoint: TextView | ||
var inputData: EditText |
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.
์ฌ๊ธฐ lateinit
์ง์ฐ์ ์ด์ ๊ฐ ์๋์?
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.
๋ฐ์ธ๋ฉ ์ด๋ํฐ ์ฐ๊ฒฐ์ํค๋ค๊ฐ ๊ฐ์ฒด ์ด๊ธฐํ ์ค๋ฅ๋์ ์ ์ ๋นผ๋จ์๋๋ฐ
์ต์ข
์ ์ผ๋ก lateinit ์ด๊ฒ ๋ฌธ์ ๊ฐ ์๋ ๋ถ๋ถ์ด๋ผ ๋ค์ ๋ณต๊ตฌ์ํค๋๊ฑธ ๊น๋นก์ฐํ๋ค์
private val _captureState = MutableSharedFlow<InferenceState<CapturedDetectionEntity>>(replay = 1, extraBufferCapacity = 1) | ||
val captureState get() = _captureState.asSharedFlow() | ||
private val _captureState = MutableSharedFlow<InferenceState<CapturedDetectionEntity>>(replay = 1, extraBufferCapacity = 0) | ||
val captureState: SharedFlow<InferenceState<CapturedDetectionEntity>> = _captureState | ||
|
||
private val vibrateDuration = 50L |
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.
์ด๊ฑฐ ๋ฒ์ธ๋๊ตฌ์ฃ ๋ฌธ์ ๋ค์
์์ํ ํ๊ฒ ์ต๋๋ค ใ
ใ
ใ
๐ ๊ด๋ จ ์ด์
#219 ํด๋ผ์ด์ธํธ, ๋ฐฑ์๋ ์ฐ๊ฒฐ ์ฝ๋ ์ถ๊ฐ(๋ก๊ทธ์ธ, ํ์๊ฐ์ ๊ธฐ๋ฅ ๊ฐ๋ฐ)
โจ ๊ณผ์ ๋ด์ฉ
ํ์ผ ๋ณ๊ฒฝ์ด ์์ฒญ๋๋ฐ Ai์์ ํ ๋ ์ด๋ฆฌ์ ๋ฆฌ ํ ์คํธํ๋ฉด์ ์ด ๋์ค์ ์ ๊ฑฐํ ์ฝ๋๊ฐ ๋ง์์ ๋ฐ๋ก ์ ๋ฆฌํ ๋ก๊ทธ์ธ, ํ์๊ฐ์ ๋ถ๋ถ ํ์ผ๋ค๋ง ๋ณด์๋ฉด ๋ ๊ฑฐ ๊ฐ์ต๋๋ค.
์๋ ์๋ TokenRepository๋ Token ๋ค๋ฃจ๋ ํด๋์ค๋ ์ ๋ถ ์ ๊ฑฐํ์ต๋๋ค.
CognitoUserPool์์ ๋ก๊ทธ์ธ ์ธ์ , ํ ํฐ ๊ด๋ฆฌ ๋ฑ๋ฑ ๋ค ํด์ค์ ์ฐ๋ฆฌ๊ฐ ์ง์ ๋ค๋ฃฐ ํ์๋ ์์ด์ก๊ณ ,
๐ธ ์คํฌ๋ฆฐ์ท(์ ํ)
๐ ๋ ํผ๋ฐ์ค (๋๋ ์๋ก ์๊ฒ ๋ ๋ด์ฉ) ํน์ ๊ถ๊ธํ ์ฌํญ๋ค