Trouble Shooting

·Trouble Shooting
문제 상황게시판의 좋아요 기능 구현을 하고 있었습니다. 게시판 좋아요 기능의 로직은 다음과 같습니다.@Transactional public LikeResponseDto toggleLike(UUID postId, Long userId) { Post post = postService.getPostById(postId); Like like = likeRepository.findFirstByPostAndUserId(post, userId) .orElse(new Like(post, userId)); // 좋아요 상태 토글 like.toggleLikeStatus(); likeRepository.save(like); ..
·Trouble Shooting
문제 상황@Entity@Table(name = "p_posts")@Getter@NoArgsConstructor(access = AccessLevel.PROTECTED)public class Post extends BaseEntity { public void incrementViews(){ this.views++; }} @Transactional public PostResponseDto getPost(UUID postId) { Post post = postRepository.findByPostId(postId) .orElseThrow(() -> new GlowGlowException(GlowGlowError.POST_NO_EXIST)); ..
지누박
'Trouble Shooting' 카테고리의 글 목록