-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
배경
- #33 네트워크 베이스 코드 작성 PR 리뷰를 받던 중, 성규님께서 Retrofit CallAdapter와 Gson Converter를 조금 더 커스터마이징 할 수 있음을 알려주셨습니다.
- 리뷰 내용을 바탕으로 추가 작업을 하고자 합니다.
내용
Before
interface ApiService {
@GET("success")
suspend fun getSuccess(): ApiResult<Success<Any>>
@GET("failure")
suspend fun getFailure(): ApiResult<Success<Any>>
}After
interface ApiService {
@GET("success")
suspend fun getSuccess(): ApiResult<User>
@GET("failure")
suspend fun getFailure(): ApiResult<Room>
}위 형태로 변경하는 것이 목표입니다.
참고 자료
- https://antdevhistory.tistory.com/52
- https://www.woolha.com/tutorials/retrofit-2-define-custom-gson-converter-factory
- https://stackoverflow.com/questions/44400163/deserializing-a-json-object-with-gson-typeadapter-in-an-ordering-insensitive-man
- https://code-examples.net/ko/q/21db7ff
- https://code-examples.net/ko/q/160065a
- https://winter223.tistory.com/2
- https://velog.io/@ams770/Android-Retrofit-Custom-Call-Adapter
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
