Skip to content

Commit

Permalink
Merge pull request #349 from apeun-gidaechi/refactor/#346
Browse files Browse the repository at this point in the history
�Fix :: 캐시 매니저 제거 및 grade 타입 변경
  • Loading branch information
yeseong0412 authored Nov 26, 2024
2 parents 25421af + 980f9e3 commit aa025e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ScheduleMapper : Mapper<Schedule, ScheduleEntity> {
date = entity.date,
eventName = entity.eventName,
eventContent = entity.eventContent,
grade = entity.grade
grade = entity.grade.toList()
)
}

Expand All @@ -27,7 +27,7 @@ class ScheduleMapper : Mapper<Schedule, ScheduleEntity> {
date = domain.date!!,
eventName = domain.eventName ?: "",
eventContent = domain.eventContent ?: "",
grade = domain.grade ?: emptySet()
grade = domain.grade?.toSet() ?: emptySet()
)
}

Expand All @@ -47,7 +47,7 @@ class ScheduleMapper : Mapper<Schedule, ScheduleEntity> {
date = SchoolDateConvertor.dateFormat(scheduleRow.aaYmd),
eventName = scheduleRow.eventNm,
eventContent = scheduleRow.eventCntnt,
grade = grade
grade = grade.toList()
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ data class Schedule(
val date: String? = null,
val eventName: String? = null,
val eventContent: String? = null,
val grade: Set<Int>? = null,
val grade: List<Int>? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ class ScheduleServiceImpl(
}

@Transactional(readOnly = true)
@Cacheable(value = ["schedules"] , key = "#workspaceId", cacheManager = "contentCacheManager")
@Cacheable(value = ["schedules"] , key = "#workspaceId")
override fun getSchoolSchedules(userId: Long, workspaceId: String): List<Schedule> {
return if (!scheduleRepository.existsByWorkspaceId(workspaceId)) resetSchedule(workspaceId, userId)
else scheduleRepository.findByWorkspaceId(workspaceId).map { scheduleMapper.toDomain(it) }

}

@Transactional(readOnly = true)
@Cacheable(value = ["schedules"] , key = "#workspaceId", cacheManager = "contentCacheManager")
@Cacheable(value = ["schedules"] , key = "#workspaceId")
override fun getMonthSchoolSchedules(userId: Long, workspaceId: String, month: Int): List<Schedule> {
return if (!scheduleRepository.existsByWorkspaceId(workspaceId)) {
resetSchedule(workspaceId, userId).filter { sc ->
Expand Down

0 comments on commit aa025e0

Please sign in to comment.