Change article.createdBy response
This commit is contained in:
@@ -16,6 +16,7 @@ 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 {
|
||||||
@@ -51,15 +52,21 @@ object FindArticles {
|
|||||||
object {
|
object {
|
||||||
val id = it.id
|
val id = it.id
|
||||||
val title = it.title
|
val title = it.title
|
||||||
val createdBy = object {
|
val createdBy: Any = it.createdBy.let { c ->
|
||||||
val id = it.createdBy.id
|
object {
|
||||||
val name = it.createdBy.name.let {
|
val id: UUID = c.id
|
||||||
object {
|
val name: Any = c.name.let { n ->
|
||||||
val firstName = it.firstName
|
object {
|
||||||
val lastName = it.lastName
|
val firstName: String = n.firstName
|
||||||
|
val lastName: String = n.lastName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val user: Any = c.user.let { u ->
|
||||||
|
object {
|
||||||
|
val username: String = u.username
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val email = it.createdBy.email
|
|
||||||
}
|
}
|
||||||
val workgroup = it.workgroup?.let {
|
val workgroup = it.workgroup?.let {
|
||||||
object {
|
object {
|
||||||
|
|||||||
@@ -40,6 +40,12 @@ paths:
|
|||||||
type: array
|
type: array
|
||||||
maxItems: 50
|
maxItems: 50
|
||||||
items:
|
items:
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
- title
|
||||||
|
- createdBy
|
||||||
|
- workgroup
|
||||||
|
- draft
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
type: string
|
type: string
|
||||||
@@ -47,21 +53,7 @@ paths:
|
|||||||
title:
|
title:
|
||||||
type: string
|
type: string
|
||||||
createdBy:
|
createdBy:
|
||||||
type: object
|
$ref: '#/components/schemas/CitizenCreator'
|
||||||
additionalProperties: false
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
type: string
|
|
||||||
format: uuid
|
|
||||||
name:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
firstName:
|
|
||||||
type: string
|
|
||||||
lastName:
|
|
||||||
type: string
|
|
||||||
email:
|
|
||||||
type: string
|
|
||||||
workgroup:
|
workgroup:
|
||||||
type: object
|
type: object
|
||||||
nullable: true
|
nullable: true
|
||||||
@@ -117,9 +109,13 @@ paths:
|
|||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
workgroup:
|
workgroup:
|
||||||
allOf:
|
default: null
|
||||||
- $ref: '#/components/schemas/UuidEntity'
|
additionalProperties: false
|
||||||
- default: null
|
required:
|
||||||
|
- id
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
$ref: "#/components/schemas/UUID"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Article created
|
description: Article created
|
||||||
|
|||||||
Reference in New Issue
Block a user