Skip to content

Commit

Permalink
chore: (#490) aop 적용을 위한 dto 상속
Browse files Browse the repository at this point in the history
dto
  • Loading branch information
rlaisqls committed May 10, 2023
1 parent d223fa9 commit ebc48cd
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import team.aliens.dms.domain.student.model.Student
import team.aliens.dms.domain.tag.model.Tag
import java.util.UUID

data class StudentWithTag(
open class StudentWithTag(
val id: UUID,
val name: String,
open val name: String,
val grade: Int,
val classRoom: Int,
val number: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package team.aliens.dms.domain.point.spi.vo
import team.aliens.dms.domain.point.model.PointType
import team.aliens.dms.domain.student.model.Student

data class StudentWithPointVO(
val name: String,
open class StudentWithPointVO(
open val name: String,
val grade: Int,
val classRoom: Int,
val number: Int,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
package team.aliens.dms.persistence.student.repository.vo

import com.querydsl.core.annotations.QueryProjection
import team.aliens.dms.common.annotation.EncryptType
import team.aliens.dms.common.annotation.EncryptedColumn
import team.aliens.dms.domain.point.spi.vo.StudentWithPointVO

data class QueryStudentWithPointVO @QueryProjection constructor(
val name: String,
val grade: Int,
val classRoom: Int,
val number: Int,
val bonusTotal: Int?,
val minusTotal: Int?
class QueryStudentWithPointVO @QueryProjection constructor(
@EncryptedColumn(type = EncryptType.SYMMETRIC)
override val name: String,
grade: Int,
classRoom: Int,
number: Int,
bonusTotal: Int?,
minusTotal: Int?,
) : StudentWithPointVO(
name = name,
grade = grade,
classRoom = classRoom,
number = number,
bonusTotal = bonusTotal ?: 0,
minusTotal = minusTotal ?: 0
)
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
package team.aliens.dms.persistence.student.repository.vo

import com.querydsl.core.annotations.QueryProjection
import team.aliens.dms.common.annotation.EncryptType
import team.aliens.dms.common.annotation.EncryptedColumn
import team.aliens.dms.domain.manager.spi.vo.StudentWithTag
import team.aliens.dms.domain.student.model.Sex
import team.aliens.dms.domain.tag.model.Tag
import team.aliens.dms.persistence.tag.entity.TagJpaEntity
import java.util.UUID

data class QueryStudentsWithTagVO @QueryProjection constructor(
val id: UUID,
val name: String,
val grade: Int,
val classRoom: Int,
val number: Int,
val roomNumber: String,
val profileImageUrl: String,
val sex: Sex,
val tags: List<TagJpaEntity>
class QueryStudentsWithTagVO @QueryProjection constructor(
id: UUID,
@EncryptedColumn(type = EncryptType.SYMMETRIC)
override val name: String,
grade: Int,
classRoom: Int,
number: Int,
roomNumber: String,
profileImageUrl: String,
sex: Sex,
tags: List<TagJpaEntity>
) : StudentWithTag(
id = id,
name = name,
grade = grade,
classRoom = classRoom,
number = number,
roomNumber = roomNumber,
profileImageUrl = profileImageUrl,
sex = sex,
tags = tags.map {
Tag(
id = it.id!!,
name = it.name,
color = it.color,
schoolId = it.school!!.id!!
)
}
)

0 comments on commit ebc48cd

Please sign in to comment.