Skip to content

Commit

Permalink
refactor : (#24) Modify change enum to boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
qkrwndnjs1075 committed Jan 20, 2025
1 parent 186e697 commit 843f4ab
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ data class CreateNoticeCommand(
val titleImageUrl: String,
@NotBlank(message = "설명은 비워둘 수 없습니다")
val description: List<String>,
@NotBlank(message = "모집 중요도는 비워둘 수 없습니다")
val importanceOfRecruit: ImportanceOfRecruit,
val isFocusRecruit: Boolean,
val isImportant: Boolean
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ data class UpdateNoticeCommand(
val titleImageUrl: String,
@NotBlank(message = "설명은 비워둘 수 없습니다")
val description: List<String>,
@NotBlank(message = "모집 중요도는 비워둘 수 없습니다")
val importanceOfRecruit: ImportanceOfRecruit,
val isFocusRecruit: Boolean,
val isImportant: Boolean
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class CreateNoticeService(
keyWord = command.keyWord,
titleImageUrl = command.titleImageUrl,
description = command.description,
importanceOfRecruit = command.importanceOfRecruit,
isFocusRecruit = command.isFocusRecruit,
isImportant = command.isImportant,
reports = listOf(),
)
noticeRepository.save(notice)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ class Notice(
@Column(name = "description", nullable = false)
var description: List<String>,
@Enumerated(EnumType.STRING)
@Column(name = "importance_of_recruit", nullable = false)
var importanceOfRecruit: ImportanceOfRecruit,
@Column(name = "is_focus_recruit", nullable = false)
var isFocusRecruit: Boolean,
@Column(name = "is_important", nullable = false)
var isImportant: Boolean,
@OneToMany(mappedBy = "notice", fetch = FetchType.LAZY)
val reports: List<Report> = listOf(),
) {
Expand All @@ -44,6 +46,7 @@ class Notice(
keyWord = command.keyWord
titleImageUrl = command.titleImageUrl
description = command.description
importanceOfRecruit = command.importanceOfRecruit
isFocusRecruit = command.isFocusRecruit
isImportant = command.isImportant
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ data class NoticeQueryResponse(
val keyWord: List<String>,
val titleImageUrl: String,
val description: List<String>,
val importanceOfRecruit: ImportanceOfRecruit,
val isFocusRecruit: Boolean,
val isImportant: Boolean,
) {
companion object {
fun from(notice: Notice) =
Expand All @@ -19,7 +20,8 @@ data class NoticeQueryResponse(
keyWord = notice.keyWord,
titleImageUrl = notice.titleImageUrl,
description = notice.description,
importanceOfRecruit = notice.importanceOfRecruit,
isFocusRecruit = notice.isFocusRecruit,
isImportant = notice.isImportant
)
}
}

0 comments on commit 843f4ab

Please sign in to comment.