From 6ab132ab7990fad0ec1a11dfbad7feabd235a362 Mon Sep 17 00:00:00 2001 From: devxb Date: Sun, 12 May 2024 15:29:32 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=B9=A0=EC=A7=84=20persona=20visible?= =?UTF-8?q?=20=EC=84=B8=ED=8C=85=EC=9D=84=20=EC=B6=94=EA=B0=80=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/gitanimals/render/controller/PersonaController.kt | 6 +++--- .../gitanimals/render/domain/response/PersonaResponse.kt | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/org/gitanimals/render/controller/PersonaController.kt b/src/main/kotlin/org/gitanimals/render/controller/PersonaController.kt index 5ad8e10..76c019a 100644 --- a/src/main/kotlin/org/gitanimals/render/controller/PersonaController.kt +++ b/src/main/kotlin/org/gitanimals/render/controller/PersonaController.kt @@ -29,7 +29,7 @@ class PersonaController( ): PersonaResponse { val persona = userFacade.getPersona(token, personaId) - return PersonaResponse(persona.id, persona.type, persona.level) + return PersonaResponse(persona.id, persona.type, persona.level, persona.visible) } @PatchMapping("/personas") @@ -47,7 +47,7 @@ class PersonaController( ): PersonaResponse { val persona = userFacade.addPersona(token, idempotencyKey, addPersonaRequest.name) - return PersonaResponse(persona.id, persona.type, persona.level) + return PersonaResponse(persona.id, persona.type, persona.level, persona.visible) } @DeleteMapping("/internals/personas") @@ -57,7 +57,7 @@ class PersonaController( ): PersonaResponse { val persona = userFacade.deletePersona(token, personaId) - return PersonaResponse(persona.id, persona.type, persona.level) + return PersonaResponse(persona.id, persona.type, persona.level, persona.visible) } @ExceptionHandler(IllegalArgumentException::class) diff --git a/src/main/kotlin/org/gitanimals/render/domain/response/PersonaResponse.kt b/src/main/kotlin/org/gitanimals/render/domain/response/PersonaResponse.kt index 281004a..e11a208 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/response/PersonaResponse.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/response/PersonaResponse.kt @@ -7,10 +7,11 @@ data class PersonaResponse( val id: String, val type: PersonaType, val level: String, + val visible: Boolean, ) { companion object { fun from(persona: Persona): PersonaResponse { - return PersonaResponse(persona.id.toString(), persona.type, persona.level.toString()) + return PersonaResponse(persona.id.toString(), persona.type, persona.level.toString(), persona.visible) } } }