Skip to content

Commit 840472a

Browse files
committed
Chore: 세션 관련 swagger 문서 추가
1 parent f9eb6b9 commit 840472a

File tree

9 files changed

+40
-6
lines changed

9 files changed

+40
-6
lines changed

back/src/main/java/com/back/domain/mentoring/session/controller/MentoringSessionController.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,47 @@
55
import com.back.domain.mentoring.session.service.MentoringSessionManager;
66
import com.back.global.rq.Rq;
77
import com.back.global.rsData.RsData;
8+
import io.swagger.v3.oas.annotations.Operation;
9+
import io.swagger.v3.oas.annotations.tags.Tag;
810
import lombok.RequiredArgsConstructor;
911
import org.springframework.security.access.prepost.PreAuthorize;
10-
import org.springframework.security.core.annotation.AuthenticationPrincipal;
1112
import org.springframework.web.bind.annotation.*;
1213

1314
@RestController
1415
@RequiredArgsConstructor
1516
@RequestMapping("/sessions")
17+
@Tag(name = "MentoringSessionController", description = "멘토링 세션 API - 화상 채팅으로 멘토링 진행")
1618
public class MentoringSessionController {
1719
private final MentoringSessionManager mentoringSessionManager;
1820
private final Rq rq;
1921

20-
//세션참여 URL발급
2122
@GetMapping("/{sessionId}/url")
23+
@Operation(summary = "세션참여 URL 발급", description = "세션 참여를 위한 URL을 발급합니다.")
2224
public RsData<GetSessionUrlResponse> getSessionUrl(@PathVariable Long sessionId) {
2325
GetSessionUrlResponse response = mentoringSessionManager.getSessionUrl(sessionId);
2426
return new RsData<>("200", "요청완료", response);
2527
}
2628

27-
//세션 상세 정보(참여 현황?, 제목 등등?)
2829
@GetMapping("/{sessionId}")
30+
@Operation(summary = "세션 상세 정보", description = "세션 제목, 멘토, 멘티, 메시지 목록 등 세션의 상세 정보를 조회합니다.")
2931
public RsData<GetSessionInfoResponse> getSessionDetail(@PathVariable Long sessionId) {
3032
GetSessionInfoResponse response = mentoringSessionManager.getSessionDetail(sessionId);
3133
return new RsData<>("200", "요청완료", response);
3234
}
3335

34-
//세션 열기
3536
@PutMapping("/{sessionId}")
3637
@PreAuthorize("hasRole('MENTOR')")
38+
@Operation(summary = "세션 열기", description = "세션을 열어 멘토링을 진행합니다.")
3739
public RsData<OpenSessionResponse> openSession(@PathVariable Long sessionId) {
3840
Member member = rq.getActor();
3941
OpenSessionRequest openSessionRequest = new OpenSessionRequest(sessionId);
4042
OpenSessionResponse response = mentoringSessionManager.openSession(member, openSessionRequest);
4143
return new RsData<>("200", "세션 오픈 완료", response);
4244
}
4345

44-
//세션종료
4546
@DeleteMapping("/{sessionId}")
4647
@PreAuthorize("hasRole('MENTOR')")
48+
@Operation(summary = "세션 종료", description = "세션을 닫아 멘토링을 종료합니다.")
4749
public RsData<CloseSessionResponse> closeSession(@PathVariable Long sessionId) {
4850
Member member = rq.getActor();
4951
DeleteSessionRequest deleteSessionRequest = new DeleteSessionRequest(sessionId);
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package com.back.domain.mentoring.session.dto;
22

33
import com.back.domain.mentoring.session.entity.MessageType;
4-
import com.back.domain.mentoring.session.entity.SenderRole;
4+
import io.swagger.v3.oas.annotations.media.Schema;
55

66
public record ChatMessageRequest(
7+
@Schema(description = "메시지 타입", example = "TEXT")
78
MessageType type,
9+
@Schema(description = "메시지 내용", example = "msg")
810
String content
911
) {
1012
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
package com.back.domain.mentoring.session.dto;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
35
import java.time.LocalDateTime;
46

57
public record ChatMessageResponse(
8+
@Schema(description = "작성자명")
69
String senderName,
10+
@Schema(description = "메시지 내용")
711
String content,
12+
@Schema(description = "작성일시")
813
LocalDateTime createdAt
914
) {
1015
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
package com.back.domain.mentoring.session.dto;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
35
public record CloseSessionResponse(
6+
@Schema(description = "세션 URL")
47
String sessionUrl,
8+
@Schema(description = "멘토링 제목")
59
String mentoringTitle,
10+
@Schema(description = "세션 상태")
611
String status
712
) {
813
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package com.back.domain.mentoring.session.dto;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
35
public record DeleteSessionRequest(
6+
@Schema(description = "세션 ID")
47
Long sessionId
58
) {
69
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
package com.back.domain.mentoring.session.dto;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
35
public record GetSessionInfoResponse(
6+
@Schema(description = "멘토링 제목")
47
String mentoringTitle,
8+
@Schema(description = "멘토 이름")
59
String mentorName,
10+
@Schema(description = "멘티 이름")
611
String menteeName,
12+
@Schema(description = "세션 상태")
713
String sessionStatus
814
) {
915
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package com.back.domain.mentoring.session.dto;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
35
public record GetSessionUrlResponse(
6+
@Schema(description = "세션 URL")
47
String sessionUrl
58
) {
69
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package com.back.domain.mentoring.session.dto;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
35
public record OpenSessionRequest(
6+
@Schema(description = "세션 ID")
47
Long sessionId
58
) {
69
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
package com.back.domain.mentoring.session.dto;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
35
public record OpenSessionResponse(
6+
@Schema(description = "세션 URL")
47
String sessionUrl,
8+
@Schema(description = "멘토링 제목")
59
String mentoringTitle,
10+
@Schema(description = "세션 상태")
611
String status
712
) {
813
}

0 commit comments

Comments
 (0)