-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Feat/#8] 4주차 과제 #9
base: develop
Are you sure you want to change the base?
Conversation
- API 명세서 기반 로직 일부 수정
- API 명세서 기반 취미 입력란 추가 - 컴포넌트 일부 수정 - textfield ime option 변경
취미 추가로 인한 문자열 리소스 변경
- API 통신 모듈 - APP 모듈 수정 - ..
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.
저와는 다른 아이디어가 많은 코드였던 것 같아요 👍👍
저와는 다른 코드 구조라서 맞는 방법일지는 모르겠지만... 그냥 함수의 반환타입? 값?이 없이 진행하면 안되려나요..!?
@PUT("/user")
suspend fun modifyMyHobby(
@Body hobbyModifyRequest: HobbyModifyRequest
)
요렇게요...!!
import javax.inject.Inject | ||
|
||
|
||
class TokenInterceptor @Inject constructor( |
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.
sharedPreference에 token이 저장되어있으면 header에 추가해주는건가요?
방법이 있는 건 알았지만 머리가 잘 안 굴러가서 결국 시도를 못했는데...!!
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 SignUpResponse( | ||
@SerialName("no") val userId: Int | ||
) { | ||
fun toId() = UserId( |
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.
진짜 사소한거고 개인적인 생각이지만... 뭔가 그냥 toId라고 하니까 id랑 헷갈려서 userId라고 다 붙여주던가 뭔가 no number? 이런 네이밍을 가져가도 좋을 것 같다는 생각이 듭니다...!!
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 org.sopt.and.domain.repository.MyPageRepository | ||
import javax.inject.Inject | ||
|
||
class GetHobbyUseCase @Inject constructor( |
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.
오 내 취미조회랑 타인 취미조회랑 합쳐서 usecase로 한거 아이디어 좋네요 !
단순히 Empty보다 의미있는 상수를 넣어서 진행해도 좋을 것 같아요!
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 javax.inject.Inject | ||
|
||
|
||
class LocalDataSourceImpl @Inject constructor( |
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.
Localdl라는 이름으론 이 클래스가 어떤 저장소에 접근하는지 알기 어렵다고 생각해요.
로컬 데이터베이스의 경우 preference, datastore, room 등이 있으니까 이름에서 잘 구분해주면 좋을 것 같습니다!
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.
이건 네이밍을 왜 앱 모듈로 하셨나요?
내용과 이름이 전혀 다르다고 생각되네요,,
fun toUserHobby() = UserHobby( | ||
hobby = hobby, | ||
password = "" | ||
) |
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.
코드가 완전 깔끔하네요 고생하셨습니다~~!!
@Provides | ||
@Singleton | ||
fun provideLoggingInterceptor(): HttpLoggingInterceptor = HttpLoggingInterceptor().apply { | ||
level = HttpLoggingInterceptor.Level.BODY |
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.
HttpLoggingInterceptor 사용하는거 너무 좋은 것 같아요~!!
import javax.inject.Inject | ||
|
||
|
||
class TokenInterceptor @Inject constructor( |
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 HobbyResponse( | ||
@SerialName("hobby") val hobby: String | ||
) { | ||
fun toUserHobby() = UserHobby( |
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.
이렇게 내부에 넣을 수도 있군요 저와 다른 방법이라 신기하네용!
Related issue 🛠
Work Description ✏️
Screenshot 📸
signup.mp4
user.mp4
search.mp4
Uncompleted Tasks 😅
To Reviewers 📢
심화 과제를 진행하던 중에 정보 변경 시 200일 때는 빈 응답값을 받게 되어 에러가 발생하더라구요... 그래서 해당 부분을
이처럼 Response로 감싸주어 해결하긴 했는데 다들 더 좋은 의견이 있다면 공유해주시면 감사할 것 같습니다!