Skip to content

Commit 75ec343

Browse files
authored
Merge pull request #319 from RealMatchTeam/refactor/318-snsurl
[REFACTOR] 마이프로필카드조회 sns dto변경 (#318)
2 parents 201f359 + fdd5d73 commit 75ec343

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/com/example/RealMatch/user/presentation/dto/response/MyProfileCardResponseDto.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,17 @@ public static MyProfileCardResponseDto from(
3939
user.getProfileImageUrl(),
4040
user.getGender() != null ? user.getGender().name() : "",
4141
age,
42-
detail != null ? detail.getSnsUrl() : "",
42+
detail != null ? extractInstagramAccount(detail.getSnsUrl()) : "",
4343
categoryNames,
4444
detail != null ? MyMatchingResultResponseDto.from(detail) : null
4545
);
4646
}
47+
48+
private static String extractInstagramAccount(String snsUrl) {
49+
if (snsUrl == null || snsUrl.isBlank()) {
50+
return "";
51+
}
52+
return snsUrl.replace("https://www.instagram.com/", "")
53+
.replace("/", "");
54+
}
4755
}

0 commit comments

Comments
 (0)