Skip to content

Commit

Permalink
✨ Feat: 캐시 무효화 정책 추가 (브리핑 등록, 수정 시)
Browse files Browse the repository at this point in the history
  • Loading branch information
swa07016 committed Jan 11, 2024
1 parent 4b9d34e commit 09174bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/briefing/briefing/api/BriefingApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import jakarta.validation.Valid;

import org.springdoc.core.annotations.ParameterObject;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

import briefing.briefing.application.BriefingCommandService;
import briefing.briefing.application.BriefingQueryService;
import briefing.briefing.application.dto.*;
import briefing.briefing.domain.Briefing;
import briefing.common.aop.annotation.CacheEvictByBriefingId;
import briefing.common.enums.APIVersion;
import briefing.common.response.CommonResponse;
import briefing.member.domain.Member;
Expand Down Expand Up @@ -65,6 +67,7 @@ public CommonResponse<BriefingResponseDTO.BriefingDetailDTO> findBriefing(
isWarning));
}

@CacheEvict(value = "findBriefingsV2", key = "#request.getBriefingType()")
@PostMapping("/briefings")
@ResponseStatus(HttpStatus.CREATED)
@Operation(summary = "03-03Briefing \uD83D\uDCF0 브리핑 등록", description = "")
Expand All @@ -82,6 +85,7 @@ public void createBriefing(@RequestBody final BriefingRequestDTO.BriefingCreate
* @param id, BriefingResponseDTO.BriefingUpdateDTO
* @return 수정된 값, 요청으로 온 값과 동일
*/
@CacheEvictByBriefingId(value = "findBriefingsV2", briefingId = "#id")
@Operation(summary = "03-04Briefing \uD83D\uDCF0 브리핑 내용 수정", description = "")
@Parameter(name = "id", description = "브리핑 아이디", example = "1")
@PatchMapping("/briefings/{id}")
Expand Down

0 comments on commit 09174bd

Please sign in to comment.