Skip to content

Commit

Permalink
[HOTFIX] 프로필 사진, 명함 사진에 S3 URL 경로 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
seokbeom00 committed Oct 30, 2024
1 parent d65cecf commit 5b53757
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public class MemberService {
@Value("${coolsms.fromNumber}")
private String fromNumber;

@Value("${aws-property.s3-bucket-name}")
private String bucketName;

@Value("${aws-property.s3-substring}")
private String s3Substring;

private static final String NICKNAME_PATTERN = "^[a-zA-Z0-9가-힣]{2,8}$";
private static final String PHONE_NUMBER_PATTERN = "^010\\d{8}$";

Expand Down Expand Up @@ -174,7 +180,7 @@ public MemberJoinResponse patchMemberJoin(MemberJoinRequest memberJoinRequest) {
member.updateMember(
memberJoinRequest.isSubscribed(),
memberJoinRequest.nickname(),
memberJoinRequest.image(),
"https://" + bucketName + s3Substring + "profiles/" + memberJoinRequest.image(),
memberJoinRequest.phoneNumber().replaceAll("-", ""),
memberJoinRequest.univName(),
memberJoinRequest.field(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.sopt.seonyakServer.global.auth.PrincipalHandler;
import org.sopt.seonyakServer.global.exception.enums.ErrorType;
import org.sopt.seonyakServer.global.exception.model.CustomException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

Expand All @@ -28,11 +29,18 @@ public class SeniorService {
private final AppointmentService appointmentService;
private final PrincipalHandler principalHandler;

@Value("${aws-property.s3-bucket-name}")
private String bucketName;

@Value("${aws-property.s3-substring}")
private String s3Substring;

public Senior createSenior(final MemberJoinRequest memberJoinRequest, Member member) {

Senior senior = Senior.builder()
.member(member)
.businessCard(memberJoinRequest.businessCard())
.businessCard(
"https://" + bucketName + s3Substring + "businessCard/" + memberJoinRequest.businessCard())
.company(memberJoinRequest.company())
.position(memberJoinRequest.position())
.detailPosition(memberJoinRequest.detailPosition())
Expand Down

0 comments on commit 5b53757

Please sign in to comment.