Skip to content

Commit

Permalink
refactor: List -> Set으로 자료형 변경 (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 authored Jul 13, 2024
1 parent 4457d39 commit 1d3fbd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.few.batch.service.article.dto

fun List<WorkBookSubscriberItem>.toMemberIds(): List<Long> {
return this.map { it.memberId }
fun List<WorkBookSubscriberItem>.toMemberIds(): Set<Long> {
return this.map { it.memberId }.toSet()
}

fun List<WorkBookSubscriberItem>.toTargetWorkBookIds(): List<Long> {
return this.map { it.targetWorkBookId }
fun List<WorkBookSubscriberItem>.toTargetWorkBookIds(): Set<Long> {
return this.map { it.targetWorkBookId }.toSet()
}

/** key: 구독자들이 구독한 학습지 ID, value: 구독자들의 학습지 구독 진행률 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class WorkBookSubscriberWriter(
.and(articleIfoT.DELETED_AT.isNull)
.fetchInto(ArticleContent::class.java)

// todo fix
val memberSuccessRecords = memberIds.associateWith { true }.toMutableMap()
val failRecords = mutableMapOf<String, ArrayList<Map<Long, String>>>()
// todo check !! target is not null
Expand Down

0 comments on commit 1d3fbd4

Please sign in to comment.