[FEAT/#51] :: HTTP API를 추상화합니다. #52
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔 배경
스티커 API들을 사용하기 위해 HTTP 통신 메소드가 필요했고, 여러 API가 존재할 수 있어 추상화를 진행했습니다.
📃 작업 내역
서드파티 라이브러리인 Moya 방식에서 영감을 받아 EndPoint protocol로 추상화했습니다.
EndPoint 프로토콜을 채택하여 구현하고
request()메소드를 통해 URLRequest 로 변환할 수 있도록 합니다.네트워킹 중 발생하는 에러를 구분하기위해 Enum으로 관리합니다.
디코딩 에러 메시지를 직관적으로 볼 수 있도록 프로퍼티를 추가합니다.
✅ 리뷰 노트
🎨 스크린샷
🚀 테스트 방법