Skip to content

Commit

Permalink
Merge pull request #99 from mummhy0811/main
Browse files Browse the repository at this point in the history
Fix: 편지 자동 상태변경 오류 수정 및 댓글 read에 댓글 id 추가
  • Loading branch information
mummhy0811 authored Nov 18, 2023
2 parents a055246 + ea0afd9 commit f88b1cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@Getter
@Setter
public class ViewCommentDto {
private Long comment_id;
private String writer_nickname;
private String writer_profile;
private Long root_comment_id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import com.onestep.server.entity.Letter;
import com.onestep.server.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

Expand All @@ -24,6 +26,8 @@ public interface ILetterRepository extends JpaRepository<Letter, Long> {
List<Letter> findWeeklyLetterByFamilyId(@Param("family") Family family);

//쪽지 상태 변경
@Transactional
@Modifying
@Query("UPDATE Letter l SET l.letter_state = l.letter_state+1 WHERE l.letter_state<2")
void changeLetterState();
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public List<ViewCommentDto> viewComment(Long answerId){
ViewCommentDto viewCommentDto = new ViewCommentDto();

viewCommentDto.setComment_txt(comment.getComment_txt());

viewCommentDto.setComment_id(comment.getComment_id());
if(comment.getComment()!=null){
viewCommentDto.setRoot_comment_id(comment.getComment().getComment_id());
}
Expand Down

0 comments on commit f88b1cc

Please sign in to comment.