Skip to content

Commit fdb5297

Browse files
authored
Merge pull request #115 from TwooTwoo/feat/mentee-info
feat: 자료 상세 조회 기능 구현
2 parents 265ee99 + b406cda commit fdb5297

16 files changed

Lines changed: 90 additions & 35 deletions

src/main/kotlin/goodspace/bllsoneshot/mypage/dto/response/LearningHistoryResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package goodspace.bllsoneshot.mypage.dto.response
22

3-
import goodspace.bllsoneshot.task.dto.response.TaskResponse
3+
import goodspace.bllsoneshot.task.dto.response.task.TaskResponse
44

55
data class LearningHistoryResponse(
66
val todayTasks: List<TaskResponse>,

src/main/kotlin/goodspace/bllsoneshot/task/controller/ResourceController.kt

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package goodspace.bllsoneshot.task.controller
33
import goodspace.bllsoneshot.global.security.userId
44
import goodspace.bllsoneshot.task.dto.request.ResourceCreateRequest
55
import goodspace.bllsoneshot.task.dto.request.ResourceUpdateRequest
6-
import goodspace.bllsoneshot.task.dto.response.ResourceResponse
7-
import goodspace.bllsoneshot.task.dto.response.ResourcesResponse
6+
import goodspace.bllsoneshot.task.dto.response.submit.ResourceResponse
7+
import goodspace.bllsoneshot.task.dto.response.resource.ResourceSummaryResponse
88
import goodspace.bllsoneshot.task.service.ResourceService
99
import io.swagger.v3.oas.annotations.Operation
1010
import io.swagger.v3.oas.annotations.tags.Tag
@@ -41,19 +41,48 @@ class ResourceController(
4141
4242
[응답]
4343
resourceId: 자료 ID
44-
subject: 과목(KOREAN, ENGLISH, MATH)
44+
resourceName: 자료 이름
4545
registeredDate: 등록일
46+
subject: 과목(KOREAN, ENGLISH, MATH)
4647
"""
4748
)
4849
fun getResources(
4950
principal: Principal,
5051
@RequestParam menteeId: Long
51-
): ResponseEntity<ResourcesResponse> {
52+
): ResponseEntity<List<ResourceSummaryResponse>> {
5253
val mentorId = principal.userId
5354
val response = resourceService.getResources(mentorId, menteeId)
5455
return ResponseEntity.ok(response)
5556
}
5657

58+
@GetMapping("/{resourceId}")
59+
@Operation(
60+
summary = "자료 상세 조회",
61+
description = """
62+
특정 멘티의 자료 하나를 상세 조회합니다.
63+
64+
[요청]
65+
resourceId: 자료 ID
66+
67+
[응답]
68+
resourceId: 자료 ID
69+
subject: 과목(KOREAN, ENGLISH, MATH)
70+
resourceName: 자료 이름
71+
registeredDate: 등록일
72+
worksheets: 학습 자료(워크시트) 목록
73+
columnLinks: 학습 자료(칼럼 링크) 목록
74+
"""
75+
)
76+
fun getResourceDetail(
77+
principal: Principal,
78+
@RequestParam resourceId: Long
79+
): ResponseEntity<ResourceResponse> {
80+
val mentorId = principal.userId
81+
val response = resourceService.getResourceDetail(mentorId, resourceId)
82+
83+
return ResponseEntity.ok(response)
84+
}
85+
5786
@PostMapping
5887
@Operation(
5988
summary = "자료 등록",

src/main/kotlin/goodspace/bllsoneshot/task/controller/TaskController.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import goodspace.bllsoneshot.task.dto.request.MenteeTaskUpdateRequest
77
import goodspace.bllsoneshot.task.dto.request.MentorTaskCreateRequest
88
import goodspace.bllsoneshot.task.dto.request.TaskCompleteRequest
99
import goodspace.bllsoneshot.task.dto.request.TaskSubmitRequest
10-
import goodspace.bllsoneshot.task.dto.response.TaskByDateResponse
11-
import goodspace.bllsoneshot.task.dto.response.TaskDetailResponse
12-
import goodspace.bllsoneshot.task.dto.response.TaskResponse
13-
import goodspace.bllsoneshot.task.dto.response.TasksResponse
10+
import goodspace.bllsoneshot.task.dto.response.task.TaskByDateResponse
11+
import goodspace.bllsoneshot.task.dto.response.task.TaskDetailResponse
12+
import goodspace.bllsoneshot.task.dto.response.task.TaskResponse
13+
import goodspace.bllsoneshot.task.dto.response.task.TasksResponse
1414
import goodspace.bllsoneshot.task.dto.response.feedback.TaskFeedbackResponse
1515
import goodspace.bllsoneshot.task.dto.response.submit.TaskSubmitResponse
1616
import goodspace.bllsoneshot.task.service.TaskService

src/main/kotlin/goodspace/bllsoneshot/task/dto/response/ResourcesResponse.kt

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package goodspace.bllsoneshot.task.dto.response.resource
2+
3+
import goodspace.bllsoneshot.entity.assignment.Subject
4+
import java.time.LocalDate
5+
6+
data class ResourceSummaryResponse(
7+
val resourceId: Long,
8+
val subject: Subject,
9+
val resourceName: String,
10+
val registeredDate: LocalDate
11+
)

src/main/kotlin/goodspace/bllsoneshot/task/dto/response/ResourceResponse.kt renamed to src/main/kotlin/goodspace/bllsoneshot/task/dto/response/submit/ResourceResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goodspace.bllsoneshot.task.dto.response
1+
package goodspace.bllsoneshot.task.dto.response.submit
22

33
import goodspace.bllsoneshot.entity.assignment.Subject
44
import goodspace.bllsoneshot.task.dto.response.feedback.ColumnLinkResponse

src/main/kotlin/goodspace/bllsoneshot/task/dto/response/TaskByDateResponse.kt renamed to src/main/kotlin/goodspace/bllsoneshot/task/dto/response/task/TaskByDateResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goodspace.bllsoneshot.task.dto.response
1+
package goodspace.bllsoneshot.task.dto.response.task
22

33
import java.time.LocalDate
44

src/main/kotlin/goodspace/bllsoneshot/task/dto/response/TaskDetailResponse.kt renamed to src/main/kotlin/goodspace/bllsoneshot/task/dto/response/task/TaskDetailResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goodspace.bllsoneshot.task.dto.response
1+
package goodspace.bllsoneshot.task.dto.response.task
22

33
import goodspace.bllsoneshot.entity.assignment.Subject
44
import goodspace.bllsoneshot.entity.user.UserRole

src/main/kotlin/goodspace/bllsoneshot/task/dto/response/TaskResponse.kt renamed to src/main/kotlin/goodspace/bllsoneshot/task/dto/response/task/TaskResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goodspace.bllsoneshot.task.dto.response
1+
package goodspace.bllsoneshot.task.dto.response.task
22

33
import goodspace.bllsoneshot.entity.assignment.Subject
44
import goodspace.bllsoneshot.entity.user.UserRole

src/main/kotlin/goodspace/bllsoneshot/task/dto/response/TasksResponse.kt renamed to src/main/kotlin/goodspace/bllsoneshot/task/dto/response/task/TasksResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goodspace.bllsoneshot.task.dto.response
1+
package goodspace.bllsoneshot.task.dto.response.task
22

33
data class TasksResponse(
44
val completedTaskAmount: Int,

0 commit comments

Comments
 (0)