From 61ddbb574308f687d9132269e91cd0beb028ff9a Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Thu, 30 Mar 2023 17:42:05 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Follow=E3=81=A8Accept=E3=81=AEclass?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/dev/usbharu/hideout/ap/Accept.kt | 16 ++++++++++++++++ src/main/kotlin/dev/usbharu/hideout/ap/Follow.kt | 16 ++++++++++++++++ .../hideout/service/ActivityPubService.kt | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/main/kotlin/dev/usbharu/hideout/ap/Accept.kt create mode 100644 src/main/kotlin/dev/usbharu/hideout/ap/Follow.kt diff --git a/src/main/kotlin/dev/usbharu/hideout/ap/Accept.kt b/src/main/kotlin/dev/usbharu/hideout/ap/Accept.kt new file mode 100644 index 00000000..15014b52 --- /dev/null +++ b/src/main/kotlin/dev/usbharu/hideout/ap/Accept.kt @@ -0,0 +1,16 @@ +package dev.usbharu.hideout.ap + +open class Accept : Object { + public var `object`:Object? = null + public var actor:String? = null + protected constructor() : super() + constructor( + type: List = emptyList(), + name: String, + `object`: Object?, + actor: String? + ) : super(add(type,"Accept"), name) { + this.`object` = `object` + this.actor = actor + } +} diff --git a/src/main/kotlin/dev/usbharu/hideout/ap/Follow.kt b/src/main/kotlin/dev/usbharu/hideout/ap/Follow.kt new file mode 100644 index 00000000..dca8de01 --- /dev/null +++ b/src/main/kotlin/dev/usbharu/hideout/ap/Follow.kt @@ -0,0 +1,16 @@ +package dev.usbharu.hideout.ap + +open class Follow : Object{ + public var `object`:Object? = null + public var actor:String? = null + protected constructor() : super() + constructor( + type: List = emptyList(), + name: String, + `object`: Object?, + actor: String? + ) : super(add(type,"Follow"), name) { + this.`object` = `object` + this.actor = actor + } +} diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ActivityPubService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ActivityPubService.kt index d26dc981..438a5f50 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ActivityPubService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ActivityPubService.kt @@ -15,7 +15,7 @@ class ActivityPubService() { return when(typeAsText){ "Follow" -> ActivityType.Follow "Undo" -> ActivityType.Undo - else -> throw IllegalArgumentException() + else -> throw IllegalArgumentException(typeAsText) } } }