-
Notifications
You must be signed in to change notification settings - Fork 1
[fix] #89: 랜덤 포즈 화면 개선 #93
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
Changes from all commits
548a686
37ed3b6
a067016
1aa076d
863eb49
953ce61
e017a9f
0b8b19c
54bc957
5be4009
3c4426f
388e033
f35d94f
463410f
1084b20
54803f1
d3a2d20
575b6f4
a853151
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,11 @@ | ||
| package com.neki.android.core.common.exception | ||
|
|
||
| class ServerApiException( | ||
| val code: Int, | ||
| message: String, | ||
| ) : Throwable(message) | ||
|
|
||
| class ClientApiException( | ||
| val code: Int, | ||
| message: String, | ||
| ) : Throwable(message) | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ import com.neki.android.core.model.Pose | |
| import com.neki.android.core.model.SortOrder | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| const val NO_MORE_RANDOM_POSE = 400 | ||
|
Member
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. 에러코드에 대한 정의는
Contributor
Author
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. common에 저 변수를 선언해버리면, 저 NO MORE RANDOM POSE 400은 해당 부분에서만 사용하니 냅두고 private 으로 변경한 다음에,
Member
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.
말씀하신대로 private으로 변경 혹은 제거한 후 아래 코멘트에서 말씀드린 것 처럼 발생 가능한 |
||
|
|
||
|
ikseong00 marked this conversation as resolved.
|
||
| interface PoseRepository { | ||
|
|
||
| fun getPosesFlow( | ||
|
|
@@ -22,14 +24,12 @@ interface PoseRepository { | |
| suspend fun getSingleRandomPose( | ||
| headCount: PeopleCount, | ||
| excludeIds: Set<Long>, | ||
| maxRetry: Int, | ||
| ): Result<Pose> | ||
|
|
||
| suspend fun getMultipleRandomPose( | ||
| headCount: PeopleCount, | ||
| excludeIds: Set<Long>, | ||
| poseSize: Int, | ||
| maxRetry: Int, | ||
| ): Result<List<Pose>> | ||
|
|
||
| suspend fun updateScrap(poseId: Long, scrap: Boolean): Result<Unit> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,13 @@ | ||
| package com.neki.android.core.dataapi.repository | ||
|
|
||
| import com.neki.android.core.model.UserInfo | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| interface UserRepository { | ||
| val hasVisitedRandomPose: Flow<Boolean> | ||
| suspend fun setRandomPoseVisited() | ||
| suspend fun getUserInfo(): Result<UserInfo> | ||
| suspend fun updateUserInfo(nickname: String): Result<Unit> | ||
|
|
||
| suspend fun updateProfileImage(mediaId: Long?): Result<Unit> | ||
| } |
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.
Exception을 서버와 클라이언트 단위로 구분하지 않고, 예측할 수 있는 Exception 각각을 정의하는건 어떨까요?
그리고 결국 저희는
ClientRequestException같은Exception에 대한 예외처리를 하기 때문에 특별한 이유가 아니라면? Throwable의 서브타입인Exception을 상속받아 구현해도 충분할 것 같습니다.ViewModel이나 RepositoryImpl에서 예외를 분기할 때 가독성이 좋아지기도 하고, 앞으로 추가될 Exception에 대비하기도 좋을 것 같습니다!
Uh oh!
There was an error while loading. Please reload this page.
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.
이 부분은 새롭게 이슈업해서 논의해보면 좋을 것 같습니다!
sealed 로 하는 것 좋아보여요
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.
넵넵 현재 Exception으로 구분할 예외가 랜덤포즈가 유일하니 현행 유지하고, 차차 서버 스펙에 대해서도 의논해보고 개선하시죠!