Skip to content

Commit

Permalink
[MOD/#58] 주석 코드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
Eouls committed Sep 30, 2024
1 parent c6fbd20 commit 0383033
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ interface TodayMatchDataSource{
suspend fun fetchTodayMatchInformation(): BaseResponse<TodayMatchInformationResponseDto>
suspend fun fetchTodayMatchVoteMatch(matchId: Long): BaseResponse<MatchTodayMatchResponseDto>
suspend fun fetchTodayMatchPogPlayer(matchId: Long): BaseResponse<PogPlayerTodayMatchResponseDto>
// suspend fun fetchTodayMatchVoteSetPog(matchId: Long, setIndex: Int): BaseResponse<PogPlayerTodayMatchResponseDto>
// suspend fun fetchTodayMatchVoteMatchPog(matchId: Long): BaseResponse<PogPlayerTodayMatchResponseDto>
suspend fun fetchTodayMatchSetPog(setIndex: Int, request: CommonPogRequestDto): BaseResponse<CommonTodayMatchPogResponseDto>
suspend fun fetchTodayMatchMatchPog(request: CommonPogRequestDto): BaseResponse<CommonTodayMatchPogResponseDto>
suspend fun voteSetPog(request: VoteSetPogRequestDto): BaseResponse<CommonVotePogResponseDto>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ class TodayMatchDataSourceImpl @Inject constructor(
override suspend fun fetchTodayMatchVoteMatch(matchId: Long): BaseResponse<MatchTodayMatchResponseDto> =
todayMatchService.fetchTodayMatchVoteMatch(matchId)

// override suspend fun fetchTodayMatchVoteSetPog(
// matchId: Long,
// setIndex: Int,
// ): BaseResponse<PogPlayerTodayMatchResponseDto> =
// todayMatchService.fetchTodayMatchVoteSetPog(matchId, setIndex)
//
// override suspend fun fetchTodayMatchVoteMatchPog(matchId: Long): BaseResponse<PogPlayerTodayMatchResponseDto> =
// todayMatchService.fetchTodayMatchVoteMatchPog(matchId)
override suspend fun fetchTodayMatchPogPlayer(matchId: Long): BaseResponse<PogPlayerTodayMatchResponseDto> =
todayMatchService.fetchTodayMatchPogPlayer(matchId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ package umc.everyones.lck.data.dto.response.match

import umc.everyones.lck.domain.model.response.match.PogPlayerTodayMatchModel

//data class PogPlayerTodayMatchResponseDto(
// val information: List<InformationDto>
//) {
// data class InformationDto(
// val playerId: Int,
// val playerProfileImageUrl: String,
// val playerName: String
// ) {
// fun toInformationModel() =
// PogPlayerTodayMatchModel.InformationModel(playerId, playerProfileImageUrl, playerName)
// }
// fun toPogPlayerTodayMatchModel() =
// PogPlayerTodayMatchModel(information.map { it.toInformationModel() })
//}
data class PogPlayerTodayMatchResponseDto(
val matchPogVoteCandidate: MatchPogVoteCandidateDto,
val setPogVoteCandidates: List<SetPogVoteCandidatesDto>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@ class TodayMatchRepositoryImpl @Inject constructor(
todayMatchDataSource.fetchTodayMatchVoteMatch(matchId).data.toMatchTodayMatchModel()
}

// override suspend fun fetchTodayMatchVoteSetPog(
// matchId: Long,
// setIndex: Int,
// ): Result<PogPlayerTodayMatchModel> = runCatching {
// todayMatchDataSource.fetchTodayMatchVoteSetPog(
// matchId,
// setIndex
// ).data.toPogPlayerTodayMatchModel()
// }
//
// override suspend fun fetchTodayMatchVoteMatchPog(matchId: Long): Result<PogPlayerTodayMatchModel> = runCatching {
// todayMatchDataSource.fetchTodayMatchVoteMatchPog(matchId).data.toPogPlayerTodayMatchModel()
// }
override suspend fun fetchTodayMatchPogPlayer(matchId: Long): Result<PogPlayerTodayMatchModel> = runCatching {
todayMatchDataSource.fetchTodayMatchPogPlayer(matchId).data.toPogPlayerTodayMatchModel()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ interface TodayMatchService {
@GET("match/today/information")
suspend fun fetchTodayMatchInformation(): BaseResponse<TodayMatchInformationResponseDto>

// @GET("votes/set-pog/candidates")
// suspend fun fetchTodayMatchVoteSetPog(
// @Query("match-id") matchId: Long,
// @Query("set-index") setIndex: Int
// ): BaseResponse<PogPlayerTodayMatchResponseDto>
//
// @GET("votes/match-pog/candidates")
// suspend fun fetchTodayMatchVoteMatchPog(
// @Query("match-id") matchId: Long
// ): BaseResponse<PogPlayerTodayMatchResponseDto>
@GET("votes/pog/candidates")
suspend fun fetchTodayMatchPogPlayer(
@Query("match-id") matchId: Long
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,7 @@ class TodayMatchTodayPogFragment : BaseFragment<FragmentTodayMatchTodayPogBindin
// 세트 수에 따라 레이아웃의 visibility를 조정
viewModel.setCount.observe(viewLifecycleOwner) { setCountModel ->
adjustLayoutVisibility(setCountModel.setCount)
// loadPogDataForAllSets(setCountModel.setCount)
}
// // POG 데이터가 변경될 때마다 각 setIndex에 맞게 업데이트
// viewModel.pogDataMapLiveData.observe(viewLifecycleOwner) { pogDataMap ->
// pogDataMap.forEach { (setIndex, pogData) ->
// updateRecyclerView(setIndex, pogData.information)
// }
// }
// // 매치 POG 데이터가 변경될 때 RecyclerView 업데이트
// viewModel.matchPogData.observe(viewLifecycleOwner) { matchPogData ->
// updateMatchRecyclerView(matchPogData.information)
// }
// POG 데이터가 변경될 때마다 각 setIndex에 맞게 업데이트
viewModel.matchPogData.observe(viewLifecycleOwner) { pogPlayerData ->
// Match POG 데이터 업데이트
Expand Down Expand Up @@ -158,24 +147,7 @@ class TodayMatchTodayPogFragment : BaseFragment<FragmentTodayMatchTodayPogBindin
binding.layoutTodayMatch5thVote.visibility = if (setCount >= 5) View.VISIBLE else View.GONE
binding.layoutTodayMatchMatchVote.visibility = View.VISIBLE // 매치 POG는 항상 visible
}
// // 모든 세트와 매치 POG 데이터를 불러오는 함수
// private fun loadPogDataForAllSets(setCount: Int) {
// val matchId = arguments?.getLong("matchId") ?: return
//
// for (setIndex in 1..setCount) {
// viewModel.fetchTodayMatchVoteSetPog(matchId, setIndex)
// }
//
// // 매치 POG 데이터도 가져옴
// viewModel.fetchTodayMatchVoteMatchPog(matchId)
// }
// 모든 세트와 매치 POG 데이터를 불러오는 함수
private fun loadPogDataForAllSets() {
val matchId = arguments?.getLong("matchId") ?: return

// 하나의 API 호출로 모든 POG 데이터를 가져옴
viewModel.fetchTodayMatchPogPlayer(matchId)
}
private fun setupVoteImageViewClick() {
binding.ivTodayMatchTodayPog1stVote.setOnSingleClickListener {
binding.ivTodayMatchTodayPog1stVote.visibility = View.GONE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ import javax.inject.Inject
class TodayMatchTodayPogViewModel @Inject constructor(
private val repository: TodayMatchRepository
): ViewModel() {
// 특정 setIndex에 해당하는 POG 데이터를 저장하고, Fragment에 알림
private val _pogDataMapLiveData = MutableLiveData<Map<Int, PogPlayerTodayMatchModel>>()
private val pogDataMap = mutableMapOf<Int, PogPlayerTodayMatchModel>()
val pogDataMapLiveData: LiveData<Map<Int, PogPlayerTodayMatchModel>> get() = _pogDataMapLiveData

// Match POG 데이터를 저장하는 LiveData
private val _matchPogData = MutableLiveData<PogPlayerTodayMatchModel>()
val matchPogData: LiveData<PogPlayerTodayMatchModel> get() = _matchPogData
Expand All @@ -50,14 +45,6 @@ class TodayMatchTodayPogViewModel @Inject constructor(
private val _allItemsSelected = MutableLiveData<Boolean>()
val allItemsSelected: LiveData<Boolean> get() = _allItemsSelected

// 에러 메시지를 저장하는 LiveData
private val _errorMessage = MutableLiveData<String?>()
val errorMessage: LiveData<String?> get() = _errorMessage
fun clearErrorMessage() {
_errorMessage.value = null
}


// 세트 POG의 플레이어를 선택하는 함수
fun selectSetPlayer(setIndex: Int, playerId: Int) {
val updatedSetPlayers = _selectedSetPlayers.value?.toMutableMap() ?: mutableMapOf()
Expand Down Expand Up @@ -101,30 +88,6 @@ class TodayMatchTodayPogViewModel @Inject constructor(
}
}

// // 세트별 POG 데이터를 불러오는 함수
// fun fetchTodayMatchVoteSetPog(matchId: Long, setIndex: Int) {
// viewModelScope.launch {
// repository.fetchTodayMatchVoteSetPog(matchId, setIndex).onSuccess { response ->
// pogDataMap[setIndex] = response
// // Map을 LiveData로 업데이트
// _pogDataMapLiveData.value = pogDataMap.toMap()
// }.onFailure {
// Timber.d("fetchTodayMatchVoteSetPog %s", it.stackTraceToString())
// }
// }
// }
// // 매치별 POG 데이터를 불러오는 함수
// fun fetchTodayMatchVoteMatchPog(matchId: Long) {
// viewModelScope.launch {
// repository.fetchTodayMatchVoteMatchPog(matchId).onSuccess { response ->
// Timber.d("fetchTodayMatchVoteMatchPog %s", response.toString())
// _matchPogData.value = response
// }.onFailure {
// Timber.d("fetchTodayMatchVoteMatchPog %s", it.stackTraceToString())
// }
// }
// }

// POG Player 데이터를 불러오는 함수
fun fetchTodayMatchPogPlayer(matchId: Long) {
viewModelScope.launch {
Expand Down

0 comments on commit 0383033

Please sign in to comment.