From bd122ea164127d26c8242f171f2d79a6ed52524c Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Fri, 28 Apr 2023 23:06:07 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20User=E3=81=AEinbox/outbox/url=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/dev/usbharu/hideout/service/impl/UserService.kt | 6 +++--- .../dev/usbharu/hideout/service/impl/UserServiceTest.kt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/service/impl/UserService.kt b/src/main/kotlin/dev/usbharu/hideout/service/impl/UserService.kt index 5e0018ab..fcf30dcb 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/impl/UserService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/impl/UserService.kt @@ -67,9 +67,9 @@ class UserService(private val userRepository: IUserRepository, private val userA screenName = user.screenName, description = user.description, password = HashedPassword, - inbox = "${Config.configData.url}/users/$nextId/inbox", - outbox = "${Config.configData.url}/users/$nextId/outbox", - url = "${Config.configData.url}/users/$nextId", + inbox = "${Config.configData.url}/users/${user.name}/inbox", + outbox = "${Config.configData.url}/users/${user.name}/outbox", + url = "${Config.configData.url}/users/${user.name}", publicKey = keyPair.public.toPem(), privateKey = keyPair.private.toPem(), Instant.now() diff --git a/src/test/kotlin/dev/usbharu/hideout/service/impl/UserServiceTest.kt b/src/test/kotlin/dev/usbharu/hideout/service/impl/UserServiceTest.kt index 45965180..31967bbe 100644 --- a/src/test/kotlin/dev/usbharu/hideout/service/impl/UserServiceTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/service/impl/UserServiceTest.kt @@ -39,10 +39,10 @@ class UserServiceTest{ assertEquals("XXXXXXXXXXXXX", firstValue.description) assertEquals("hashedPassword", firstValue.password) assertEquals(110001L, firstValue.id) - assertEquals("https://example.com/users/110001", firstValue.url) + assertEquals("https://example.com/users/test", firstValue.url) assertEquals("example.com", firstValue.domain) - assertEquals("https://example.com/users/110001/inbox", firstValue.inbox) - assertEquals("https://example.com/users/110001/outbox", firstValue.outbox) + assertEquals("https://example.com/users/test/inbox", firstValue.inbox) + assertEquals("https://example.com/users/test/outbox", firstValue.outbox) assertEquals(generateKeyPair.public.toPem(),firstValue.publicKey) assertEquals(generateKeyPair.private.toPem(),firstValue.privateKey) }