Skip to content

Commit

Permalink
[MOD/#58] 주석 코드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
Eouls committed Oct 29, 2024
1 parent 8031488 commit d338e30
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 140 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 fetchTodayMatchSetPog(setIndex: Int, request: CommonPogRequestDto): BaseResponse<CommonTodayMatchPogResponseDto>
// suspend fun fetchTodayMatchMatchPog(request: CommonPogRequestDto): BaseResponse<CommonTodayMatchPogResponseDto>
suspend fun fetchTodayMatchPog(request: CommonPogRequestDto): BaseResponse<CommonTodayMatchPogResponseDto>
suspend fun voteSetPog(request: VoteSetPogRequestDto): BaseResponse<CommonVotePogResponseDto>
suspend fun voteMatch(request: VoteMatchRequestDto): BaseResponse<CommonVotePogResponseDto>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ class TodayMatchDataSourceImpl @Inject constructor(
override suspend fun fetchTodayMatchPogPlayer(matchId: Long): BaseResponse<PogPlayerTodayMatchResponseDto> =
todayMatchService.fetchTodayMatchPogPlayer(matchId)

// override suspend fun fetchTodayMatchSetPog(
// setIndex: Int,
// request: CommonPogRequestDto,
// ): BaseResponse<CommonTodayMatchPogResponseDto> =
// todayMatchService.fetchTodayMatchSetPog(setIndex, request)
//
// override suspend fun fetchTodayMatchMatchPog(request: CommonPogRequestDto): BaseResponse<CommonTodayMatchPogResponseDto> =
// todayMatchService.fetchTodayMatchMatchPog(request)

override suspend fun fetchTodayMatchPog(request: CommonPogRequestDto): BaseResponse<CommonTodayMatchPogResponseDto> =
todayMatchService.fetchTodayMatchPog(request)

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

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

//data class CommonTodayMatchPogResponseDto(
// val id: Int,
// val name: String,
// val profileImageUrl: String,
// val seasonInfo: String,
// val matchNumber: Int,
// val matchDate: String
//) {
// fun toCommonTodayMatchPogModel() =
// CommonTodayMatchPogModel(id, name, profileImageUrl, seasonInfo, matchNumber, matchDate.replace("T", " ").dropLast(3))
//}
data class CommonTodayMatchPogResponseDto(
val seasonInfo: String,
val matchNumber: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@ class TodayMatchRepositoryImpl @Inject constructor(
todayMatchDataSource.fetchTodayMatchPogPlayer(matchId).data.toPogPlayerTodayMatchModel()
}

// override suspend fun fetchTodayMatchSetPog(
// setIndex: Int,
// request: CommonPogModel,
// ): Result<CommonTodayMatchPogModel> = runCatching {
// todayMatchDataSource.fetchTodayMatchSetPog(
// setIndex,
// request.toCommonPogRequestDto()
// ).data.toCommonTodayMatchPogModel()
// }
//
// override suspend fun fetchTodayMatchMatchPog(request: CommonPogModel): Result<CommonTodayMatchPogModel> = runCatching {
// todayMatchDataSource.fetchTodayMatchMatchPog(request.toCommonPogRequestDto()).data.toCommonTodayMatchPogModel()
// }

override suspend fun fetchTodayMatchPog(request: CommonPogModel): Result<CommonTodayMatchPogModel> = runCatching {
todayMatchDataSource.fetchTodayMatchPog(request.toCommonPogRequestDto()).data.toCommonTodayMatchPogModel()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ interface TodayMatchService {
@Query("match-id") matchId: Long
): BaseResponse<MatchTodayMatchResponseDto>

// @POST("pog/set")
// suspend fun fetchTodayMatchSetPog(
// @Query("set-index") setIndex: Int,
// @Body request: CommonPogRequestDto
// ): BaseResponse<CommonTodayMatchPogResponseDto>
//
// @POST("pog/match")
// suspend fun fetchTodayMatchMatchPog(
// @Body request: CommonPogRequestDto
// ): BaseResponse<CommonTodayMatchPogResponseDto>

@POST("pog/result")
suspend fun fetchTodayMatchPog(
@Body request: CommonPogRequestDto
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
package umc.everyones.lck.domain.model.response.match

//data class CommonTodayMatchPogModel(
// val id: Int,
// val name: String,
// val profileImageUrl: String,
// val seasonInfo: String,
// val matchNumber: Int,
// val matchDate: String,
// val tabIndex: Int = 0
//)
data class CommonTodayMatchPogModel(
val seasonInfo: String,
val matchNumber: Int,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
package umc.everyones.lck.domain.model.response.match

//data class PogPlayerTodayMatchModel(
// val information: List<InformationModel>
//) {
// data class InformationModel(
// val playerId: Int,
// val playerProfileImageUrl: String,
// val playerName: String
// )
//}
data class PogPlayerTodayMatchModel(
val matchPogVoteCandidate: MatchPogVoteCandidateModel,
val setPogVoteCandidates: List<SetPogVoteCandidatesModel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ interface TodayMatchRepository {
suspend fun fetchTodayMatchInformation(): Result<TodayMatchInformationModel>
suspend fun fetchTodayMatchVoteMatch(matchId: Long): Result<MatchTodayMatchModel>
suspend fun fetchTodayMatchPogPlayer(matchId: Long): Result<PogPlayerTodayMatchModel>
// suspend fun fetchTodayMatchSetPog(setIndex: Int, request: CommonPogModel): Result<CommonTodayMatchPogModel>
// suspend fun fetchTodayMatchMatchPog(request: CommonPogModel): Result<CommonTodayMatchPogModel>
suspend fun fetchTodayMatchPog(request: CommonPogModel): Result<CommonTodayMatchPogModel>
suspend fun voteSetPog(request: VoteSetPogModel): Result<CommonVotePogModel>
suspend fun voteMatch(request: VoteMatchModel): Result<CommonVotePogModel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ class TodayMatchLckPogFragment : BaseFragment<FragmentTodayMatchLckPogBinding>(R

// 초기 데이터 로드
viewModel.fetchTodayMatchPog(matchId)

// 탭 선택 리스너 설정
// viewModel.selectedTabIndex.observe(viewLifecycleOwner) { tabIndex ->
// this.tabIndex = tabIndex
// Timber.d("Tab selected: $tabIndex")
// }
}
}
}
Expand All @@ -75,10 +69,6 @@ class TodayMatchLckPogFragment : BaseFragment<FragmentTodayMatchLckPogBinding>(R
lckPogMatchRVA = LckPogMatchRVA(
setCount = newSetCount,
onTabSelected = 0
// onTabSelected = { tabIndex ->
// viewModel.updateSelectedTab(tabIndex)
// Timber.d("frtabIndex %s", tabIndex.toString())
// }
)
binding.rvTodayMatchLckPogContainer.layoutManager = LinearLayoutManager(context)
binding.rvTodayMatchLckPogContainer.adapter = lckPogMatchRVA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,13 @@ import javax.inject.Inject
class TodayMatchLckPogViewModel @Inject constructor(
private val repository: TodayMatchRepository
): ViewModel() {
// private val _setPogData = MutableLiveData<CommonTodayMatchPogModel>()
// val setPogData: LiveData<CommonTodayMatchPogModel> get() = _setPogData
//
// private val _matchPogData = MutableLiveData<CommonTodayMatchPogModel>()
// val matchPogData: LiveData<CommonTodayMatchPogModel> get() = _matchPogData

private val _pogData = MutableLiveData<CommonTodayMatchPogModel>()
val pogData: LiveData<CommonTodayMatchPogModel> get() = _pogData

// private val _selectedTabIndex = MutableLiveData<Int>()
// val selectedTabIndex: LiveData<Int> get() = _selectedTabIndex
//
// fun updateSelectedTab(tabIndex: Int) {
// _selectedTabIndex.value = tabIndex
// Timber.d("tabIndex %s", tabIndex.toString())
// }
// 세트 수를 저장하는 LiveData
private val _setCount = MutableLiveData<TodayMatchSetCountModel>()
val setCount: LiveData<TodayMatchSetCountModel> get() = _setCount

// // 세트별 POG 데이터를 불러오는 함수
// fun fetchTodayMatchSetPog(setIndex: Int, matchId: Long) {
// viewModelScope.launch {
// repository.fetchTodayMatchSetPog(setIndex, CommonPogModel(matchId)).onSuccess { response ->
// Timber.d("fetchTodayMatchSetPog %s", response.toString())
// _setPogData.value = response // 데이터를 LiveData에 저장
// }.onFailure {
// Timber.d("fetchTodayMatchSetPog %s", it.stackTraceToString())
// }
// }
// }
//
// // 매치별 POG 데이터를 불러오는 함수
// fun fetchTodayMatchMatchPog(matchId: Long) {
// viewModelScope.launch {
// repository.fetchTodayMatchMatchPog(CommonPogModel(matchId)).onSuccess { response ->
// Timber.d("fetchTodayMatchMatchPog %s", response.toString())
// _matchPogData.value = response // 데이터를 LiveData에 저장
// }.onFailure {
// Timber.d("fetchTodayMatchMatchPog %s", it.stackTraceToString())
// }
// }
// }

fun fetchTodayMatchPog(matchId: Long) {
viewModelScope.launch {
repository.fetchTodayMatchPog(CommonPogModel(matchId)).onSuccess { response ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class TodayMatchPredictionFragment : BaseFragment<FragmentTodayMatchPredictionBi
private lateinit var matchPredictionRVA: MatchPredictionRVA
private var selectedTeam: Int? = null // 사용자가 선택한 팀 ID를 저장할 변수


override fun initObserver() {
viewModel.matchData.observe(viewLifecycleOwner, Observer { matchData ->
matchData?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import umc.everyones.lck.util.extension.toOrdinal

class LckPogMatchRVA(
private var setCount: Int, // 세트 수를 받아서 탭을 동적으로 추가
private val onTabSelected: (Int) -> Unit // 탭 선택 시 호출할 함수
private val onTabSelected: Int // 탭 선택 시 호출할 함수
) : ListAdapter<CommonTodayMatchPogModel, LckPogMatchRVA.ViewHolder>(DiffCallback()) {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
Expand All @@ -29,11 +29,6 @@ class LckPogMatchRVA(
holder.bind(getItem(position))
}

fun updateSetCount(newSetCount: Int) {
setCount = newSetCount
notifyDataSetChanged() // 세트 수 변경 시 UI 업데이트
}

inner class ViewHolder(private val binding: ItemLckPogMatchBinding) :
RecyclerView.ViewHolder(binding.root) {
private val playerAdapter = LckPogPlayerRVA()
Expand All @@ -60,23 +55,6 @@ class LckPogMatchRVA(
}
}

// // 탭 선택 시 리스너 설정
// binding.tabTodayMatchLckPog.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
// override fun onTabSelected(tab: TabLayout.Tab?) {
// tab?.position?.let { position ->
// onTabSelected(position) // 선택된 탭의 인덱스를 전달
// }
// }
//
// override fun onTabUnselected(tab: TabLayout.Tab?) {}
// override fun onTabReselected(tab: TabLayout.Tab?) {}
// })
// 초기 탭 선택 및 비워두기
// if (binding.tabTodayMatchLckPog.tabCount > 0) {
// binding.tabTodayMatchLckPog.getTabAt(1)?.select()
// playerAdapter.submitList(emptyList()) // 초기에는 빈 리스트로 설정
// }

// 탭 선택 리스너
binding.tabTodayMatchLckPog.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
Expand Down Expand Up @@ -111,10 +89,8 @@ class LckPogMatchRVA(

fun bind(item: CommonTodayMatchPogModel) {
currentItem = item
// binding.tabTodayMatchLckPog.getTabAt(item.tabIndex)?.select()
binding.tvTodayMatchLckPogMatchTitle.text = "${item.seasonInfo} ${item.matchNumber.toOrdinal()} Match"
binding.tvTodayMatchLckPogMatchDate.text = item.matchDate
// playerAdapter.submitList(listOf(item))
// 첫 번째 탭을 기본으로 설정 (1st POG tab에 해당하는 플레이어만 표시)
val firstTabPlayerList = item.setPogResponses.filter { it.setIndex == 1 }.take(1)

Expand Down

0 comments on commit d338e30

Please sign in to comment.