-
Notifications
You must be signed in to change notification settings - Fork 6
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] #660 - 생명 타임라인 API 연결 #661
Conversation
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.
8일전까지.. 하셨군요 결국,, 🤥
struct Timeline: Codable { | ||
let title, content: String | ||
let profiles: [String]? | ||
let day: String | ||
let isNew: Bool | ||
} |
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.
데이터를 가지고 cell 을 초기화해주는 initCell()에서는 profiles 에 대해서 [String?]
자료형을 사용하셔서 만약에 서버에서 profiles 가 없을 때는 값자체를 보내주지 않는다고 하면 위와 같이 작성하는게 맞을 것 같아요!
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.
아아 그러네여 서버 데이터 보니까 아예 안오더라구여! initCell부분 수정할게여
func fetchTimeline(roomID: Int, completion: @escaping(NetworkResult<Any>) -> Void) { | ||
roomProvider.request(.timeLineFetch(roomID: roomID)) { result in | ||
switch result { | ||
case .success(let response): | ||
let statusCode = response.statusCode | ||
let data = response.data | ||
let networkResult = self.judgeFetchTimelineStatus(by: statusCode, data) | ||
completion(networkResult) | ||
case .failure(let err): | ||
print(err) | ||
} | ||
} | ||
} |
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.
풀리퀘에서 언급한 내용이 judgeStatus 로 제네릭사용해서 리펙토링하면 좋겠다는걸까용? 어떤 부분이 또 있을까요!
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.
예 ! 요 부분이 좀 중복되는 것 같아서 리팩하면 좋을 것 같았고 아래서 언급한 부분 겹치는 거 생각했어여 !
@@ -168,7 +173,7 @@ extension RoomService: TargetType { | |||
return Const.Header.authorizationHeader() | |||
case .leaveRoom: | |||
return Const.Header.authorizationHeader() | |||
case .readRoom: | |||
case .readRoom, .timeLineFetch: |
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.
고생하셨습니다 👍 👍
🔥Pull requests
⛳️ 작업한 브랜치
👷 작업한 내용
생명 타임라인 API 연결
🚨참고 사항
하다보니까 API쪽에 나중에 좀 깔끔하게 정리할 수 있을 것 같은데 나중에 .. 나중에?
📸 스크린샷
📟 관련 이슈