-
Notifications
You must be signed in to change notification settings - Fork 5
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] #54 - 로그인, 메인, 리스트 서버통신 #62
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.
아니... 진짜 선배야... 아니 ㅋㅋㅋㅋ 왤케 잘함
나 모야 첨 했을때 비하면 이 선배는 모야천재네;
judgeGetCardDetailFetchStatus
를 중복해서 쓰던데 요부분만 봐주세요!
@@ -56,7 +104,7 @@ public class CardAPI { | |||
} | |||
|
|||
switch statusCode { | |||
case 201: | |||
case 200: |
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.
여기 201 을 집어넣은건요! 명함생성에서 성공이 201 번이라서 넣은건데..
생각해보니 이러면 제가 만든 getCardDetailFetch
에서도 못쓰네여.. 요건 어차피 judgeStatus 함수를 추가로 만들어야하기 때문에 추후에 또 수정하는걸로 해요!
func getCardListFetch(userID: String, isList: Bool, offset: Int, completion: @escaping (NetworkResult<Any>) -> Void) { | ||
cardProvider.request(.cardListFetch(userID: userID, isList: isList, offset: offset)) { (result) in | ||
switch result { | ||
case .success(let response): | ||
let statusCode = response.statusCode | ||
let data = response.data | ||
|
||
let networkResult = self.judgeGetCardDetailFetchStatus(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.
judgeGetCardDetailFetchStatus
에서 Card 데이터형식으로 디코딩을 할 텐데 그래서 디코딩이 안됐을텐데 혹시 서버통신해서 출력되는 것도 확인해보셨나요?!
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.
self.judgeGetCardDetailFetchStatus
여기에서는 data 를 card 데이터형식으로 받기 때문에 아마 민재가 사용하는 함수에서는 카드 배열이 필요했을거 같아요
그래서 judgeStatus 는 각 통신함수마다 한개씩 존재하는게 사실 맞답니다!
200번이 성공이기도 201 번이 성공이기도하고 디코딩하는 데이터 형식도 다르니깐요!
그러면 출력까지 할 수 있을까요?
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.
좋습니당! 쵝오! 수고했어요 민재 바쁜 와중에 ㅜㅜ 감사합니다~
case .cardDelete: | ||
return .requestPlain |
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.
오호! 이미 했었군요! 잘하셨어요!! 믓찌다
🌴 PR 요약
🌱 작업한 브랜치
🌱 작업한 내용
민재 담당 서버는 어떤거였나면?
CardAPI, CardService 작성 (User, Card)
네트워크 데이터 모델 생성
각 뷰컨에 테스트 코드 작성 -> // FIXME로 워닝 발생 부분
💡Moya 초보 개발자 민군, 얼마든지 교수님들의 날카로운 지적 환영합니다💡
📮 관련 이슈