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

강의 검색/강의 상세에 강의평 평점 정보 추가 #288

Merged
merged 21 commits into from
Aug 2, 2024

Conversation

eastshine2741
Copy link
Collaborator

@eastshine2741 eastshine2741 commented Jun 22, 2024

  • LectureListItem에 강의 평점 UI 추가
  • LectureDetailPage에 강의 평점 UI 추가
  • LectureDto에 LectureReviewDto 추가
    • 원래 DTO에 로직이 있으면 안되지만 현재는 displayText 등 로직 존재 -> 추후 dto, model 구분 시 분리 필요
  • GET /ev-services/v1/lectures/id 제거
  • 강의 상세 페이지 진입 시 평점 정보가 없다면 GET /v1/ev/lectures/{lectureId}/summary 로 평점 정보 가져옴
    • 시간표의 강의는 평점 정보를 저장하지 않기 때문에 추가된 로직
  • 강의평 진입 시 이메일 인증 여부 검사 로직 삭제
    • alert + 강의평탭 이동 없이, 바텀시트의 웹뷰에서 바로 인증하는 걸로 변경

@eastshine2741 eastshine2741 requested a review from a team as a code owner June 22, 2024 09:05
return id.let {
context.getString(R.string.review_base_url) + "/detail?id=$it"
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

근데 지금도 그냥
fun LectureReviewDto.getReviewUrl(context: Context): String?
이런 식으로 할 수 있는건가?
나중에 옮기기 편하게 그냥 여기 둔건가

Copy link
Collaborator Author

@eastshine2741 eastshine2741 Jun 26, 2024

Choose a reason for hiding this comment

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

이 브랜치에서 추가한거라 다른브랜치에선 안돼

강의평 url은 강의평 id로 얻을 수 있고, 원래는 강의평 id 얻겠다고 강의번호랑 교수명으로 서버에 api 쏘는 귀찮은 작업을 해야했음. 근데 이번에 lecturedto에 강의평 정보를 내려주게 바뀌어서 가능해진 방법

Copy link
Collaborator

@plgafhd plgafhd Jun 26, 2024

Choose a reason for hiding this comment

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

오잉..? 뭔가 의도가 다르게 전달된것 같긴 한데.. ㅋㅋㅋㅋ

원래 DTO에 로직이 있으면 안되지만 현재는 displayText 등 로직 존재 -> 추후 dto, model 구분 시 분리 필요

이게 궁금했어

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아 DTO는 계층 간(서버-클라 간) 데이터를 전달하기 위한 목적이지, DTO에 getter setter 외 다른 로직이 있을 필요가 없어
그런 로직은 도메인모델에 있으면 돼

https://maenco.tistory.com/entry/Java-DTO%EC%99%80-VO%EC%9D%98-%EC%B0%A8%EC%9D%B4

@JuTaK97
Copy link
Collaborator

JuTaK97 commented Jun 24, 2024

이거 아직 뭔가 미정이라 작업 덜 된게 있는거지?
https://wafflestudio.slack.com/archives/C0PAVPS5T/p1719064671335839?thread_ts=1718796714.629209&cid=C0PAVPS5T

@eastshine2741
Copy link
Collaborator Author

eastshine2741 commented Jun 26, 2024

이거 아직 뭔가 미정이라 작업 덜 된게 있는거지?

맞아맞아 드래프트로 바꿔둘게

@eastshine2741 eastshine2741 marked this pull request as draft June 26, 2024 11:08
@eastshine2741 eastshine2741 marked this pull request as ready for review July 13, 2024 05:10
@eastshine2741
Copy link
Collaborator Author

웹뷰 쿠키 관련해서 문제가 있는건 별도 PR로 분리해서 걔도 같이 머지해야합니당

Copy link
Collaborator

@JuTaK97 JuTaK97 left a comment

Choose a reason for hiding this comment

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

오프라인 리뷰 완료

북마크에서도 잘 뜨게 서버 수정 확인되면 머지 고고

@@ -7,4 +7,6 @@ import com.squareup.moshi.JsonClass
data class LectureReviewDto(
@Json(name = "evLectureId") val id: String,
@Json(name = "avgRating") val rating: Double? = null,
)
) {
val ratingDisplayText get() = rating?.times(10)?.toInt()?.div(10.0)?.toString() ?: "--"
Copy link
Collaborator

Choose a reason for hiding this comment

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

이런 로직 분리 너무 좋아

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

헤헤

Comment on lines 98 to 103
private suspend fun getLectureReview(): LectureReviewDto? {
return _editingLectureDetail.value.lecture_id?.let { lectureId ->
currentTableRepository.getLectureReviewSummary(lectureId)
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

ApiOnError 달기

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines 47 to 48
val editingLectureReview = _editingLectureDetail.map { lecture ->
lecture.review ?: getLectureReview()
Copy link
Collaborator

Choose a reason for hiding this comment

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

오프라인 리뷰 ~> 로직 수정하기

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -45,7 +45,7 @@ class LectureDetailViewModel @Inject constructor(
private val _editingLectureDetail = MutableStateFlow(fixedLectureDetail)
val editingLectureDetail = _editingLectureDetail.asStateFlow()
val editingLectureReview = _editingLectureDetail.map { lecture ->
lecture.review ?: getLectureReview()
lecture.review?.rating?.let { lecture.review } ?: getLectureReview()
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기에 맥락 설명하는 주석하나만 달아줘

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@eastshine2741
Copy link
Collaborator Author

아직 관심강좌 api에 평점 내려오는건 안되어있어서 develop에 머지까진 안했고
develop -> eastshine2741/add-ev-info-ui 머지만 해놨어

@eastshine2741 eastshine2741 merged commit dc828a2 into develop Aug 2, 2024
3 checks passed
@eastshine2741 eastshine2741 deleted the eastshine2741/add-ev-info-ui branch August 2, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants