Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public class FollowerListResponseDto {
private Long followerId;

private String nickname;
private String profileImage;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public class FollowingListResponseDto {
private Long followingId;

private String nickname;
private String profileImage;
}
12 changes: 10 additions & 2 deletions src/main/java/com/example/FixLog/service/FollowService.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ public class FollowService {
private final FollowRepository followRepository;
private final MemberRepository memberRepository;

public String getDefaultProfile(String image) {
return (image == null || image.isBlank())
? "https://fixlogsmwubucket.s3.ap-northeast-2.amazonaws.com/default/DefaultImage.png"
: image;
}

// 팔로우하기
@Transactional
public FollowResponseDto follow(String requesterEmail, Long targetMemberId){
Expand Down Expand Up @@ -78,7 +84,8 @@ public List<FollowerListResponseDto> getMyFollowers(String requesterEmail) {
.map(follow -> new FollowerListResponseDto(
follow.getFollowId(),
follow.getFollowerId().getUserId(),
follow.getFollowerId().getNickname()
follow.getFollowerId().getNickname(),
getDefaultProfile(follow.getFollowerId().getProfileImageUrl())
))
.toList();
}
Expand All @@ -95,7 +102,8 @@ public List<FollowingListResponseDto> getMyFollowings(String requesterEmail) {
.map(follow -> new FollowingListResponseDto(
follow.getFollowId(),
follow.getFollowingId().getUserId(),
follow.getFollowingId().getNickname()
follow.getFollowingId().getNickname(),
getDefaultProfile(follow.getFollowingId().getProfileImageUrl())
))
.toList();
}
Expand Down
46 changes: 23 additions & 23 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@ spring.application.name=FixLog
#logging.level.org.springframework.security=DEBUG

###### [PROD] #####
#server.port=8083
#
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.url=${MYSQL_URL}
#spring.datasource.username=${MYSQL_USERNAME}
#spring.datasource.password=${MYSQL_PASSWORD}
#
#spring.jpa.hibernate.ddl-auto=update
#spring.jpa.show-sql=true
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
#spring.jpa.properties.hibernate.format_sql=true
#
#cloud.aws.credentials.access-key=${AWS_ACCESS_KEY_ID}
#cloud.aws.credentials.secret-key=${AWS_SECRET_ACCESS_KEY}
#cloud.aws.region.static=${AWS_REGION}
#cloud.aws.s3.bucket=${AWS_S3_BUCKET}
#
#jwt.secret=${JWT_KEY}
#
#logging.level.root=INFO
#logging.level.com.example.FixLog=DEBUG
#logging.level.org.springframework.web.servlet.DispatcherServlet=DEBUG
#logging.file.name=logs/app.log
server.port=8083

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=${MYSQL_URL}
spring.datasource.username=${MYSQL_USERNAME}
spring.datasource.password=${MYSQL_PASSWORD}

spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.properties.hibernate.format_sql=true

cloud.aws.credentials.access-key=${AWS_ACCESS_KEY_ID}
cloud.aws.credentials.secret-key=${AWS_SECRET_ACCESS_KEY}
cloud.aws.region.static=${AWS_REGION}
cloud.aws.s3.bucket=${AWS_S3_BUCKET}

jwt.secret=${JWT_KEY}

logging.level.root=INFO
logging.level.com.example.FixLog=DEBUG
logging.level.org.springframework.web.servlet.DispatcherServlet=DEBUG
logging.file.name=logs/app.log