diff --git a/src/main/java/com/mpnp/baechelin/oauth/filter/TokenAuthenticationFilter.java b/src/main/java/com/mpnp/baechelin/oauth/filter/TokenAuthenticationFilter.java index e33e1d1..da0570b 100644 --- a/src/main/java/com/mpnp/baechelin/oauth/filter/TokenAuthenticationFilter.java +++ b/src/main/java/com/mpnp/baechelin/oauth/filter/TokenAuthenticationFilter.java @@ -3,6 +3,7 @@ import com.mpnp.baechelin.oauth.token.AuthToken; import com.mpnp.baechelin.oauth.token.AuthTokenProvider; import com.mpnp.baechelin.util.HeaderUtil; +import io.jsonwebtoken.ExpiredJwtException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.Authentication; diff --git a/src/main/java/com/mpnp/baechelin/oauth/token/AuthToken.java b/src/main/java/com/mpnp/baechelin/oauth/token/AuthToken.java index 3869fa0..3e64fb8 100644 --- a/src/main/java/com/mpnp/baechelin/oauth/token/AuthToken.java +++ b/src/main/java/com/mpnp/baechelin/oauth/token/AuthToken.java @@ -75,6 +75,7 @@ public Claims getTokenClaims() { } // Access token을 재발급 받을 때 token이 유효한지 검사하는 로직 + // 만료된 토큰일 때는 통과 public Claims getTokenClaimsForRefresh() { try { return Jwts.parserBuilder() diff --git a/src/main/java/com/mpnp/baechelin/review/dto/ReviewResponseDto.java b/src/main/java/com/mpnp/baechelin/review/dto/ReviewResponseDto.java new file mode 100644 index 0000000..fffb52b --- /dev/null +++ b/src/main/java/com/mpnp/baechelin/review/dto/ReviewResponseDto.java @@ -0,0 +1,54 @@ +package com.mpnp.baechelin.review.dto; + +import com.mpnp.baechelin.review.domain.Review; +import com.mpnp.baechelin.tag.domain.Tag; +import lombok.*; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.stream.Collectors; + +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Getter @Setter +public class ReviewResponseDto { + private int reviewId; // storeId + private int storeId; + private int userId; + private Double point; + + private String content; + private List reviewImageUrlList; + + private LocalDateTime createdAt; + private LocalDateTime modifiedAt; + + private List tagList; + + public ReviewResponseDto(Review review) { + this.reviewId = review.getId(); + this.storeId = review.getStoreId().getId(); + this.userId = review.getUserId().getId(); + this.point = review.getPoint(); + this.content = review.getContent(); + this.createdAt = review.getCreatedAt(); + this.modifiedAt = review.getModifiedAt(); + this.reviewImageUrlList = review.getReviewImageList() + .stream().map(ReviewImageResponseDto::new).collect(Collectors.toList()); + this.tagList = review.getTagList().stream().map(TagResponseDto::new).collect(Collectors.toList()); + } + @Builder + @AllArgsConstructor + @NoArgsConstructor + @Getter @Setter + public static class TagResponseDto{ + private int id; + private String tag; + + public TagResponseDto(Tag tag) { + this.id = tag.getId(); + this.tag = tag.getTag(); + } + } +} \ No newline at end of file