-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] Firestore Service 인터페이스를 구현했습니다. #30
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
base: dev
Are you sure you want to change the base?
Conversation
ValseLee
left a comment
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.
단일한 Service 객체 하나로 너무나 많은 일을 수행하고 있어서.. 다른 객체들이 Service 객체를 유연하게 가져가지 못할 것 같다는 생각이 같이 들었습니다. Service를 일부 분리해두면 어떨까 하는 제안을 드려봅니다.
논외로, Service가 있다는 건 Repository도 있다는 것을 암시하는지..? Clean을 어느 정도 차용할 것인지도 이야기를 해보면 좋을 것 같아요
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.
이 AppInfo가 어떤 정보를 담고 있는 거였죠!?
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.
요거 avatar_url snake_case를 camelCase로 변환하는 디코더 옵션이 있습니다.
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase이러면 코딩키 없이도 자동으로 매핑해준답니다~
| struct Event: Codable, Identifiable { | ||
| let id: String | ||
| let type: String? | ||
| let actor: Actor |
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.
actor 가 예약 키워드라서 actor로 수정해야 좋을 것 같습니다!
| @@ -0,0 +1,193 @@ | |||
| import FirebaseFirestore | |||
|
|
|||
| public protocol FirestoreService { | |||
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.
이 Super Service를 분리할 계획이 혹시 있나요?
fetchService, createService 등으로 분리하고 추후에 Abstract Factory Pattern으로 서비스를 초기화해서 필요한 View 마다 의존성으로 꽂아버리는 방식은 어떨까요?
[Feat] GitHub API 코드 마이그레이션을 진행했습니다.
개요
메인 데이터소스인 Firestore를 조작할 수 있는 추상화 기능을 제공하는 Firestore Service 구현했습니다.
공유사항
이전 회의에서 라이브로 공유드린 문서 디코딩 시 런타임 에러가 발생하는 이슈가 Firebase 패키지 버전 업데이트 후 해결된 부분을 확인했습니다.
#21 브랜치에서 Firebase 패키지 버전을 업데이트했습니다.
✏️ 작업 사항
사용법
더미 데이터
문서 생성
문서 조회
복합 쿼리 조회
문서 조회 코드에 명시된 fetchQuery는 단일 쿼리만 가능합니다.
복합 쿼리가 필요한 경우에는
getCollectionPath으로 경로를 가져오고, 체이닝 방식으로 필요한 쿼리를 적용한 뒤 fetch로 조회할 수 있습니다.문서 업데이트
문서 삭제