Skip to content

Commit

Permalink
fix: 필요없는 코드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaisqls committed Oct 25, 2023
1 parent 6bb8526 commit 3b8bbd5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import kr.hs.dsm.inq.domain.question.persistence.Category
import kr.hs.dsm.inq.domain.question.persistence.Tags

class QuestionDto @QueryProjection constructor(
val questionId: Long?,
val question: String?,
val category: Category?,
val username: String?,
val job: String?,
val jobDuration: Int?,
val questionId: Long,
val question: String,
val category: Category,
val username: String,
val job: String,
val jobDuration: Int,
tagList: List<Tags>?,
val isAnswered: Boolean?,
val isFavorite: Boolean?
val isAnswered: Boolean,
val isFavorite: Boolean
) {
val tagList = tagList ?: listOf()
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import java.time.LocalDateTime
import java.util.*

class QuestionSetDto @QueryProjection constructor(
val questionSetId : Long?,
val questionSetName : String?,
val questionSetId : Long,
val questionSetName : String,
val createdAt: LocalDateTime,
val category: Category?,
val username : String?,
val job : String?,
val jobDuration : Int?,
val category: Category,
val username : String,
val job : String,
val jobDuration : Int,
tagList : List<Tags>?,
val isAnswered : Boolean?,
val likeCount : Int?,
val viewCount : Int?,
val isAnswered : Boolean,
val likeCount : Int,
val viewCount : Int,
) {
val tagList = tagList ?: listOf()
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,30 @@ data class QuestionResponse(
companion object {
fun of(dto: QuestionDto) = dto.run {
QuestionResponse(
questionId = questionId ?: 0L,
question = question ?: "",
category = category ?: Category.CAREER,
username = username ?: "",
job = job ?: "",
jobDuration = jobDuration ?: 1,
questionId = questionId,
question = question,
category = category,
username = username,
job = job,
jobDuration = jobDuration,
tags = tagList.map { it.tag },
isAnswered = isAnswered ?: true,
isFavorite = isFavorite ?: true
isAnswered = isAnswered,
isFavorite = isFavorite
)
}

fun of(dto: QuestionDto, rank: Long) = dto.run {
QuestionResponse(
questionId = questionId ?: 0L,
questionId = questionId,
rank = rank,
question = question ?: "",
category = category ?: Category.CAREER,
username = username ?: "",
job = job ?: "",
jobDuration = jobDuration ?: 1,
question = question,
category = category,
username = username,
job = job,
jobDuration = jobDuration,
tags = tagList.map { it.tag },
isAnswered = isAnswered ?: true,
isFavorite = isFavorite ?: true
isAnswered = isAnswered,
isFavorite = isFavorite
)
}
}
Expand Down Expand Up @@ -216,17 +216,17 @@ data class QuestionSet (
companion object {
fun of (dto: QuestionSetDto) = dto.run {
QuestionSet(
questionSetId = questionSetId ?: 0L,
questionSetName = questionSetName ?: "",
questionSetId = questionSetId,
questionSetName = questionSetName,
createdAt = createdAt,
category = category ?: Category.CAREER,
username = username ?: "",
job = job ?: "",
jobDuration = jobDuration ?: 1,
category = category,
username = username,
job = job,
jobDuration = jobDuration,
tags = tagList.map { it.tag },
isAnswered = isAnswered ?: true,
likeCount = likeCount ?: 0,
viewCount = viewCount ?: 0,
isAnswered = isAnswered,
likeCount = likeCount,
viewCount = viewCount
)
}
}
Expand Down Expand Up @@ -266,11 +266,4 @@ data class GetQuestionSetDetailResponse(
)
}
}
}

/**
* val isLiked: Boolean,
* val isDisliked: Boolean,
* val isFavorite: Boolean,
* tagList: List<String>,
*/
}

0 comments on commit 3b8bbd5

Please sign in to comment.