create CitizenCreatorI.toOutput()
This commit is contained in:
21
src/main/kotlin/fr/dcproject/common/response/createdBy.kt
Normal file
21
src/main/kotlin/fr/dcproject/common/response/createdBy.kt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package fr.dcproject.common.response
|
||||||
|
|
||||||
|
import fr.dcproject.component.citizen.database.CitizenCreatorI
|
||||||
|
import java.util.UUID
|
||||||
|
|
||||||
|
fun CitizenCreatorI.toOutput(): Any = this.let { c ->
|
||||||
|
object {
|
||||||
|
val id: UUID = c.id
|
||||||
|
val name: Any = c.name.let { n ->
|
||||||
|
object {
|
||||||
|
val firstName: String = n.firstName
|
||||||
|
val lastName: String = n.lastName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val user: Any = c.user.let { u ->
|
||||||
|
object {
|
||||||
|
val username: String = u.username
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package fr.dcproject.component.article.routes
|
package fr.dcproject.component.article.routes
|
||||||
|
|
||||||
import fr.dcproject.common.dto.toOutput
|
import fr.dcproject.common.dto.toOutput
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.component.article.ArticleAccessControl
|
import fr.dcproject.component.article.ArticleAccessControl
|
||||||
import fr.dcproject.component.article.database.ArticleForListing
|
import fr.dcproject.component.article.database.ArticleForListing
|
||||||
@@ -16,7 +17,6 @@ import io.ktor.locations.Location
|
|||||||
import io.ktor.locations.get
|
import io.ktor.locations.get
|
||||||
import io.ktor.response.respond
|
import io.ktor.response.respond
|
||||||
import io.ktor.routing.Route
|
import io.ktor.routing.Route
|
||||||
import java.util.UUID
|
|
||||||
|
|
||||||
@KtorExperimentalLocationsAPI
|
@KtorExperimentalLocationsAPI
|
||||||
object FindArticles {
|
object FindArticles {
|
||||||
@@ -52,22 +52,7 @@ object FindArticles {
|
|||||||
object {
|
object {
|
||||||
val id = it.id
|
val id = it.id
|
||||||
val title = it.title
|
val title = it.title
|
||||||
val createdBy: Any = it.createdBy.let { c ->
|
val createdBy: Any = it.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val workgroup = it.workgroup?.let {
|
val workgroup = it.workgroup?.let {
|
||||||
object {
|
object {
|
||||||
val id = it.id
|
val id = it.id
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package fr.dcproject.component.comment.article.routes
|
package fr.dcproject.component.comment.article.routes
|
||||||
|
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.common.utils.receiveOrBadRequest
|
import fr.dcproject.common.utils.receiveOrBadRequest
|
||||||
import fr.dcproject.component.article.database.ArticleRef
|
import fr.dcproject.component.article.database.ArticleRef
|
||||||
@@ -58,22 +59,7 @@ object CreateCommentArticle {
|
|||||||
val reference: String = t.reference
|
val reference: String = t.reference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val createdBy: Any = comment.createdBy.let { c ->
|
val createdBy: Any = comment.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val votes: Any = object {
|
val votes: Any = object {
|
||||||
val up: Int = 0
|
val up: Int = 0
|
||||||
val neutral: Int = 0
|
val neutral: Int = 0
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package fr.dcproject.component.comment.article.routes
|
package fr.dcproject.component.comment.article.routes
|
||||||
|
|
||||||
import fr.dcproject.common.dto.toOutput
|
import fr.dcproject.common.dto.toOutput
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.component.article.database.ArticleRef
|
import fr.dcproject.component.article.database.ArticleRef
|
||||||
import fr.dcproject.component.auth.citizenOrNull
|
import fr.dcproject.component.auth.citizenOrNull
|
||||||
@@ -59,22 +60,7 @@ object GetArticleComments {
|
|||||||
val reference: String = t.reference
|
val reference: String = t.reference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val createdBy: Any = comment.createdBy.let { c ->
|
val createdBy: Any = comment.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val votes: Any = comment.votes.let { v ->
|
val votes: Any = comment.votes.let { v ->
|
||||||
object {
|
object {
|
||||||
val up: Int = v.up
|
val up: Int = v.up
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package fr.dcproject.component.comment.article.routes
|
package fr.dcproject.component.comment.article.routes
|
||||||
|
|
||||||
import fr.dcproject.common.dto.toOutput
|
import fr.dcproject.common.dto.toOutput
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.component.auth.citizenOrNull
|
import fr.dcproject.component.auth.citizenOrNull
|
||||||
import fr.dcproject.component.citizen.database.CitizenRef
|
import fr.dcproject.component.citizen.database.CitizenRef
|
||||||
@@ -48,22 +49,7 @@ object GetCitizenArticleComments {
|
|||||||
val reference: String = t.reference
|
val reference: String = t.reference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val createdBy: Any = comment.createdBy.let { c ->
|
val createdBy: Any = comment.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val votes: Any = comment.votes.let { v ->
|
val votes: Any = comment.votes.let { v ->
|
||||||
object {
|
object {
|
||||||
val up: Int = v.up
|
val up: Int = v.up
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package fr.dcproject.component.comment.constitution.routes
|
package fr.dcproject.component.comment.constitution.routes
|
||||||
|
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.common.utils.receiveOrBadRequest
|
import fr.dcproject.common.utils.receiveOrBadRequest
|
||||||
import fr.dcproject.component.auth.citizen
|
import fr.dcproject.component.auth.citizen
|
||||||
@@ -59,22 +60,7 @@ object CreateConstitutionComment {
|
|||||||
val reference: String = t.reference
|
val reference: String = t.reference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val createdBy: Any = comment.createdBy.let { c ->
|
val createdBy: Any = comment.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val votes: Any = object {
|
val votes: Any = object {
|
||||||
val up: Int = 0
|
val up: Int = 0
|
||||||
val neutral: Int = 0
|
val neutral: Int = 0
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package fr.dcproject.component.comment.constitution.routes
|
package fr.dcproject.component.comment.constitution.routes
|
||||||
|
|
||||||
import fr.dcproject.common.dto.toOutput
|
import fr.dcproject.common.dto.toOutput
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.component.auth.citizenOrNull
|
import fr.dcproject.component.auth.citizenOrNull
|
||||||
import fr.dcproject.component.citizen.database.CitizenRef
|
import fr.dcproject.component.citizen.database.CitizenRef
|
||||||
@@ -48,22 +49,7 @@ object GetCitizenCommentConstitution {
|
|||||||
val reference: String = t.reference
|
val reference: String = t.reference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val createdBy: Any = comment.createdBy.let { c ->
|
val createdBy: Any = comment.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val votes: Any = comment.votes.let { v ->
|
val votes: Any = comment.votes.let { v ->
|
||||||
object {
|
object {
|
||||||
val up: Int = v.up
|
val up: Int = v.up
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package fr.dcproject.component.comment.constitution.routes
|
package fr.dcproject.component.comment.constitution.routes
|
||||||
|
|
||||||
import fr.dcproject.common.dto.toOutput
|
import fr.dcproject.common.dto.toOutput
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.component.auth.citizenOrNull
|
import fr.dcproject.component.auth.citizenOrNull
|
||||||
import fr.dcproject.component.comment.constitution.database.CommentConstitutionRepository
|
import fr.dcproject.component.comment.constitution.database.CommentConstitutionRepository
|
||||||
@@ -48,22 +49,7 @@ object GetConstitutionComment {
|
|||||||
val reference: String = t.reference
|
val reference: String = t.reference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val createdBy: Any = comment.createdBy.let { c ->
|
val createdBy: Any = comment.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val votes: Any = comment.votes.let { v ->
|
val votes: Any = comment.votes.let { v ->
|
||||||
object {
|
object {
|
||||||
val up: Int = v.up
|
val up: Int = v.up
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package fr.dcproject.component.comment.generic.routes
|
package fr.dcproject.component.comment.generic.routes
|
||||||
|
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.common.utils.receiveOrBadRequest
|
import fr.dcproject.common.utils.receiveOrBadRequest
|
||||||
import fr.dcproject.component.auth.citizenOrNull
|
import fr.dcproject.component.auth.citizenOrNull
|
||||||
@@ -53,22 +54,7 @@ object EditComment {
|
|||||||
val reference: String = t.reference
|
val reference: String = t.reference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val createdBy: Any = comment.createdBy.let { c ->
|
val createdBy: Any = comment.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val votes: Any = comment.votes.let { v ->
|
val votes: Any = comment.votes.let { v ->
|
||||||
object {
|
object {
|
||||||
val up: Int = v.up
|
val up: Int = v.up
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package fr.dcproject.component.comment.generic.routes
|
package fr.dcproject.component.comment.generic.routes
|
||||||
|
|
||||||
import fr.dcproject.common.dto.toOutput
|
import fr.dcproject.common.dto.toOutput
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.component.auth.citizenOrNull
|
import fr.dcproject.component.auth.citizenOrNull
|
||||||
import fr.dcproject.component.comment.generic.CommentAccessControl
|
import fr.dcproject.component.comment.generic.CommentAccessControl
|
||||||
@@ -59,22 +60,7 @@ object GetCommentChildren {
|
|||||||
val reference: String = t.reference
|
val reference: String = t.reference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val createdBy: Any = comment.createdBy.let { c ->
|
val createdBy: Any = comment.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val votes: Any = comment.votes.let { v ->
|
val votes: Any = comment.votes.let { v ->
|
||||||
object {
|
object {
|
||||||
val up: Int = v.up
|
val up: Int = v.up
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package fr.dcproject.component.comment.generic.routes
|
package fr.dcproject.component.comment.generic.routes
|
||||||
|
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.component.auth.citizenOrNull
|
import fr.dcproject.component.auth.citizenOrNull
|
||||||
import fr.dcproject.component.comment.generic.CommentAccessControl
|
import fr.dcproject.component.comment.generic.CommentAccessControl
|
||||||
@@ -48,22 +49,7 @@ object GetOneComment {
|
|||||||
val reference: String = t.reference
|
val reference: String = t.reference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val createdBy: Any = comment.createdBy.let { c ->
|
val createdBy: Any = comment.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val votes: Any = comment.votes.let { v ->
|
val votes: Any = comment.votes.let { v ->
|
||||||
object {
|
object {
|
||||||
val up: Int = v.up
|
val up: Int = v.up
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package fr.dcproject.component.constitution.routes
|
package fr.dcproject.component.constitution.routes
|
||||||
|
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.common.utils.receiveOrBadRequest
|
import fr.dcproject.common.utils.receiveOrBadRequest
|
||||||
import fr.dcproject.component.article.database.ArticleRef
|
import fr.dcproject.component.article.database.ArticleRef
|
||||||
@@ -83,22 +84,7 @@ object CreateConstitution {
|
|||||||
val articles: List<Any> = t.articles.map { a ->
|
val articles: List<Any> = t.articles.map { a ->
|
||||||
val id = a.id
|
val id = a.id
|
||||||
val title = a.title
|
val title = a.title
|
||||||
val createdBy = a.createdBy.let { cr ->
|
val createdBy = a.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = cr.id
|
|
||||||
val name: Any = cr.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = cr.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val workgroup: Any? = a.workgroup?.let { w ->
|
val workgroup: Any? = a.workgroup?.let { w ->
|
||||||
object {
|
object {
|
||||||
val id = w.id
|
val id = w.id
|
||||||
@@ -112,22 +98,7 @@ object CreateConstitution {
|
|||||||
val draft: Boolean = c.draft
|
val draft: Boolean = c.draft
|
||||||
val versionId: UUID = c.versionId
|
val versionId: UUID = c.versionId
|
||||||
val createdAt: DateTime = c.createdAt
|
val createdAt: DateTime = c.createdAt
|
||||||
val createdBy: Any = c.createdBy.let { c ->
|
val createdBy: Any = c.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package fr.dcproject.component.constitution.routes
|
package fr.dcproject.component.constitution.routes
|
||||||
|
|
||||||
import fr.dcproject.common.dto.toOutput
|
import fr.dcproject.common.dto.toOutput
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.component.auth.citizenOrNull
|
import fr.dcproject.component.auth.citizenOrNull
|
||||||
import fr.dcproject.component.constitution.ConstitutionAccessControl
|
import fr.dcproject.component.constitution.ConstitutionAccessControl
|
||||||
@@ -41,22 +42,7 @@ object FindConstitutions {
|
|||||||
val title: String = c.title
|
val title: String = c.title
|
||||||
val versionId: UUID = c.versionId
|
val versionId: UUID = c.versionId
|
||||||
val createdAt: DateTime = c.createdAt
|
val createdAt: DateTime = c.createdAt
|
||||||
val createdBy: Any = c.createdBy.let { c ->
|
val createdBy: Any = c.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package fr.dcproject.component.constitution.routes
|
package fr.dcproject.component.constitution.routes
|
||||||
|
|
||||||
|
import fr.dcproject.common.response.toOutput
|
||||||
import fr.dcproject.common.security.assert
|
import fr.dcproject.common.security.assert
|
||||||
import fr.dcproject.component.auth.citizenOrNull
|
import fr.dcproject.component.auth.citizenOrNull
|
||||||
import fr.dcproject.component.constitution.ConstitutionAccessControl
|
import fr.dcproject.component.constitution.ConstitutionAccessControl
|
||||||
@@ -41,22 +42,7 @@ object GetConstitution {
|
|||||||
val articles: List<Any> = t.articles.map { a ->
|
val articles: List<Any> = t.articles.map { a ->
|
||||||
val id = a.id
|
val id = a.id
|
||||||
val title = a.title
|
val title = a.title
|
||||||
val createdBy = a.createdBy.let { cr ->
|
val createdBy = a.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = cr.id
|
|
||||||
val name: Any = cr.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = cr.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val workgroup: Any? = a.workgroup?.let { w ->
|
val workgroup: Any? = a.workgroup?.let { w ->
|
||||||
object {
|
object {
|
||||||
val id = w.id
|
val id = w.id
|
||||||
@@ -70,22 +56,7 @@ object GetConstitution {
|
|||||||
val draft: Boolean = c.draft
|
val draft: Boolean = c.draft
|
||||||
val versionId: UUID = c.versionId
|
val versionId: UUID = c.versionId
|
||||||
val createdAt: DateTime = c.createdAt
|
val createdAt: DateTime = c.createdAt
|
||||||
val createdBy: Any = c.createdBy.let { c ->
|
val createdBy: Any = c.createdBy.toOutput()
|
||||||
object {
|
|
||||||
val id: UUID = c.id
|
|
||||||
val name: Any = c.name.let { n ->
|
|
||||||
object {
|
|
||||||
val firstName: String = n.firstName
|
|
||||||
val lastName: String = n.lastName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val user: Any = c.user.let { u ->
|
|
||||||
object {
|
|
||||||
val username: String = u.username
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user