[Feat] Firestore Service 인터페이스를 구현했습니다.#30
Open
wontaeyoung wants to merge 48 commits into
Open
Conversation
4 tasks
ValseLee
approved these changes
Mar 19, 2024
ValseLee
left a comment
Collaborator
There was a problem hiding this comment.
단일한 Service 객체 하나로 너무나 많은 일을 수행하고 있어서.. 다른 객체들이 Service 객체를 유연하게 가져가지 못할 것 같다는 생각이 같이 들었습니다. Service를 일부 분리해두면 어떨까 하는 제안을 드려봅니다.
논외로, Service가 있다는 건 Repository도 있다는 것을 암시하는지..? Clean을 어느 정도 차용할 것인지도 이야기를 해보면 좋을 것 같아요
Collaborator
There was a problem hiding this comment.
이 AppInfo가 어떤 정보를 담고 있는 거였죠!?
Collaborator
There was a problem hiding this comment.
요거 avatar_url snake_case를 camelCase로 변환하는 디코더 옵션이 있습니다.
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase이러면 코딩키 없이도 자동으로 매핑해준답니다~
| struct Event: Codable, Identifiable { | ||
| let id: String | ||
| let type: String? | ||
| let actor: Actor |
Collaborator
There was a problem hiding this comment.
actor 가 예약 키워드라서 actor로 수정해야 좋을 것 같습니다!
| @@ -0,0 +1,193 @@ | |||
| import FirebaseFirestore | |||
|
|
|||
| public protocol FirestoreService { | |||
Collaborator
There was a problem hiding this comment.
이 Super Service를 분리할 계획이 혹시 있나요?
fetchService, createService 등으로 분리하고 추후에 Abstract Factory Pattern으로 서비스를 초기화해서 필요한 View 마다 의존성으로 꽂아버리는 방식은 어떨까요?
[Feat] GitHub API 코드 마이그레이션을 진행했습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
개요
메인 데이터소스인 Firestore를 조작할 수 있는 추상화 기능을 제공하는 Firestore Service 구현했습니다.
공유사항
이전 회의에서 라이브로 공유드린 문서 디코딩 시 런타임 에러가 발생하는 이슈가 Firebase 패키지 버전 업데이트 후 해결된 부분을 확인했습니다.
#21 브랜치에서 Firebase 패키지 버전을 업데이트했습니다.
✏️ 작업 사항
사용법
더미 데이터
문서 생성
문서 조회
복합 쿼리 조회
문서 조회 코드에 명시된 fetchQuery는 단일 쿼리만 가능합니다.
복합 쿼리가 필요한 경우에는
getCollectionPath으로 경로를 가져오고, 체이닝 방식으로 필요한 쿼리를 적용한 뒤 fetch로 조회할 수 있습니다.문서 업데이트
문서 삭제