Skip to content

Commit

Permalink
fix: researchEntity에 websiteURL 추가 (#211)
Browse files Browse the repository at this point in the history
* fix: researchEntity에 websiteURL 추가

* fix: ProfessorServiceTest 수정
  • Loading branch information
skfotakf authored Mar 12, 2024
1 parent ad8942f commit 60c8941
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class ResearchEntity(
@Column(columnDefinition = "mediumText")
var description: String?,

var websiteURL: String?,

@OneToMany(mappedBy = "research", cascade = [CascadeType.ALL], orphanRemoval = true)
var labs: MutableList<LabEntity> = mutableListOf(),

Expand All @@ -43,7 +45,8 @@ class ResearchEntity(
postType = researchDto.postType,
language = languageType,
name = researchDto.name,
description = researchDto.description
description = researchDto.description,
websiteURL = researchDto.websiteURL
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class ResearchSearchEntity(
appendLine(cleanTextFromHtml(it))
}
research.labs.forEach { appendLine(it.name) }
research.websiteURL?.let { appendLine(it) }
}.toString()

fun createContent(lab: LabEntity) = StringBuilder().apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ data class ResearchDto(
val language: String,
val name: String,
val description: String?,
val websiteURL: String?,
val createdAt: LocalDateTime?,
val modifiedAt: LocalDateTime?,
val labs: List<ResearchLabResponse>?,
Expand All @@ -26,6 +27,7 @@ data class ResearchDto(
language = LanguageType.makeLowercase(entity.language),
name = this.name,
description = this.description,
websiteURL = this.websiteURL,
createdAt = this.createdAt,
modifiedAt = this.modifiedAt,
labs = this.labs.map { ResearchLabResponse(id = it.id, name = it.name) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ProfessorServiceTest(
language = LanguageType.KO,
name = "researchName",
description = null,
websiteURL = null,
postType = ResearchPostType.LABS
)
var labEntity = LabEntity(
Expand Down Expand Up @@ -143,6 +144,7 @@ class ProfessorServiceTest(
language = LanguageType.KO,
name = "researchName",
description = null,
websiteURL = null,
postType = ResearchPostType.LABS
)
val labEntity1 = LabEntity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class ResearchSearchServiceTest(
language = LanguageType.KO,
name = "research",
postType = ResearchPostType.GROUPS,
description = null
description = null,
websiteURL = null
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class ResearchServiceTest(
name = "name",
postType = ResearchPostType.CENTERS,
description = "description",
websiteURL = null,
createdAt = null,
modifiedAt = null,
labs = null,
Expand Down Expand Up @@ -101,6 +102,7 @@ class ResearchServiceTest(
name = "name",
postType = ResearchPostType.CENTERS,
description = "description",
websiteURL = null,
createdAt = null,
modifiedAt = null,
labs = null,
Expand All @@ -121,6 +123,7 @@ class ResearchServiceTest(
name = "name2",
postType = ResearchPostType.GROUPS,
description = "description2",
websiteURL = null,
createdAt = null,
modifiedAt = null,
labs = null,
Expand Down Expand Up @@ -198,7 +201,8 @@ class ResearchServiceTest(
language = LanguageType.KO,
name = "research",
postType = ResearchPostType.GROUPS,
description = null
description = null,
websiteURL = null
)
)

Expand Down Expand Up @@ -305,7 +309,8 @@ class ResearchServiceTest(
language = LanguageType.KO,
name = "research",
postType = ResearchPostType.GROUPS,
description = null
description = null,
websiteURL = null
)
)

Expand Down

0 comments on commit 60c8941

Please sign in to comment.