Skip to content

Commit 0804228

Browse files
authored
πŸ› fix : S3 μ—…λ‘œλ“œ 버그 μˆ˜μ • (#84)
* πŸ› fix : CachedHttpServletRequest μ‚­μ œ * πŸ™ˆ chore : μ½”λ“œ ν¬λ§·νŒ…
1 parent f0b7a59 commit 0804228

File tree

8 files changed

+86
-152
lines changed

8 files changed

+86
-152
lines changed

β€Žsrc/main/java/com/sponus/sponusbe/auth/jwt/dto/CachedHttpServletRequest.java

-64
This file was deleted.

β€Žsrc/main/java/com/sponus/sponusbe/auth/jwt/filter/JwtAuthenticationFilter.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import org.springframework.security.core.context.SecurityContextHolder;
1111
import org.springframework.web.filter.OncePerRequestFilter;
1212

13-
import com.sponus.sponusbe.auth.jwt.dto.CachedHttpServletRequest;
1413
import com.sponus.sponusbe.auth.jwt.dto.JwtPair;
1514
import com.sponus.sponusbe.auth.jwt.exception.SecurityCustomException;
1615
import com.sponus.sponusbe.auth.jwt.exception.SecurityErrorCode;
@@ -40,26 +39,25 @@ protected void doFilterInternal(
4039
) throws ServletException, IOException {
4140
logger.info("[*] Jwt Filter");
4241

43-
CachedHttpServletRequest cachedHttpServletRequest = new CachedHttpServletRequest(request);
4442
try {
45-
String accessToken = jwtUtil.resolveAccessToken(cachedHttpServletRequest);
43+
String accessToken = jwtUtil.resolveAccessToken(request);
4644

4745
// accessToken 없이 μ ‘κ·Όν•  경우
4846
if (accessToken == null) {
49-
filterChain.doFilter(cachedHttpServletRequest, response);
47+
filterChain.doFilter(request, response);
5048
return;
5149
}
5250

5351
// logout 처리된 accessToken
5452
if (redisUtil.get(accessToken) != null && redisUtil.get(accessToken).equals("logout")) {
5553
logger.info("[*] Logout accessToken");
56-
filterChain.doFilter(cachedHttpServletRequest, response);
54+
filterChain.doFilter(request, response);
5755
return;
5856
}
5957

6058
logger.info("[*] Authorization with Token");
6159
authenticateAccessToken(accessToken);
62-
filterChain.doFilter(cachedHttpServletRequest, response);
60+
filterChain.doFilter(request, response);
6361
} catch (ExpiredJwtException e) {
6462
logger.warn("[*] case : accessToken Expired");
6563
// accessToken 만료 μ‹œ Body에 μžˆλŠ” refreshToken 확인
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,57 @@
11
package com.sponus.sponusbe.domain.organization.dto;
22

3+
import java.util.List;
4+
35
import com.sponus.sponusbe.domain.organization.entity.Organization;
46
import com.sponus.sponusbe.domain.organization.entity.enums.OrganizationStatus;
57
import com.sponus.sponusbe.domain.organization.entity.enums.OrganizationType;
68
import com.sponus.sponusbe.domain.organization.entity.enums.SuborganizationType;
79

8-
import java.util.List;
9-
1010
public record OrganizationDetailGetResponse(
11-
Long organizationId,
12-
String name,
13-
String email,
14-
String password,
15-
String location,
16-
String description,
17-
String imageUrl,
18-
OrganizationType organizationType,
19-
SuborganizationType suborganizationType,
20-
String managerName,
21-
String managerPosition,
22-
String managerEmail,
23-
String managerPhone,
24-
String managerAvailableDay,
25-
String managerAvailableHour,
26-
String managerContactPreference,
27-
OrganizationStatus organizationStatus,
28-
List<TagGetResponse> tags,
29-
List<OrganizationLinkGetResponse> links
11+
Long organizationId,
12+
String name,
13+
String email,
14+
String password,
15+
String location,
16+
String description,
17+
String imageUrl,
18+
OrganizationType organizationType,
19+
SuborganizationType suborganizationType,
20+
String managerName,
21+
String managerPosition,
22+
String managerEmail,
23+
String managerPhone,
24+
String managerAvailableDay,
25+
String managerAvailableHour,
26+
String managerContactPreference,
27+
OrganizationStatus organizationStatus,
28+
List<TagGetResponse> tags,
29+
List<OrganizationLinkGetResponse> links
3030
) {
31-
public static OrganizationDetailGetResponse from(Organization organization) {
32-
List<TagGetResponse> tagGetResponses = TagGetResponse.getTagResponses(organization);
33-
List<OrganizationLinkGetResponse> linkGetResponses = OrganizationLinkGetResponse.getOrganizationLinkResponses(organization);
34-
return new OrganizationDetailGetResponse(
35-
organization.getId(),
36-
organization.getName(),
37-
organization.getEmail(),
38-
organization.getPassword(),
39-
organization.getLocation(),
40-
organization.getDescription(),
41-
organization.getImageUrl(),
42-
organization.getOrganizationType(),
43-
organization.getSuborganizationType(),
44-
organization.getManagerName(),
45-
organization.getManagerPosition(),
46-
organization.getManagerEmail(),
47-
organization.getManagerPhone(),
48-
organization.getManagerAvailableDay(),
49-
organization.getManagerAvailableHour(),
50-
organization.getManagerContactPreference(),
51-
organization.getOrganizationStatus(),
52-
tagGetResponses,
53-
linkGetResponses
54-
);
55-
}
31+
public static OrganizationDetailGetResponse from(Organization organization) {
32+
List<TagGetResponse> tagGetResponses = TagGetResponse.getTagResponses(organization);
33+
List<OrganizationLinkGetResponse> linkGetResponses = OrganizationLinkGetResponse.getOrganizationLinkResponses(
34+
organization);
35+
return new OrganizationDetailGetResponse(
36+
organization.getId(),
37+
organization.getName(),
38+
organization.getEmail(),
39+
organization.getPassword(),
40+
organization.getLocation(),
41+
organization.getDescription(),
42+
organization.getImageUrl(),
43+
organization.getOrganizationType(),
44+
organization.getSuborganizationType(),
45+
organization.getManagerName(),
46+
organization.getManagerPosition(),
47+
organization.getManagerEmail(),
48+
organization.getManagerPhone(),
49+
organization.getManagerAvailableDay(),
50+
organization.getManagerAvailableHour(),
51+
organization.getManagerContactPreference(),
52+
organization.getOrganizationStatus(),
53+
tagGetResponses,
54+
linkGetResponses
55+
);
56+
}
5657
}
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
package com.sponus.sponusbe.domain.organization.dto;
22

3+
import java.util.List;
4+
35
import com.sponus.sponusbe.domain.organization.entity.Organization;
46
import com.sponus.sponusbe.domain.organization.entity.OrganizationLink;
57

6-
import java.util.List;
7-
88
public record OrganizationLinkGetResponse(
9-
Long organizationLinkId,
10-
Long organizationId,
11-
String name,
12-
String url
9+
Long organizationLinkId,
10+
Long organizationId,
11+
String name,
12+
String url
1313
) {
14-
public static OrganizationLinkGetResponse from(OrganizationLink organizationLink) {
15-
return new OrganizationLinkGetResponse(
16-
organizationLink.getId(),
17-
organizationLink.getOrganization().getId(),
18-
organizationLink.getName(),
19-
organizationLink.getUrl()
20-
);
21-
}
14+
public static OrganizationLinkGetResponse from(OrganizationLink organizationLink) {
15+
return new OrganizationLinkGetResponse(
16+
organizationLink.getId(),
17+
organizationLink.getOrganization().getId(),
18+
organizationLink.getName(),
19+
organizationLink.getUrl()
20+
);
21+
}
2222

23-
public static List<OrganizationLinkGetResponse> getOrganizationLinkResponses(Organization organization) {
24-
return organization.getOrganizationLinks().stream()
25-
.map(OrganizationLinkGetResponse::from)
26-
.toList();
27-
}
23+
public static List<OrganizationLinkGetResponse> getOrganizationLinkResponses(Organization organization) {
24+
return organization.getOrganizationLinks().stream()
25+
.map(OrganizationLinkGetResponse::from)
26+
.toList();
27+
}
2828
}
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
package com.sponus.sponusbe.domain.organization.dto;
22

3+
import java.util.List;
4+
35
import com.sponus.sponusbe.domain.organization.entity.Organization;
46
import com.sponus.sponusbe.domain.organization.entity.Tag;
57

6-
import java.util.List;
7-
import java.util.stream.Collectors;
8-
98
public record TagGetResponse(
10-
Long id,
11-
String name
9+
Long id,
10+
String name
1211
) {
13-
public static TagGetResponse from(Tag tag) {
14-
return new TagGetResponse(tag.getId(), tag.getName());
15-
}
12+
public static TagGetResponse from(Tag tag) {
13+
return new TagGetResponse(tag.getId(), tag.getName());
14+
}
1615

17-
public static List<TagGetResponse> getTagResponses(Organization organization) {
18-
return organization.getOrganizationTags()
19-
.stream()
20-
.map(organizationTag -> TagGetResponse.from(organizationTag.getTag()))
21-
.toList();
22-
}
16+
public static List<TagGetResponse> getTagResponses(Organization organization) {
17+
return organization.getOrganizationTags()
18+
.stream()
19+
.map(organizationTag -> TagGetResponse.from(organizationTag.getTag()))
20+
.toList();
21+
}
2322

2423
}

β€Žsrc/main/java/com/sponus/sponusbe/domain/organization/exception/OrganizationErrorCode.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public enum OrganizationErrorCode implements BaseErrorCode {
1515
INVALID_FORMAT(HttpStatus.BAD_REQUEST, "ORG4001", "잘λͺ»λœ ν˜•μ‹μž…λ‹ˆλ‹€."),
1616
ORGANIZATION_ALREADY_EXIST(HttpStatus.BAD_REQUEST, "ORG4002", "μ€‘λ³΅λœ 단체 μ΄λ©”μΌμž…λ‹ˆλ‹€."),
1717
ORGANIZATION_NOT_FOUND(HttpStatus.NOT_FOUND, "ORG4040", "μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” λ‹¨μ²΄μž…λ‹ˆλ‹€.");
18-
18+
1919
private final HttpStatus httpStatus;
2020
private final String code;
2121
private final String message;

β€Žsrc/main/java/com/sponus/sponusbe/domain/propose/repository/ProposeCustomRepository.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.sponus.sponusbe.domain.propose.entity.Propose;
66

77
public interface ProposeCustomRepository {
8-
8+
99
List<Propose> findSentPropose(Long id);
1010

1111
List<Propose> findReceivedProposeWithAnnouncementId(Long organizationId, Long announcementId);

β€Žsrc/main/java/com/sponus/sponusbe/domain/report/dto/AttachmentResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public record AttachmentResponse(
1313
String name,
1414
String url
1515
) {
16-
16+
1717
public static List<AttachmentResponse> convertToAttachments(List<ReportAttachment> reportAttachments) {
1818
return reportAttachments.stream()
1919
.map(attachment -> AttachmentResponse.builder()

0 commit comments

Comments
Β (0)