Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 14 additions & 3 deletions src/main/kotlin/goodspace/bllsoneshot/entity/assignment/Task.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ import goodspace.bllsoneshot.entity.BaseEntity
import goodspace.bllsoneshot.entity.user.User
import goodspace.bllsoneshot.entity.user.UserRole
import goodspace.bllsoneshot.global.exception.ExceptionMessage.NEGATIVE_ACTUAL_MINUTES
import jakarta.persistence.*
import org.hibernate.annotations.BatchSize
import jakarta.persistence.CascadeType
import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.EnumType
import jakarta.persistence.Enumerated
import jakarta.persistence.FetchType
import jakarta.persistence.JoinColumn
import jakarta.persistence.ManyToOne
import jakarta.persistence.OneToMany
import jakarta.persistence.OneToOne
import jakarta.persistence.Transient
import java.time.LocalDate
import java.time.LocalDateTime
import org.hibernate.annotations.BatchSize

@Entity
class Task(
Expand All @@ -21,6 +30,8 @@ class Task(

val date: LocalDate? = null,

val uploadedAt: LocalDate? = null,

@Column(nullable = false)
var name: String,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class ResourceController(
resourceName: 자료 이름
fileId: PDF 파일 ID (선택)
columnLink: 칼럼 링크 (선택)
uploadedAt: 업로드 날자 (안넣으면 오늘)

[응답]
생성된 자료 정보
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package goodspace.bllsoneshot.task.dto.request

import goodspace.bllsoneshot.entity.assignment.Subject
import jakarta.validation.constraints.NotBlank
import java.time.LocalDate

data class ResourceCreateRequest(
val menteeId: Long,
val subject: Subject,
@field:NotBlank(message = "자료 이름이 비어 있습니다.")
val resourceName: String,
val fileId: Long? = null,
val columnLink: String? = null
val columnLink: String? = null,
val uploadedAt: LocalDate = LocalDate.now()
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ data class ResourceResponse(
val resourceName: String,
val registeredDate: LocalDate,
val worksheets: List<WorksheetResponse>,
val columnLinks: List<ColumnLinkResponse>
val columnLinks: List<ColumnLinkResponse>,
val uploadedAt: LocalDate?
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import goodspace.bllsoneshot.entity.assignment.Subject
import goodspace.bllsoneshot.entity.user.UserRole
import goodspace.bllsoneshot.task.dto.response.feedback.ColumnLinkResponse
import goodspace.bllsoneshot.task.dto.response.feedback.WorksheetResponse
import java.time.LocalDate

data class TaskDetailResponse(
val taskId: Long,
Expand All @@ -14,6 +15,9 @@ data class TaskDetailResponse(
val goalMinutes: Int,
val actualMinutes: Int?,

val isResource: Boolean,
val uploadedAt: LocalDate?,

val hasFeedback: Boolean,
val generalComment: String?,
val mentorName: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class ResourceMapper(
resourceName = task.name,
registeredDate = task.date ?: LocalDate.now(),
worksheets = task.worksheets.map { worksheetMapper.map(it) },
columnLinks = task.columnLinks.map { columnLinkMapper.map(it) }
columnLinks = task.columnLinks.map { columnLinkMapper.map(it) },
uploadedAt = task.uploadedAt
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class TaskDetailMapper(
subject = task.subject,
goalMinutes = task.goalMinutes,
actualMinutes = task.actualMinutes,
isResource = task.isResource,
uploadedAt = task.uploadedAt,
hasFeedback = task.hasFeedback(),
generalComment = task.generalComment?.content,
mentorName = task.mentee.mentor?.name ?: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class ResourceService(
name = request.resourceName,
goalMinutes = 0,
createdBy = UserRole.ROLE_MENTOR,
isResource = true
isResource = true,
uploadedAt = request.uploadedAt
)

request.fileId?.let { fileId ->
Expand Down