Skip to content

Commit

Permalink
🐛 :: NPE 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
jyk1029 committed Aug 29, 2023
1 parent f809036 commit 7f952bd
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ public class Comment {

private final LocalDateTime updatedAt;

private final Boolean isDeleted = false;
private final boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public void saveComment(CreateCommentDomainRequest request) {
.userId(userId)
.createAt(LocalDateTime.now())
.updatedAt(LocalDateTime.now())
.isDeleted(false)
.build()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ public class Feed {

private final Integer commentCount;

private final Boolean isDeleted = false;
private final boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class FeedApiImpl implements FeedApi {

private final CommandFeedSpi commandFeedSpi;
private final FeedUserSpi feedUserSpi;
private final CommandCommentSpi commandCommentSpi;
private final CommandFeedImageSpi commandFeedImageSpi;
private final SecuritySpi securitySpi;
private final QueryFeedSpi queryFeedSpi;
Expand Down Expand Up @@ -67,6 +66,7 @@ public SaveFeedResponse saveFeed(DomainCreateFeedRequest request) {
.categoryId(request.getCategoryId())
.userId(securitySpi.getCurrentUserId())
.authorityType(request.getAuthorityType())
.isDeleted(false)
.build();

UUID feedId = commandFeedSpi.saveFeed(feed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ public class CommentEntity extends BaseUUIDEntity {
private LocalDateTime updatedAt;

@Column(columnDefinition = "BIT(1) default 0", nullable = false)
private Boolean isDeleted;
private boolean isDeleted;

public CommentEntity updateComment(String content) {
this.content = content;
this.updatedAt = LocalDateTime.now();
return this;
}

public void updatedIsDeleted(Boolean isDeleted) {
public void updatedIsDeleted(boolean isDeleted) {
this.isDeleted = isDeleted;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class FeedEntity extends BaseUUIDEntity {
private String authorityType;

@Column(columnDefinition = "BIT(1) default 0", nullable = false)
private Boolean isDeleted;
private boolean isDeleted;

@OneToMany(mappedBy = "feedEntity")
private Set<FeedImageEntity> feedImageEntities;
Expand All @@ -53,7 +53,7 @@ public void updateFeedContent(String title, String content) {
this.content = content;
}

public void updateIsDeleted(Boolean isDeleted) {
public void updateIsDeleted(boolean isDeleted) {
this.isDeleted = isDeleted;
}
}

0 comments on commit 7f952bd

Please sign in to comment.