Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
813140b
Refactor: 트랜잭션 어노테이션을 클래스 레벨에서 메서드 레벨로 변경
jueunk617 Oct 1, 2025
0dbef53
Test: N+1 테스트에 datasource-proxy 적용
jueunk617 Oct 1, 2025
612d9d5
Refactor: WebSocketSessionManager에서 RedisSessionStore 분리
jueunk617 Oct 1, 2025
9dcda08
Refactor: WebSocketSessionManager에서 UserSessionService 분리
jueunk617 Oct 1, 2025
6346552
Refactor: WebSocketSessionManager에서 RoomParticipantService 분리
jueunk617 Oct 1, 2025
dba243e
Fix: RedisSessionStore의 @RequiredArgsConstructor 제거
jueunk617 Oct 1, 2025
6169284
Refactor: WebSocketConstants로 키/상수 값 분리하여 중앙 관리
jueunk617 Oct 1, 2025
a1e82fc
Refactor: 중복 로깅/불필요한 try-catch 제거
jueunk617 Oct 1, 2025
9642e89
Test: 리팩토링에 따른 테스트 코드 작성 및 수정
jueunk617 Oct 1, 2025
08678ab
Fix,Refect: 수정에도 byDay 불러오기 + 수정,삭제 기능 개선 (#135) (#139)
KSH0326 Oct 1, 2025
9a471cb
Feat: 알림 관련 entity/enum 구현
jueunk617 Oct 1, 2025
d16cee1
Feat: 알림 관련 repository 기본 구현
jueunk617 Oct 1, 2025
2bc5c68
Feat: WebSocket을 통한 실시간 알림 전송 서비스 구현
jueunk617 Oct 1, 2025
ca4a5ea
refactor: RoomMember 엔티티에서 실시간 상태 필드 제거, redis로 이관 (#143)
loseminho Oct 2, 2025
fb3849c
Feat: 게시글 생성 API 구현 (#131) (#148)
joyewon0705 Oct 2, 2025
0feb4b4
Feat: 게시글 다건/단건 조회 API 구현 (#131) (#149)
joyewon0705 Oct 2, 2025
efbd00f
Feat : RoomMember 엔티티 필드 제거 기반 redis 연동 (#144) (#145)
loseminho Oct 2, 2025
171ee32
Feat: 게시글 수정 및 삭제 API 구현 (#131) (#151)
joyewon0705 Oct 2, 2025
2de4b56
Feat: 알림 시스템 Controller + Service 구현
jueunk617 Oct 2, 2025
3b954c2
Refactor/156 (#156) (#157)
loseminho Oct 2, 2025
b82957e
Refactor: 변수명 분리 (#142) (#150)
KSH0326 Oct 2, 2025
2fe728c
Fix: 날짜 정보 형식 오류 수정 (#154) (#160)
KSH0326 Oct 2, 2025
6ce902a
Feat: 댓글 생성 API 구현 (#152) (#158)
joyewon0705 Oct 2, 2025
a08ce1b
Feat: 댓글 수정 및 삭제 API 구현 (#159) (#161)
joyewon0705 Oct 2, 2025
8e2ef8f
Refactor/146 (#146) (#164)
loseminho Oct 3, 2025
ed59e15
Feat: 댓글 조회 API 구현 (#162) (#165)
joyewon0705 Oct 4, 2025
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
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ dependencies {
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("org.testcontainers:testcontainers:1.19.3")
testImplementation("net.ttddyy:datasource-proxy:1.8.1")
testImplementation("org.testcontainers:junit-jupiter:1.19.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package com.back.domain.board.controller;

import com.back.domain.board.dto.CommentListResponse;
import com.back.domain.board.dto.CommentRequest;
import com.back.domain.board.dto.CommentResponse;
import com.back.domain.board.dto.PageResponse;
import com.back.domain.board.service.CommentService;
import com.back.global.common.dto.RsData;
import com.back.global.security.user.CustomUserDetails;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/posts/{postId}/comments")
@RequiredArgsConstructor
public class CommentController implements CommentControllerDocs {
private final CommentService commentService;

// 댓글 생성
@PostMapping
public ResponseEntity<RsData<CommentResponse>> createComment(
@PathVariable Long postId,
@RequestBody @Valid CommentRequest request,
@AuthenticationPrincipal CustomUserDetails user
) {
CommentResponse response = commentService.createComment(postId, request, user.getUserId());
return ResponseEntity
.status(HttpStatus.CREATED)
.body(RsData.success(
"댓글이 생성되었습니다.",
response
));
}

// 댓글 다건 조회
@GetMapping
public ResponseEntity<RsData<PageResponse<CommentListResponse>>> getComments(
@PathVariable Long postId,
@PageableDefault(sort = "createdAt", direction = Sort.Direction.ASC) Pageable pageable
) {
PageResponse<CommentListResponse> response = commentService.getComments(postId, pageable);
return ResponseEntity
.status(HttpStatus.OK)
.body(RsData.success(
"댓글 목록이 조회되었습니다.",
response
));
}

// 댓글 수정
@PutMapping("/{commentId}")
public ResponseEntity<RsData<CommentResponse>> updateComment(
@PathVariable Long postId,
@PathVariable Long commentId,
@RequestBody @Valid CommentRequest request,
@AuthenticationPrincipal CustomUserDetails user
) {
CommentResponse response = commentService.updateComment(postId, commentId, request, user.getUserId());
return ResponseEntity
.status(HttpStatus.OK)
.body(RsData.success(
"댓글이 수정되었습니다.",
response
));
}

// 댓글 삭제
@DeleteMapping("/{commentId}")
public ResponseEntity<RsData<Void>> deleteComment(
@PathVariable Long postId,
@PathVariable Long commentId,
@AuthenticationPrincipal CustomUserDetails user
) {
commentService.deleteComment(postId, commentId, user.getUserId());
return ResponseEntity
.status(HttpStatus.OK)
.body(RsData.success(
"댓글이 삭제되었습니다.",
null
));
}
}
Loading