-
Notifications
You must be signed in to change notification settings - Fork 1
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
DEP-214 feat: 짝꿍 만들기 / 기본 화면 -> 1단계 -> 2단계 기능 구현 #86
Conversation
private val habitRepository: HabitRepository | ||
) { | ||
suspend operator fun invoke(): Flow<DataState<List<Habit>>> { | ||
return habitRepository.getHabits() | ||
return habitRepository.getHabits(status = "ACTIVE") |
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.
Domain 모듈에서는 status enum 으로 적용하면 좋을거같습니다.
ACTIVE
, ARCHIVED
외에 UNKNWON
도 가지게하면, 이후에 서버가 새로 값 추가해도 파싱 실패하지 않으면서 처리할수 있을거같은데요.
서버랑 직접 연동하는 dto 는 string 이어도 좋고, mapper 정도에서 변환해주면 좋을거같습니다.
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.
(말씀하신 거대로 정확히 한 건지 헷갈리긴 한데..) 적용했습니다!
import com.depromeet.threedays.mypage.MyPageFragment | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class MainActivity : BaseActivity<ActivityMainBinding>(R.layout.activity_main) { | ||
val hasMate = false // TODO: 나중에 api 호출로 유무 판단 |
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.
mate 조회하는 usecase 까지는 만들 수 있을거같습니다.
- 현재는 habits?status=ACTIVE 중에서 it.mate != null 인 습관이 하나라도 있는지, 없는지로 구분하면 될거같고
- api 추가되면 usecase 구현만 바꿔주면 될거같아요
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때 api가 안나오면 적용해두겠습니다
Kudos, SonarCloud Quality Gate passed! |
💁♂️ 변경 내용
AS-IS
TO-BE
📢 전달사항
status를 하드코딩으로 넣어주는 usecase가 2개 생겼습니다.