Skip to content

Conversation

@ericKwon95
Copy link
Contributor

@ericKwon95 ericKwon95 commented Dec 6, 2024

close #19

📓 Overview

  • 인기 쇼츠 화면에 실제 API를 연동하였습니다.

🤔 고민 내용

Screenshot 2024-12-06 at 3 58 30 PM
  • 위 화면의 원 색상은 루트의 홀드 색상을 따릅니다.
  • 다만 현재 인기 쇼츠 API에는 홀드 색상 정보가 없습니다.
  • 홀드 색상 정보를 얻기 위해서는 암장 id를 통해 암장이 가지고 있는 루트에 접근, 루트에서 일치하는 난이도를 찾아 홀드 색상을 가져오는 방법이 있습니다.
  • 다만 이 방법은 쇼츠 자체의 루트 정보가 아닌, 암장의 최신 루트 정보에 접근한다는 문제점이 있습니다.
  • 여러분의 의견을 수렴 후 문제를 해결해 보고자 일단은 red 색상으로 고정해 놓았습니다.

📸 Screenshot

이번 주 인기 쇼츠
Screenshot 2024-12-06 at 3 57 27 PM

@ericKwon95 ericKwon95 self-assigned this Dec 6, 2024
let request = ShortsDTO.List.Request(page: 0, size: 10)
let response = try await shortsClient.popularShorts(request)

let result = try await withThrowingTaskGroup(of: PopularShorts?.self) { group in
Copy link
Contributor

Choose a reason for hiding this comment

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

withThrowingTaskGroup 쓰신 이유가 무엇일까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

여러 개의 비동기 작업을 concurrent하게 처리하기 위함입니다.
반복문 안에 await을 사용할 시 해당 작업이 끝난 후 다음 반복문이 serial하게 수행됩니다.
이를 concurrent하게 수행하고 싶어 사용해 보았습니다~

Copy link
Contributor

@HenryVoid HenryVoid Jan 1, 2025

Choose a reason for hiding this comment

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

제가 파악하고 있는게 맞는지 확인 부탁드려도 될까요?!
이번주 인기숏츠영상별 뱃지를 표현하기 위해 gymDifficulty API를 반복해서 호출하는 것으로 보이는데 성능저하, 즉 네트워킹환경에 따라서 무기한 대기상황을 초래할 수도 있다 생각되서요! 그래서 찾아보니 popularShorts API Response에 gymDifficultyName, gymDifficultyColor가 존재하는데 이것으로는 해결이 안 되는 것일까요?!

스크린샷 2025-01-01 오후 5 54 43

Copy link
Contributor Author

Choose a reason for hiding this comment

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

현재 각 난이도에 따른 레벨 표시(V1, V3 등) 값을 알기 위해 추가적인 API 호출이 필요한 상황입니다..!
형욱님이 알려주신 부분은 쇼츠 썸네일 정보를 위해 과다한 API 호출이 이루어진다는 점인 것으로 이해됩니다.
그 부분 저도 동의하고 있습니다~ API 호출을 최대한 줄이고 싶은데, 현재 쇼츠 API 구성의 한계로 인해 이렇게 구현하였습니다 ㅜㅜ
혹시 더 좋은 방법이 있을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] 인기 쇼츠 기능 구현

3 participants