Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
[WEAV-116] factory method 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dojinyou committed Jan 29, 2024
1 parent 734cd02 commit 8918a7f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.studentcenter.weave.bootstrap.adapter.dto

import com.studentcenter.weave.domain.entity.University
import com.studentcenter.weave.domain.vo.UniversityName
import io.swagger.v3.oas.annotations.media.Schema
import java.util.*
Expand All @@ -18,4 +19,10 @@ data class UniversitiesResponse(
val domainAddress: String,
val logoAddress: String,
)

companion object {
fun from(domains: List<University>) = UniversitiesResponse(
domains.map { UniversityDto(it.id, it.name, it.domainAddress, it.logoAddress) }
)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.studentcenter.weave.bootstrap.adapter.dto

import com.studentcenter.weave.domain.entity.University
import com.studentcenter.weave.domain.vo.UniversityName
import io.swagger.v3.oas.annotations.media.Schema
import java.util.UUID
Expand All @@ -14,4 +15,15 @@ data class UniversityResponse(
val name: UniversityName,
val domainAddress: String,
val logoAddress: String,
)
) {

companion object {
fun from(domain: University) = UniversityResponse(
id = domain.id,
name = domain.name,
domainAddress = domain.domainAddress,
logoAddress = domain.logoAddress,
)
}

}

0 comments on commit 8918a7f

Please sign in to comment.