Skip to content
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

내가 작성한 글 확인하기 기능 구현 #55

Merged
merged 3 commits into from
Nov 22, 2023

Conversation

yonghanJu
Copy link
Contributor

@yonghanJu yonghanJu commented Nov 15, 2023

😎 작업 내용

  • 내가 작성한 글 확인하기 기능 구현

🧐 변경된 내용

  • 마이페이지에 들어갈 때 변수로 받는 UID를 기본 null 값으로 변경
    • 상대방 uid를 입력하면 상대 페이지를 볼 수 있고 null 값이면 자기 uid를 사용(내 페이지 보기)
  • 내가 업로드한 포스트 정보를 바탕으로 게시글 미리보기 기능 구현
    • PostPreview 데이터를 받음, 댓글 정보 없이 나머지 정보 다 있음

🥳 동작 화면

🤯 이슈 번호

이슈 수정 후

🥲 비고

  • 사진 서버가 고장나서 이미지 로드가 안됨(이미지가 안찾아져요), 일단 더미 이미지로 띄움
  • 현재 글자 크기가 고정인데, PostPreview 상자 크기에 따라서 글자 크기를 줄여야함

@yonghanJu yonghanJu added the enhancement New feature or request label Nov 15, 2023
Copy link
Member

@soopeach soopeach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다

posts.filter { postPreview ->
val date = Date(postPreview.date)
Log.d("TODOREMOVE", "${date.year}, ${date.month + 1}, ${date.date}")
date.month + 1 == month && year == date.year && day == date.date
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 조건을 만족하는 애들만 뽑히는거죠?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 맞습니다


override suspend fun getMyPostPreviews(uid: Long): Result<List<PostPreview>> {
val response = postService.myPosts(uid)
response.body()?.map { it.toPostPreview() } ?: throw Exception(response.message())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추후에 Exception도 만들어야겠네요...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 그리고 최근에 post 서버 내려갔었을 때 글 불러오니까 앱 터지더라구요 예외처리 안되어있는 부분 찾아서 해줘야 할 것 같습니다.

data class PostPreview(
val poster: User,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

author는 어떨까요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네이밍에 많이 신경쓰지 못했네요..하핫 좀더 신경써서 고쳐보죠

val id: Long,
val liked: Boolean = false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요런 불린 타입 변수들 변수명이 is~~면 조금 더 명확해서 좋았던 것 같은데 나중에 전체적으로 바꿔봐요..!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 좋습니다

@@ -49,7 +49,7 @@ fun AppScreen(startWorker: () -> Unit) {
val splashViewModel = koinViewModel<SplashViewModel>()

val splashState = splashViewModel.splashState.collectAsStateWithLifecycle()
AppScreenContent(startWorker, navController)
// AppScreenContent(startWorker, navController)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

얘는 왜 주석처리가 된 것인가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

밑에

when (splashState.value) {
        SplashState.InitialState -> SplashScreen()
        SplashState.SignInState -> SignInScreen { splashViewModel.finishSignIn() }
        SplashState.SignedInState -> AppScreenContent(startWorker, navController)
    }

코드에서 AppScreenContent 를 실행하는데 중복코드여서 주석했습니다!

@yonghanJu yonghanJu merged commit 759f737 into compose/develop Nov 22, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants