Skip to content

Commit f0ead4c

Browse files
authored
Merge pull request #149 from kjoon418/main
feat: 바텀시트에서 자료를 별도로 표시할 수 있도록 정보 추가
2 parents 22a4cb8 + 42b8a28 commit f0ead4c

File tree

8 files changed

+30
-7
lines changed

8 files changed

+30
-7
lines changed

src/main/kotlin/goodspace/bllsoneshot/entity/assignment/Task.kt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@ import goodspace.bllsoneshot.entity.BaseEntity
44
import goodspace.bllsoneshot.entity.user.User
55
import goodspace.bllsoneshot.entity.user.UserRole
66
import goodspace.bllsoneshot.global.exception.ExceptionMessage.NEGATIVE_ACTUAL_MINUTES
7-
import jakarta.persistence.*
8-
import org.hibernate.annotations.BatchSize
7+
import jakarta.persistence.CascadeType
8+
import jakarta.persistence.Column
9+
import jakarta.persistence.Entity
10+
import jakarta.persistence.EnumType
11+
import jakarta.persistence.Enumerated
12+
import jakarta.persistence.FetchType
13+
import jakarta.persistence.JoinColumn
14+
import jakarta.persistence.ManyToOne
15+
import jakarta.persistence.OneToMany
16+
import jakarta.persistence.OneToOne
17+
import jakarta.persistence.Transient
918
import java.time.LocalDate
10-
import java.time.LocalDateTime
19+
import org.hibernate.annotations.BatchSize
1120

1221
@Entity
1322
class Task(
@@ -21,6 +30,8 @@ class Task(
2130

2231
var date: LocalDate? = null,
2332

33+
val uploadedAt: LocalDate? = null,
34+
2435
@Column(nullable = false)
2536
var name: String,
2637

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class ResourceController(
9595
resourceName: 자료 이름
9696
fileId: PDF 파일 ID (선택)
9797
columnLink: 칼럼 링크 (선택)
98+
uploadedAt: 업로드 날자 (안넣으면 오늘)
9899
99100
[응답]
100101
생성된 자료 정보

src/main/kotlin/goodspace/bllsoneshot/task/dto/request/ResourceCreateRequest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package goodspace.bllsoneshot.task.dto.request
22

33
import goodspace.bllsoneshot.entity.assignment.Subject
44
import jakarta.validation.constraints.NotBlank
5+
import java.time.LocalDate
56

67
data class ResourceCreateRequest(
78
val menteeId: Long,
89
val subject: Subject,
910
@field:NotBlank(message = "자료 이름이 비어 있습니다.")
1011
val resourceName: String,
1112
val fileId: Long? = null,
12-
val columnLink: String? = null
13+
val columnLink: String? = null,
14+
val uploadedAt: LocalDate = LocalDate.now()
1315
)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ data class ResourceResponse(
1111
val resourceName: String,
1212
val registeredDate: LocalDate,
1313
val worksheets: List<WorksheetResponse>,
14-
val columnLinks: List<ColumnLinkResponse>
14+
val columnLinks: List<ColumnLinkResponse>,
15+
val uploadedAt: LocalDate?
1516
)

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import goodspace.bllsoneshot.entity.assignment.Subject
44
import goodspace.bllsoneshot.entity.user.UserRole
55
import goodspace.bllsoneshot.task.dto.response.feedback.ColumnLinkResponse
66
import goodspace.bllsoneshot.task.dto.response.feedback.WorksheetResponse
7+
import java.time.LocalDate
78

89
data class TaskDetailResponse(
910
val taskId: Long,
@@ -14,6 +15,9 @@ data class TaskDetailResponse(
1415
val goalMinutes: Int,
1516
val actualMinutes: Int?,
1617

18+
val isResource: Boolean,
19+
val uploadedAt: LocalDate?,
20+
1721
val hasFeedback: Boolean,
1822
val generalComment: String?,
1923
val mentorName: String,

src/main/kotlin/goodspace/bllsoneshot/task/mapper/ResourceMapper.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class ResourceMapper(
1919
resourceName = task.name,
2020
registeredDate = task.date ?: LocalDate.now(),
2121
worksheets = task.worksheets.map { worksheetMapper.map(it) },
22-
columnLinks = task.columnLinks.map { columnLinkMapper.map(it) }
22+
columnLinks = task.columnLinks.map { columnLinkMapper.map(it) },
23+
uploadedAt = task.uploadedAt
2324
)
2425
}
2526

src/main/kotlin/goodspace/bllsoneshot/task/mapper/TaskDetailMapper.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class TaskDetailMapper(
3030
subject = task.subject,
3131
goalMinutes = task.goalMinutes,
3232
actualMinutes = task.actualMinutes,
33+
isResource = task.isResource,
34+
uploadedAt = task.uploadedAt,
3335
hasFeedback = task.hasFeedback(),
3436
generalComment = task.generalComment?.content,
3537
mentorName = task.mentee.mentor?.name ?: "",

src/main/kotlin/goodspace/bllsoneshot/task/service/ResourceService.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class ResourceService(
6767
name = request.resourceName,
6868
goalMinutes = 0,
6969
createdBy = UserRole.ROLE_MENTOR,
70-
isResource = true
70+
isResource = true,
71+
uploadedAt = request.uploadedAt
7172
)
7273

7374
request.fileId?.let { fileId ->

0 commit comments

Comments
 (0)