Skip to content

Commit

Permalink
[NO_JIRA] 기본 프로필 이미지 변경 (#176)
Browse files Browse the repository at this point in the history
* refactor : 기본 프로필 이미지 변경

* refactor : 기본 프로필 이미지 환경 변수로 처리
  • Loading branch information
wjdwnsdnjs13 authored Aug 29, 2024
1 parent 76a3606 commit 5c1b358
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dev-build-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ jobs:
-e AWS_S3_ACCESS_KEY=${{ secrets.AWS_S3_ACCESS_KEY }} \
-e AWS_S3_SECRET_KEY=${{ secrets.AWS_S3_SECRET_KEY }} \
-e AWS_S3_BUCKET_NAME=${{ secrets.DEV_AWS_S3_BUCKET_NAME }} \
-e AWS_S3_BASICPROFILEIMAGEURL=${{ secrets.BASICPROFILEIMAGEURL }} \
-e TZ=Asia/Seoul \
-e SENTRY_DSN=${{ secrets.SENTRY_DSN }} \
-e SENTRY_ENABLE_TRACING=true \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/manual-prod-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
-e AWS_S3_ACCESS_KEY=${{ secrets.AWS_S3_ACCESS_KEY }} \
-e AWS_S3_SECRET_KEY=${{ secrets.AWS_S3_SECRET_KEY }} \
-e AWS_S3_BUCKET_NAME=${{ secrets.PROD_AWS_S3_BUCKET_NAME }} \
-e AWS_S3_BASICPROFILEIMAGEURL=${{ secrets.BASICPROFILEIMAGEURL }} \
-e TZ=Asia/Seoul \
-e SENTRY_DSN=${{ secrets.SENTRY_DSN }} \
-e SENTRY_ENABLE_TRACING=true \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.depromeet.spot.domain.member.enums.MemberRole;
import org.depromeet.spot.domain.member.enums.SnsProvider;
import org.depromeet.spot.infrastructure.jpa.common.entity.BaseEntity;
import org.springframework.beans.factory.annotation.Value;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -16,6 +17,9 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class GoogleUserInfoEntity extends BaseEntity {

@Value("${aws.s3.basicProfileImageUrl}")
private String BASIC_PROFILE_IMAGE_URL;

// 구글 로그인은 sub라는 이름으로 id값을 줌.
// 구글의 sub 값은 Long 타입을 넘어감.
// BigInteger로 처리하거나 String으로 처리해야함.
Expand All @@ -38,7 +42,7 @@ public Member toGoogleDomain(Member member) {
return Member.builder()
.email(email)
.nickname(member.getNickname())
.profileImage(profileImageUrl)
.profileImage(BASIC_PROFILE_IMAGE_URL)
.snsProvider(SnsProvider.GOOGLE)
.idToken(idToken)
.role(MemberRole.ROLE_USER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.depromeet.spot.domain.member.enums.MemberRole;
import org.depromeet.spot.domain.member.enums.SnsProvider;
import org.depromeet.spot.infrastructure.jpa.common.entity.BaseEntity;
import org.springframework.beans.factory.annotation.Value;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -21,6 +22,9 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class KakaoUserInfoEntity extends BaseEntity {

@Value("${aws.s3.basicProfileImageUrl}")
private String BASIC_PROFILE_IMAGE_URL;

// 서비스에 연결 완료된 시각. UTC
@JsonProperty("connected_at")
public Date connectedAt;
Expand Down Expand Up @@ -100,7 +104,7 @@ public Member toKakaoDomain(Member member) {
.name(kakaoAccount.name)
.nickname(member.getNickname())
.phoneNumber(kakaoAccount.phoneNumber)
.profileImage(kakaoAccount.profile.profileImageUrl)
.profileImage(BASIC_PROFILE_IMAGE_URL)
.snsProvider(SnsProvider.KAKAO)
.idToken(getId().toString())
.role(MemberRole.ROLE_USER)
Expand Down

0 comments on commit 5c1b358

Please sign in to comment.