Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jschoi-96 committed Mar 30, 2024
1 parent c0815e9 commit 1c2765c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.addAllowedOriginPattern("http://localhost:8080");
configuration.addAllowedOriginPattern("http://localhost:3000"); // 프론트 쪽에서 허용
configuration.addAllowedOriginPattern("http://balancetalk.kro.kr"); // 도메인 주소
configuration.addAllowedOriginPattern("https://balancetalk.kro.kr"); // 도메인 주소
configuration.addExposedHeader("Authorization");
configuration.addExposedHeader("refreshToken");
configuration.setAllowedMethods(Arrays.asList("GET","POST","PUT","PATCH","DELETE"));
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/balancetalk/module/member/dto/MemberResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class MemberResponse {
@Schema(description = "회원 닉네임", example = "닉네임")
private String nickname;

@Schema(description = "회원 프로필", example = "../")
private String profilePhoto; // TODO: File 타입으로 수정 예정
@Schema(description = "회원 프로필 URL", example = "https://balance-talk-static-files.s3.ap-northeast-2.amazonaws.com/balance-talk-images/balance-option/a723b360-f42f-4dc9-be69-72904b6861d9_강아지.jpeg")
private String profileImageUrl;

@Schema(description = "가입일", example = "2024-02-16 13:37:17.391706")
private LocalDateTime createdAt;
Expand All @@ -37,14 +37,14 @@ public class MemberResponse {
private int level;

public static MemberResponse fromEntity(Member member) {
String profilePhotoName = Optional.ofNullable(member.getProfilePhoto())
.map(File::getStoredName)
String profileImageUrl = Optional.ofNullable(member.getProfilePhoto())
.map(File::getUrl)
.orElse(null);

return MemberResponse.builder()
.id(member.getId())
.nickname(member.getNickname())
.profilePhoto(profilePhotoName)
.profileImageUrl(profileImageUrl)
.createdAt(member.getCreatedAt())
.postsCount(member.getPostCount())
.totalPostLike(member.getPostLikes())
Expand Down

0 comments on commit 1c2765c

Please sign in to comment.