Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d7dc598
Refactor: 트랜잭션 어노테이션을 클래스 레벨에서 메서드 레벨로 변경
jueunk617 Oct 1, 2025
5c2cdcd
Test: N+1 테스트에 datasource-proxy 적용
jueunk617 Oct 1, 2025
49e2949
Refactor: WebSocketSessionManager에서 RedisSessionStore 분리
jueunk617 Oct 1, 2025
3c55518
Refactor: WebSocketSessionManager에서 UserSessionService 분리
jueunk617 Oct 1, 2025
6555f5f
Refactor: WebSocketSessionManager에서 RoomParticipantService 분리
jueunk617 Oct 1, 2025
6f808e1
Fix: RedisSessionStore의 @RequiredArgsConstructor 제거
jueunk617 Oct 1, 2025
0d5fd45
Refactor: WebSocketConstants로 키/상수 값 분리하여 중앙 관리
jueunk617 Oct 1, 2025
a9b954c
Refactor: 중복 로깅/불필요한 try-catch 제거
jueunk617 Oct 1, 2025
f8b47ef
Test: 리팩토링에 따른 테스트 코드 작성 및 수정
jueunk617 Oct 1, 2025
391f94a
Merge branch 'dev' into Refactor/134
jueunk617 Oct 1, 2025
ee333c6
Merge pull request #140 from prgrms-web-devcourse-final-project/Refac…
jueunk617 Oct 1, 2025
564b0e6
Fix,Refect: 수정에도 byDay 불러오기 + 수정,삭제 기능 개선 (#135) (#139)
KSH0326 Oct 1, 2025
8f08149
Feat: 알림 관련 entity/enum 구현
jueunk617 Oct 1, 2025
a6ab3f4
Feat: 알림 관련 repository 기본 구현
jueunk617 Oct 1, 2025
1758f93
Feat: WebSocket을 통한 실시간 알림 전송 서비스 구현
jueunk617 Oct 1, 2025
cfa8a0e
refactor: RoomMember 엔티티에서 실시간 상태 필드 제거, redis로 이관 (#143)
loseminho Oct 2, 2025
9a64bb6
Feat: 게시글 생성 API 구현 (#131) (#148)
joyewon0705 Oct 2, 2025
809b6e2
Feat: 게시글 다건/단건 조회 API 구현 (#131) (#149)
joyewon0705 Oct 2, 2025
629b4ca
Feat : RoomMember 엔티티 필드 제거 기반 redis 연동 (#144) (#145)
loseminho Oct 2, 2025
5c6666b
Feat: 게시글 수정 및 삭제 API 구현 (#131) (#151)
joyewon0705 Oct 2, 2025
5135031
Feat: 알림 시스템 Controller + Service 구현
jueunk617 Oct 2, 2025
b861167
Merge branch 'dev' into Feat/141
jueunk617 Oct 2, 2025
61703e2
Merge pull request #153 from prgrms-web-devcourse-final-project/Feat/141
jueunk617 Oct 2, 2025
a57751f
Refactor/156 (#156) (#157)
loseminho Oct 2, 2025
f280430
Refactor: 변수명 분리 (#142) (#150)
KSH0326 Oct 2, 2025
2382a55
Fix: 날짜 정보 형식 오류 수정 (#154) (#160)
KSH0326 Oct 2, 2025
0a63ccc
Feat: 댓글 생성 API 구현 (#152) (#158)
joyewon0705 Oct 2, 2025
f4a59a6
Feat: 댓글 수정 및 삭제 API 구현 (#159) (#161)
joyewon0705 Oct 2, 2025
a89df69
Refactor/146 (#146) (#164)
loseminho Oct 3, 2025
9b6dfef
Feat: 댓글 조회 API 구현 (#162) (#165)
joyewon0705 Oct 4, 2025
f9423f4
Refactor : 스터디룸 웹소켓 연동과 역할 변경 알림 (#146) (#170)
loseminho 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