|
38 | 38 | import org.runnect.server.user.exception.userException.NotFoundUserException; |
39 | 39 | import org.runnect.server.user.repository.UserRepository; |
40 | 40 | import org.springframework.beans.factory.annotation.Value; |
| 41 | +import org.springframework.cache.annotation.CacheEvict; |
41 | 42 | import org.springframework.cache.annotation.Cacheable; |
42 | 43 | import org.springframework.data.domain.Page; |
43 | 44 | import org.springframework.data.domain.PageRequest; |
@@ -300,6 +301,9 @@ public GetPublicCourseDetailResponseDto getPublicCourseDetail(final Long userId, |
300 | 301 |
|
301 | 302 | } |
302 | 303 |
|
| 304 | + // μ½μ€ λͺ©λ‘μ μν₯μ μ£Όλ μ°κΈ° μμ
μ΄λΌ, μμ±μ λ³ΈμΈ μΊμλ§μ΄ μλλΌ |
| 305 | + // μ 체 μ μ κ° λ³΄λ λͺ©λ‘ μΊμ(μ 체νμ΄μ§μ/λ§λΌν€/μΆμ²)λ₯Ό λ€ μ§μμΌ ν¨ |
| 306 | + @CacheEvict(value = {"publicCourseTotalPageCount", "marathonPublicCourse", "recommendPublicCourse"}, allEntries = true) |
303 | 307 | @Transactional |
304 | 308 | public CreatePublicCourseResponseDto createPublicCourse( |
305 | 309 | final Long userId, |
@@ -344,6 +348,7 @@ public CreatePublicCourseResponseDto createPublicCourse( |
344 | 348 |
|
345 | 349 | } |
346 | 350 |
|
| 351 | + @CacheEvict(value = {"publicCourseTotalPageCount", "marathonPublicCourse", "recommendPublicCourse"}, allEntries = true) |
347 | 352 | @Transactional |
348 | 353 | public DeletePublicCoursesResponseDto deletePublicCourses( |
349 | 354 | Long userId, |
@@ -389,6 +394,8 @@ public DeletePublicCoursesResponseDto deletePublicCourses( |
389 | 394 | return DeletePublicCoursesResponseDto.from(publicCourses.size()); |
390 | 395 | } |
391 | 396 |
|
| 397 | + // μ λͺ©/μ€λͺ
λ§ λ°λκ³ μ½μ€ κ°μλ κ·Έλλ‘λΌ μ 체νμ΄μ§μ μΊμλ μ§μΈ νμ μμ |
| 398 | + @CacheEvict(value = {"marathonPublicCourse", "recommendPublicCourse"}, allEntries = true) |
392 | 399 | @Transactional |
393 | 400 | public UpdatePublicCourseResponseDto updatePublicCourse(Long userId, Long publicCourseId, String title, String description) { |
394 | 401 | PublicCourse publicCourse = publicCourseRepository.findById(publicCourseId) |
|
0 commit comments