Skip to content

Commit

Permalink
fix: 세미나 시간 LocalDateTime으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeryboy committed Sep 11, 2023
1 parent ea640a4 commit d6e6f3f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.wafflestudio.csereal.core.resource.attachment.database.AttachmentEnti
import com.wafflestudio.csereal.core.resource.mainImage.database.MainImageEntity
import com.wafflestudio.csereal.core.seminar.dto.SeminarDto
import jakarta.persistence.*
import java.time.LocalDateTime

@Entity(name = "seminar")
class SeminarEntity(
Expand Down Expand Up @@ -35,8 +36,8 @@ class SeminarEntity(
var affiliation: String,
var affiliationURL: String?,

var startDate: String?,
var endDate: String?,
var startDate: LocalDateTime?,
var endDate: LocalDateTime?,

var location: String,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.querydsl.core.BooleanBuilder
import com.querydsl.jpa.impl.JPAQueryFactory
import com.wafflestudio.csereal.common.CserealException
import com.wafflestudio.csereal.common.utils.FixedPageRequest
import com.wafflestudio.csereal.common.utils.cleanTextFromHtml
import com.wafflestudio.csereal.core.resource.mainImage.service.MainImageService
import com.wafflestudio.csereal.core.seminar.database.QSeminarEntity.seminarEntity
import com.wafflestudio.csereal.core.seminar.dto.SeminarSearchDto
Expand Down Expand Up @@ -75,11 +74,7 @@ class SeminarRepositoryImpl(
var isYearLast = false
if (i == seminarEntityList.size - 1) {
isYearLast = true
} else if (seminarEntityList[i].startDate?.substring(0, 4) != seminarEntityList[i + 1].startDate?.substring(
0,
4
)
) {
} else if (seminarEntityList[i].startDate?.year != seminarEntityList[i + 1].startDate?.year) {
isYearLast = true
}

Expand All @@ -100,6 +95,6 @@ class SeminarRepositoryImpl(
)
}

return SeminarSearchResponse(total!!, seminarSearchDtoList)
return SeminarSearchResponse(total, seminarSearchDtoList)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ data class SeminarDto(
val speakerTitle: String?,
val affiliation: String,
val affiliationURL: String?,
val startDate: String?,
val endDate: String?,
val startDate: LocalDateTime?,
val endDate: LocalDateTime?,
val location: String,
val host: String?,
val additionalNote: String?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package com.wafflestudio.csereal.core.seminar.dto

import com.querydsl.core.annotations.QueryProjection
import java.time.LocalDateTime

data class SeminarSearchDto @QueryProjection constructor(
val id: Long,
val title: String,
val description: String,
val name: String,
val affiliation: String,
val startDate: String?,
val startDate: LocalDateTime?,
val location: String,
val imageURL: String?,
val isYearLast: Boolean,
) {
}
}

0 comments on commit d6e6f3f

Please sign in to comment.