-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
eastshine2741
commented
Jun 22, 2024
•
edited
Loading
edited
- LectureListItem에 강의 평점 UI 추가
- LectureDetailPage에 강의 평점 UI 추가
- LectureDto에 LectureReviewDto 추가
- 원래 DTO에 로직이 있으면 안되지만 현재는 displayText 등 로직 존재 -> 추후 dto, model 구분 시 분리 필요
- GET /ev-services/v1/lectures/id 제거
- 강의 상세 페이지 진입 시 평점 정보가 없다면 GET /v1/ev/lectures/{lectureId}/summary 로 평점 정보 가져옴
- 시간표의 강의는 평점 정보를 저장하지 않기 때문에 추가된 로직
- 강의평 진입 시 이메일 인증 여부 검사 로직 삭제
- alert + 강의평탭 이동 없이, 바텀시트의 웹뷰에서 바로 인증하는 걸로 변경
76f4e29
to
ae9e21a
Compare
return id.let { | ||
context.getString(R.string.review_base_url) + "/detail?id=$it" | ||
} | ||
} |
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.
근데 지금도 그냥
fun LectureReviewDto.getReviewUrl(context: Context): String?
이런 식으로 할 수 있는건가?
나중에 옮기기 편하게 그냥 여기 둔건가
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.
이 브랜치에서 추가한거라 다른브랜치에선 안돼
강의평 url은 강의평 id로 얻을 수 있고, 원래는 강의평 id 얻겠다고 강의번호랑 교수명으로 서버에 api 쏘는 귀찮은 작업을 해야했음. 근데 이번에 lecturedto에 강의평 정보를 내려주게 바뀌어서 가능해진 방법
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.
오잉..? 뭔가 의도가 다르게 전달된것 같긴 한데.. ㅋㅋㅋㅋ
원래 DTO에 로직이 있으면 안되지만 현재는 displayText 등 로직 존재 -> 추후 dto, model 구분 시 분리 필요
이게 궁금했어
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.
아 DTO는 계층 간(서버-클라 간) 데이터를 전달하기 위한 목적이지, DTO에 getter setter 외 다른 로직이 있을 필요가 없어
그런 로직은 도메인모델에 있으면 돼
https://maenco.tistory.com/entry/Java-DTO%EC%99%80-VO%EC%9D%98-%EC%B0%A8%EC%9D%B4
이거 아직 뭔가 미정이라 작업 덜 된게 있는거지? |
맞아맞아 드래프트로 바꿔둘게 |
웹뷰 쿠키 관련해서 문제가 있는건 별도 PR로 분리해서 걔도 같이 머지해야합니당 |
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.
오프라인 리뷰 완료
북마크에서도 잘 뜨게 서버 수정 확인되면 머지 고고
@@ -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() ?: "--" |
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.
헤헤
private suspend fun getLectureReview(): LectureReviewDto? { | ||
return _editingLectureDetail.value.lecture_id?.let { lectureId -> | ||
currentTableRepository.getLectureReviewSummary(lectureId) | ||
} | ||
} | ||
|
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.
ApiOnError 달기
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.
val editingLectureReview = _editingLectureDetail.map { lecture -> | ||
lecture.review ?: getLectureReview() |
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.
@@ -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() |
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.
아직 관심강좌 api에 평점 내려오는건 안되어있어서 develop에 머지까진 안했고 |