diff --git a/src/main/java/com/example/waggle/WaggleApplication.java b/src/main/java/com/example/waggle/WaggleApplication.java index 3989f4cb..2c9553bc 100644 --- a/src/main/java/com/example/waggle/WaggleApplication.java +++ b/src/main/java/com/example/waggle/WaggleApplication.java @@ -3,7 +3,6 @@ import com.example.waggle.global.util.SecurityUtil; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.data.domain.AuditorAware; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; @@ -11,7 +10,6 @@ import java.util.Optional; -@EnableCaching @EnableScheduling @EnableJpaAuditing @SpringBootApplication diff --git a/src/main/java/com/example/waggle/domain/member/service/RedisService.java b/src/main/java/com/example/waggle/domain/member/service/RedisService.java index f3c6ca33..2fe3ea95 100644 --- a/src/main/java/com/example/waggle/domain/member/service/RedisService.java +++ b/src/main/java/com/example/waggle/domain/member/service/RedisService.java @@ -54,6 +54,9 @@ public void initRecommend(Long memberId) { ValueOperations values = redisTemplate.opsForValue(); String key = initKeyPrefix + memberId; values.set(key, "initRecommend"); + SetOperations setOperations = redisTemplate.opsForSet(); + String memberKey = recommendMemberKeyPrefix + memberId; + setOperations.add(memberKey, String.valueOf(0L)); } public boolean existInitRecommend(Long memberId) { diff --git a/src/main/java/com/example/waggle/domain/recommend/service/RecommendSyncServiceImpl.java b/src/main/java/com/example/waggle/domain/recommend/service/RecommendSyncServiceImpl.java index 8eb740b2..97fee923 100644 --- a/src/main/java/com/example/waggle/domain/recommend/service/RecommendSyncServiceImpl.java +++ b/src/main/java/com/example/waggle/domain/recommend/service/RecommendSyncServiceImpl.java @@ -46,7 +46,8 @@ private void validateInitRecommend(Member member) { } } - @Scheduled(fixedRate = 1000 * 60 * 3L) + @Scheduled(fixedRate = 1000 * 60 * 60 * 3L) +// @Scheduled(fixedRate = 1000 * 60 * 3L) @Override public void syncRecommendation() { redisService.getAllRecommendingMemberList().stream() @@ -54,6 +55,7 @@ public void syncRecommendation() { .filter(Optional::isPresent) .map(Optional::get) .forEach(member -> { + recommendRepository.deleteAllByMember(member); redisService.getRecommendedBoardList(member.getId()).stream() .map(boardRepository::findById) .filter(Optional::isPresent) diff --git a/src/main/java/com/example/waggle/global/config/RedisCacheConfig.java b/src/main/java/com/example/waggle/global/config/RedisCacheConfig.java deleted file mode 100644 index bb14204d..00000000 --- a/src/main/java/com/example/waggle/global/config/RedisCacheConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.example.waggle.global.config; - -import org.springframework.cache.CacheManager; -import org.springframework.cache.annotation.EnableCaching; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.redis.cache.RedisCacheConfiguration; -import org.springframework.data.redis.cache.RedisCacheManager; -import org.springframework.data.redis.connection.RedisConnectionFactory; -import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; -import org.springframework.data.redis.serializer.RedisSerializationContext; -import org.springframework.data.redis.serializer.StringRedisSerializer; - -import java.time.Duration; - -@Configuration -@EnableCaching -public class RedisCacheConfig { - - @Bean - public CacheManager contentCacheManager(RedisConnectionFactory cf) { - RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig() - .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer())) - .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer())) // Value Serializer 변경 - .entryTtl(Duration.ofMinutes(3L)); // 캐시 수명 30분 - - return RedisCacheManager.RedisCacheManagerBuilder.fromConnectionFactory(cf).cacheDefaults(redisCacheConfiguration).build(); - } -} diff --git a/src/main/java/com/example/waggle/global/config/SecurityConfig.java b/src/main/java/com/example/waggle/global/config/SecurityConfig.java index 3722461c..8de4d51d 100644 --- a/src/main/java/com/example/waggle/global/config/SecurityConfig.java +++ b/src/main/java/com/example/waggle/global/config/SecurityConfig.java @@ -1,8 +1,6 @@ package com.example.waggle.global.config; -import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher; - import com.example.waggle.global.security.exception.JwtAccessDeniedHandler; import com.example.waggle.global.security.exception.JwtAuthenticationEntryPoint; import com.example.waggle.global.security.filter.JwtAuthenticationFilter; @@ -10,7 +8,6 @@ import com.example.waggle.global.security.oauth2.CustomOAuth2UserService; import com.example.waggle.global.security.oauth2.handler.OAuth2AuthenticationFailureHandler; import com.example.waggle.global.security.oauth2.handler.OAuth2AuthenticationSuccessHandler; -import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -23,6 +20,10 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.util.matcher.RequestMatcher; +import java.util.List; + +import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher; + @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) @RequiredArgsConstructor @Configuration @@ -83,7 +84,7 @@ private void configureAuth(HttpSecurity httpSecurity) throws Exception { .requestMatchers(authorizationDormant()).hasRole("DORMANT") .requestMatchers(authorizationGuest()).hasRole("GUEST") .requestMatchers(authorizationUser()).hasRole("USER") -// .requestMatchers(authenticatedEndpoints()).authenticated() + .requestMatchers(authenticatedEndpoints()).authenticated() //정적 페이지 허가 .requestMatchers("/", "/.well-known/**", "/css/**", "/*.ico", "/error", "/images/**") .permitAll() // 임시로 모든 API 허용 @@ -116,6 +117,14 @@ private RequestMatcher[] additionalSwaggerRequests() { return requestMatchers.toArray(RequestMatcher[]::new); } + private RequestMatcher[] authenticatedEndpoints() { + List requestMatchers = List.of( + antMatcher("api/recommends/init"), + antMatcher(HttpMethod.GET, "api/recommends/") + ); + return requestMatchers.toArray(RequestMatcher[]::new); + } + private RequestMatcher[] authRelatedEndpoints() { List requestMatchers = List.of( antMatcher("/oauth2/**"), @@ -141,7 +150,7 @@ private RequestMatcher[] permitAllRequest() { antMatcher(HttpMethod.GET, "/api/stories/**"), antMatcher(HttpMethod.GET, "/api/questions/**"), antMatcher(HttpMethod.GET, "/api/sirens/**"), - antMatcher(HttpMethod.GET, "/api/recommends/**"), + antMatcher(HttpMethod.GET, "/api/recommends/{boardId}/memberList"), antMatcher(HttpMethod.GET, "/api/answers/**"), antMatcher(HttpMethod.GET, "/api/follows/**"), antMatcher("/api/media/**") @@ -151,7 +160,8 @@ private RequestMatcher[] permitAllRequest() { private RequestMatcher[] authorizationAdmin() { List requestMatchers = List.of( - antMatcher(HttpMethod.DELETE, "/api/members/{memberId}/force") + antMatcher(HttpMethod.DELETE, "/api/members/{memberId}/force"), + antMatcher(HttpMethod.GET, "api/recommends/sync") ); return requestMatchers.toArray(RequestMatcher[]::new); } diff --git a/src/main/java/com/example/waggle/web/controller/AnswerApiController.java b/src/main/java/com/example/waggle/web/controller/AnswerApiController.java index df4b99e2..5ff5a9ef 100644 --- a/src/main/java/com/example/waggle/web/controller/AnswerApiController.java +++ b/src/main/java/com/example/waggle/web/controller/AnswerApiController.java @@ -9,7 +9,6 @@ import com.example.waggle.global.annotation.auth.AuthUser; import com.example.waggle.global.payload.ApiResponseDto; import com.example.waggle.global.payload.code.ErrorStatus; -import com.example.waggle.global.util.SecurityUtil; import com.example.waggle.web.converter.AnswerConverter; import com.example.waggle.web.dto.answer.AnswerRequest; import com.example.waggle.web.dto.answer.AnswerResponse.AnswerListDto; @@ -73,7 +72,7 @@ public ApiResponseDto getAllAnswerByPage(@PathVariable("questionI Page pagedAnswers = answerQueryService.getPagedAnswers(questionId, pageable); AnswerListDto listDto = AnswerConverter.toAnswerListDto(pagedAnswers); //recommend relation field - setRecommendInList(listDto); + return ApiResponseDto.onSuccess(listDto); } @@ -87,7 +86,6 @@ public ApiResponseDto getAnswerByMemberId(@PathVariable("memberId Pageable pageable = PageRequest.of(currentPage, 10, latestSorting); Page pagedAnswerByUsername = answerQueryService.getPagedAnswerByMemberId(memberId, pageable); AnswerListDto listDto = AnswerConverter.toAnswerListDto(pagedAnswerByUsername); - setRecommendInList(listDto); return ApiResponseDto.onSuccess(listDto); } @@ -101,14 +99,4 @@ public ApiResponseDto deleteAnswer(@PathVariable("answerId") Long answe answerCommandService.deleteAnswer(answerId, member); return ApiResponseDto.onSuccess(Boolean.TRUE); } - - private void setRecommendInList(AnswerListDto listDto) { - listDto.getAnswerList() - .forEach(answer -> - answer.setRecommendationInfo( - recommendQueryService.getRecommendationInfo( - answer.getBoardId(), - SecurityUtil.getCurrentUsername())) - ); - } } diff --git a/src/main/java/com/example/waggle/web/controller/QuestionApiController.java b/src/main/java/com/example/waggle/web/controller/QuestionApiController.java index 895aca82..58648f41 100644 --- a/src/main/java/com/example/waggle/web/controller/QuestionApiController.java +++ b/src/main/java/com/example/waggle/web/controller/QuestionApiController.java @@ -10,7 +10,6 @@ import com.example.waggle.global.payload.ApiResponseDto; import com.example.waggle.global.payload.code.ErrorStatus; import com.example.waggle.global.util.MediaUtil; -import com.example.waggle.global.util.SecurityUtil; import com.example.waggle.web.converter.QuestionConverter; import com.example.waggle.web.dto.question.QuestionRequest; import com.example.waggle.web.dto.question.QuestionResponse.QuestionSummaryDto; @@ -99,7 +98,7 @@ public ApiResponseDto getAllQuestions( Pageable pageable = PageRequest.of(currentPage, 10, latestSorting); Page questions = questionQueryService.getPagedQuestions(pageable); QuestionSummaryListDto listDto = QuestionConverter.toListDto(questions); - setRecommendInList(listDto.getQuestionList()); + setRecommendCntInList(listDto.getQuestionList()); return ApiResponseDto.onSuccess(listDto); } @@ -110,7 +109,7 @@ public ApiResponseDto getRepresentativeQuestionList() List representativeQuestionList = questionQueryService.getRepresentativeQuestionList(); RepresentativeQuestionDto listDto = QuestionConverter.toRepresentativeQuestionDto( representativeQuestionList); - setRecommendInList(listDto.getQuestionList()); + setRecommendCntInList(listDto.getQuestionList()); return ApiResponseDto.onSuccess(listDto); } @@ -124,7 +123,7 @@ public ApiResponseDto getQuestionsByUsername(@PathVariab Pageable pageable = PageRequest.of(currentPage, 10, latestSorting); Page questions = questionQueryService.getPagedQuestionByMemberId(memberId, pageable); QuestionSummaryListDto listDto = QuestionConverter.toListDto(questions); - setRecommendInList(listDto.getQuestionList()); + setRecommendCntInList(listDto.getQuestionList()); return ApiResponseDto.onSuccess(listDto); } @@ -138,10 +137,7 @@ public ApiResponseDto getQuestionByBoardId( questionCommandService.increaseQuestionViewCount(questionId); Question questionByBoardId = questionQueryService.getQuestionByBoardId(questionId); QuestionDetailDto detailDto = QuestionConverter.toDetailDto(questionByBoardId); - detailDto.setRecommendationInfo(recommendQueryService.getRecommendationInfo( - questionId, - SecurityUtil.getCurrentUsername()) - ); + detailDto.setRecommendCount(recommendQueryService.countRecommend(questionId)); return ApiResponseDto.onSuccess(detailDto); } @@ -157,14 +153,12 @@ public ApiResponseDto deleteQuestion(@PathVariable("questionId") Long q return ApiResponseDto.onSuccess(Boolean.TRUE); } - private void setRecommendInList(List questionList) { + private void setRecommendCntInList(List questionList) { questionList .forEach(question -> - question.setRecommendationInfo( - recommendQueryService.getRecommendationInfo( - question.getBoardId(), - SecurityUtil.getCurrentUsername())) - ); + question.setRecommendCount( + recommendQueryService.countRecommend(question.getBoardId() + ))); } // TODO 사용자가 작성한 대답과 관련된 question list 가져오기 diff --git a/src/main/java/com/example/waggle/web/controller/RecommendApiController.java b/src/main/java/com/example/waggle/web/controller/RecommendApiController.java index 5af7dbf1..5086171a 100644 --- a/src/main/java/com/example/waggle/web/controller/RecommendApiController.java +++ b/src/main/java/com/example/waggle/web/controller/RecommendApiController.java @@ -3,6 +3,7 @@ import com.example.waggle.domain.member.entity.Member; import com.example.waggle.domain.recommend.service.RecommendCommandService; import com.example.waggle.domain.recommend.service.RecommendQueryService; +import com.example.waggle.domain.recommend.service.RecommendSyncService; import com.example.waggle.global.annotation.ApiErrorCodeExample; import com.example.waggle.global.annotation.auth.AuthUser; import com.example.waggle.global.payload.ApiResponseDto; @@ -12,14 +13,11 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; @Slf4j @RequiredArgsConstructor @@ -30,13 +28,14 @@ public class RecommendApiController { private final RecommendCommandService recommendCommandService; private final RecommendQueryService recommendQueryService; + private final RecommendSyncService recommendSyncService; @Operation(summary = "게시글 좋아요 혹은 취소 🔑", description = "사용자가 좋아요 버튼을 누릅니다(추가 혹은 취소). 게시글의 좋아요 수가 추가되거나 감소됩니다.") @ApiErrorCodeExample({ ErrorStatus._INTERNAL_SERVER_ERROR }) @PostMapping("/{boardId}") - public ApiResponseDto recommendStory(@PathVariable("boardId") Long boardId, + public ApiResponseDto recommendBoard(@PathVariable("boardId") Long boardId, @AuthUser Member member) { recommendCommandService.handleRecommendation(boardId, member); return ApiResponseDto.onSuccess(boardId); @@ -46,9 +45,39 @@ public ApiResponseDto recommendStory(@PathVariable("boardId") Long boardId @ApiErrorCodeExample({ ErrorStatus._INTERNAL_SERVER_ERROR }) - @GetMapping("/{boardId}") + @GetMapping("/{boardId}/memberList") public ApiResponseDto getRecommendingMembers(@PathVariable("boardId") Long boardId) { List recommendingMembers = recommendQueryService.getRecommendingMembers(boardId); return ApiResponseDto.onSuccess(MemberConverter.toMemberListDto(recommendingMembers)); } + + @Operation(summary = "로그인 유저의 게시글 좋아요 유무 확인 🔑", description = "로그인 유저가 해당 게시글에 좋아요를 눌렀는지 확인합니다.") + @ApiErrorCodeExample({ + ErrorStatus._INTERNAL_SERVER_ERROR + }) + @GetMapping("/{boardId}") + public ApiResponseDto getIsRecommend(@PathVariable("boardId") Long boardId, + @AuthUser Member member) { + return ApiResponseDto.onSuccess(recommendQueryService.checkRecommend(boardId, member.getUsername())); + } + + @Operation(summary = "로그인 유저 데이터베이스 -> 캐시 동기화 🔑", description = "유저의 활동을 위해 좋아요 정보를 rdb -> redis 로 옮깁니다.") + @ApiErrorCodeExample({ + ErrorStatus._INTERNAL_SERVER_ERROR + }) + @GetMapping("/init") + public ApiResponseDto initRecommendInfoInRedis(@AuthUser Member member) { + recommendSyncService.initRecommendationInRedis(member); + return ApiResponseDto.onSuccess(member.getId()); + } + + @Operation(summary = "캐시 -> 데이터베이스 동기화 🔑", description = "유저의 활동을 위해 좋아요 정보를 rdb -> redis 로 옮깁니다.") + @ApiErrorCodeExample({ + ErrorStatus._INTERNAL_SERVER_ERROR + }) + @GetMapping("/sync") + public ApiResponseDto syncRecommendInfo() { + recommendSyncService.syncRecommendation(); + return ApiResponseDto.onSuccess(true); + } } diff --git a/src/main/java/com/example/waggle/web/controller/SirenApiController.java b/src/main/java/com/example/waggle/web/controller/SirenApiController.java index 0bb323d3..17e88910 100644 --- a/src/main/java/com/example/waggle/web/controller/SirenApiController.java +++ b/src/main/java/com/example/waggle/web/controller/SirenApiController.java @@ -10,7 +10,6 @@ import com.example.waggle.global.payload.ApiResponseDto; import com.example.waggle.global.payload.code.ErrorStatus; import com.example.waggle.global.util.MediaUtil; -import com.example.waggle.global.util.SecurityUtil; import com.example.waggle.web.converter.SirenConverter; import com.example.waggle.web.dto.siren.SirenRequest; import com.example.waggle.web.dto.siren.SirenResponse.RepresentativeSirenDto; @@ -98,7 +97,7 @@ public ApiResponseDto getAllSiren( Pageable pageable = PageRequest.of(currentPage, 10, latestSorting); Page pagedSirenList = sirenQueryService.getPagedSirenList(pageable); SirenListDto listDto = SirenConverter.toSirenListDto(pagedSirenList); - setRecommendInList(listDto.getSirenList()); + setRecommendCntInList(listDto.getSirenList()); return ApiResponseDto.onSuccess(listDto); } @@ -109,7 +108,7 @@ public ApiResponseDto getRepresentativeSirenList() { List representativeSirenList = sirenQueryService.getRepresentativeSirenList(); RepresentativeSirenDto listDto = SirenConverter.toRepresentativeSirenDto( representativeSirenList); - setRecommendInList(listDto.getSirenList()); + setRecommendCntInList(listDto.getSirenList()); return ApiResponseDto.onSuccess(listDto); } @@ -123,7 +122,7 @@ public ApiResponseDto getSirenListByUsername(@PathVariable("member Pageable pageable = PageRequest.of(currentPage, 10, latestSorting); Page pagedSirenList = sirenQueryService.getPagedSirenListByMemberId(memberId, pageable); SirenListDto listDto = SirenConverter.toSirenListDto(pagedSirenList); - setRecommendInList(listDto.getSirenList()); + setRecommendCntInList(listDto.getSirenList()); return ApiResponseDto.onSuccess(listDto); } @@ -136,10 +135,7 @@ public ApiResponseDto getSirenByBoardId(@PathVariable("sirenId") sirenCommandService.increaseSirenViewCount(sirenId); Siren siren = sirenQueryService.getSirenByBoardId(sirenId); SirenDetailDto detailDto = SirenConverter.toSirenDetailDto(siren); - detailDto.setRecommendationInfo(recommendQueryService.getRecommendationInfo( - sirenId, - SecurityUtil.getCurrentUsername() - )); + detailDto.setRecommendCount(recommendQueryService.countRecommend(sirenId)); return ApiResponseDto.onSuccess(detailDto); } @@ -155,13 +151,11 @@ public ApiResponseDto deleteSiren(@PathVariable("sirenId") Long sirenId return ApiResponseDto.onSuccess(Boolean.TRUE); } - private void setRecommendInList(List sirenList) { + private void setRecommendCntInList(List sirenList) { sirenList .forEach(siren -> - siren.setRecommendationInfo( - recommendQueryService.getRecommendationInfo( - siren.getBoardId(), - SecurityUtil.getCurrentUsername())) + siren.setRecommendCount( + recommendQueryService.countRecommend(siren.getBoardId())) ); } } diff --git a/src/main/java/com/example/waggle/web/controller/StoryApiController.java b/src/main/java/com/example/waggle/web/controller/StoryApiController.java index e34c01c1..691ce688 100644 --- a/src/main/java/com/example/waggle/web/controller/StoryApiController.java +++ b/src/main/java/com/example/waggle/web/controller/StoryApiController.java @@ -11,7 +11,6 @@ import com.example.waggle.global.payload.code.ErrorStatus; import com.example.waggle.global.util.MediaUtil; import com.example.waggle.global.util.PageUtil; -import com.example.waggle.global.util.SecurityUtil; import com.example.waggle.web.converter.StoryConverter; import com.example.waggle.web.dto.story.StoryRequest; import com.example.waggle.web.dto.story.StoryResponse.StoryDetailDto; @@ -104,10 +103,7 @@ public ApiResponseDto getStoriesByUsername(@PathVariable("m public ApiResponseDto getStoryByBoardId(@PathVariable("storyId") Long storyId) { Story storyByBoardId = storyQueryService.getStoryByBoardId(storyId); StoryDetailDto detailDto = StoryConverter.toDetailDto(storyByBoardId); - detailDto.setRecommendationInfo(recommendQueryService.getRecommendationInfo( - storyId, - SecurityUtil.getCurrentUsername()) - ); + detailDto.setRecommendCount(recommendQueryService.countRecommend(storyId)); return ApiResponseDto.onSuccess(detailDto); } diff --git a/src/main/java/com/example/waggle/web/dto/answer/AnswerResponse.java b/src/main/java/com/example/waggle/web/dto/answer/AnswerResponse.java index b34c3342..72b90ba8 100644 --- a/src/main/java/com/example/waggle/web/dto/answer/AnswerResponse.java +++ b/src/main/java/com/example/waggle/web/dto/answer/AnswerResponse.java @@ -1,7 +1,6 @@ package com.example.waggle.web.dto.answer; import com.example.waggle.web.dto.member.MemberResponse.MemberSummaryDto; -import com.example.waggle.web.dto.recommend.RecommendResponse.RecommendationInfo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; @@ -25,7 +24,7 @@ public static class AnswerViewDto { private List hashtagList; private List mediaList; private MemberSummaryDto member; - private RecommendationInfo recommendationInfo; + private int recommendCount; } @Data diff --git a/src/main/java/com/example/waggle/web/dto/question/QuestionResponse.java b/src/main/java/com/example/waggle/web/dto/question/QuestionResponse.java index 2f40bb3a..b9977abb 100644 --- a/src/main/java/com/example/waggle/web/dto/question/QuestionResponse.java +++ b/src/main/java/com/example/waggle/web/dto/question/QuestionResponse.java @@ -2,7 +2,6 @@ import com.example.waggle.domain.board.ResolutionStatus; import com.example.waggle.web.dto.member.MemberResponse.MemberSummaryDto; -import com.example.waggle.web.dto.recommend.RecommendResponse.RecommendationInfo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; @@ -26,7 +25,7 @@ public static class QuestionSummaryDto { private LocalDateTime createdDate; private List hashtagList; private MemberSummaryDto member; - private RecommendationInfo recommendationInfo; + private int recommendCount; } @Data @@ -55,7 +54,7 @@ public static class QuestionDetailDto { private List mediaList; private List hashtagList; private MemberSummaryDto member; - private RecommendationInfo recommendationInfo; + private int recommendCount; private int viewCount; } diff --git a/src/main/java/com/example/waggle/web/dto/siren/SirenResponse.java b/src/main/java/com/example/waggle/web/dto/siren/SirenResponse.java index 45101f84..067eed63 100644 --- a/src/main/java/com/example/waggle/web/dto/siren/SirenResponse.java +++ b/src/main/java/com/example/waggle/web/dto/siren/SirenResponse.java @@ -4,7 +4,6 @@ import com.example.waggle.domain.board.siren.entity.SirenCategory; import com.example.waggle.domain.member.entity.Gender; import com.example.waggle.web.dto.member.MemberResponse.MemberSummaryDto; -import com.example.waggle.web.dto.recommend.RecommendResponse.RecommendationInfo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; @@ -30,7 +29,7 @@ public static class SirenSummaryDto { private String lostLocate; private SirenCategory category; private ResolutionStatus status; - private RecommendationInfo recommendationInfo; + private int recommendCount; } @Data @@ -53,7 +52,7 @@ public static class SirenDetailDto { private List mediaList; private MemberSummaryDto member; private ResolutionStatus status; - private RecommendationInfo recommendationInfo; + private int recommendCount; private int viewCount; } diff --git a/src/main/java/com/example/waggle/web/dto/story/StoryResponse.java b/src/main/java/com/example/waggle/web/dto/story/StoryResponse.java index 9b0edd0d..a37dcaf9 100644 --- a/src/main/java/com/example/waggle/web/dto/story/StoryResponse.java +++ b/src/main/java/com/example/waggle/web/dto/story/StoryResponse.java @@ -1,7 +1,6 @@ package com.example.waggle.web.dto.story; import com.example.waggle.web.dto.member.MemberResponse.MemberSummaryDto; -import com.example.waggle.web.dto.recommend.RecommendResponse.RecommendationInfo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -23,7 +22,7 @@ public static class StoryDetailDto { private List hashtagList; private List mediaList; private MemberSummaryDto member; - private RecommendationInfo recommendationInfo; + private int recommendCount; } @Data