diff --git a/.github/workflows/pull-request-merge-check.yml b/.github/workflows/pull-request-merge-check.yml index 06d208aa..c100e253 100644 --- a/.github/workflows/pull-request-merge-check.yml +++ b/.github/workflows/pull-request-merge-check.yml @@ -85,15 +85,17 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} title: Code Coverage update-comment: true - min-coverage-overall: 80 + min-coverage-overall: 50 min-coverage-changed-files: 80 - coverage-counter-type: LINE - name: JUnit Test Report uses: mikepenz/action-junit-report@v4 with: report_paths: '**/TEST-*.xml' + - name: Verify Coverage + run: ./hideout-core/gradlew :hideout-core:koverVerify + lint: name: Lint needs: [ setup ] diff --git a/hideout-core/build.gradle.kts b/hideout-core/build.gradle.kts index d184d19c..a9247b41 100644 --- a/hideout-core/build.gradle.kts +++ b/hideout-core/build.gradle.kts @@ -1,8 +1,25 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import com.github.jk1.license.filter.DependencyFilter import com.github.jk1.license.filter.LicenseBundleNormalizer import com.github.jk1.license.importer.DependencyDataImporter import com.github.jk1.license.importer.XmlReportImporter import com.github.jk1.license.render.* +import kotlinx.kover.gradle.plugin.dsl.CoverageUnit import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { @@ -21,19 +38,6 @@ apply { group = "dev.usbharu" version = "0.0.1" - -tasks.withType { - useJUnitPlatform() - doFirst { - jvmArgs = arrayOf( - "--add-opens", "java.base/java.lang=ALL-UNNAMED", - "--add-opens", "java.base/java.util=ALL-UNNAMED", - "--add-opens", "java.naming/javax.naming=ALL-UNNAMED", - "--add-opens", "java.base/java.util.concurrent.locks=ALL-UNNAMED" - ).toMutableList() - } -} - kotlin { jvmToolchain(21) compilerOptions { @@ -69,8 +73,7 @@ repositories { } -val os = org.gradle.nativeplatform.platform.internal - .DefaultNativePlatform.getCurrentOperatingSystem() +val os = org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.getCurrentOperatingSystem() dependencies { developmentOnly(libs.h2db) @@ -157,35 +160,40 @@ configurations { } } - -//tasks{ -// bootRun { -// sourceResources(sourceSets.main.get()) -// } -//} - -tasks.withType { - exclude("**/generated/**") - doFirst { - +tasks { + withType { + exclude("**/generated/**") + setSource("src/main/kotlin") + exclude("build/") + configureEach { + exclude("**/org/koin/ksp/generated/**", "**/generated/**") + } + } + withType() { + configureEach { + exclude("**/org/koin/ksp/generated/**", "**/generated/**") + } + } + withType { + useJUnitPlatform() + doFirst { + jvmArgs = arrayOf( + "--add-opens", + "java.base/java.lang=ALL-UNNAMED", + "--add-opens", + "java.base/java.util=ALL-UNNAMED", + "--add-opens", + "java.naming/javax.naming=ALL-UNNAMED", + "--add-opens", + "java.base/java.util.concurrent.locks=ALL-UNNAMED" + ).toMutableList() + } } - setSource("src/main/kotlin") - exclude("build/") } -tasks.withType().configureEach { - exclude("**/org/koin/ksp/generated/**", "**/generated/**") -} - -tasks.withType().configureEach { - exclude("**/org/koin/ksp/generated/**", "**/generated/**") -} project.gradle.taskGraph.whenReady { - println(this.allTasks) - this.allTasks.map { println(it.name) } if (this.hasTask(":koverGenerateArtifact")) { - println("has task") val task = this.allTasks.find { it.name == "test" } val verificationTask = task as VerificationTask verificationTask.ignoreFailures = true @@ -195,23 +203,22 @@ project.gradle.taskGraph.whenReady { kover { currentProject { sources { - excludedSourceSets.addAll( - "aot", "e2eTest", "intTest" - ) + } } reports { + verify { + rule { + bound{ + minValue = 50 + coverageUnits = CoverageUnit.INSTRUCTION + } + } + } filters { excludes { - packages( - "dev.usbharu.hideout.activitypub.domain.exception", - "dev.usbharu.hideout.core.domain.exception", - "dev.usbharu.hideout.core.domain.exception.media", - "dev.usbharu.hideout.core.domain.exception.resource", - "dev.usbharu.hideout.core.domain.exception.resource.local" - ) annotatedBy("org.springframework.context.annotation.Configuration") annotatedBy("org.springframework.boot.context.properties.ConfigurationProperties") packages( @@ -236,10 +243,7 @@ licenseReport { importers = arrayOf(XmlReportImporter("hideout", File("$projectDir/license-list.xml"))) renderers = arrayOf( - InventoryHtmlReportRenderer(), - CsvReportRenderer(), - JsonReportRenderer(), - XmlReportRenderer() + InventoryHtmlReportRenderer(), CsvReportRenderer(), JsonReportRenderer(), XmlReportRenderer() ) filters = arrayOf(LicenseBundleNormalizer("$projectDir/license-normalizer-bundle.json", true)) allowedLicensesFile = File("$projectDir/allowed-licenses.json") diff --git a/hideout-core/gradle/wrapper/gradle-wrapper.properties b/hideout-core/gradle/wrapper/gradle-wrapper.properties index 9355b415..71b2c5e9 100644 --- a/hideout-core/gradle/wrapper/gradle-wrapper.properties +++ b/hideout-core/gradle/wrapper/gradle-wrapper.properties @@ -1,3 +1,19 @@ +# +# Copyright (C) 2024 usbharu +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip diff --git a/hideout-core/gradlew b/hideout-core/gradlew index f5feea6d..7f0e3f40 100755 --- a/hideout-core/gradlew +++ b/hideout-core/gradlew @@ -1,13 +1,13 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright (C) 2024 usbharu # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# https://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -15,8 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# SPDX-License-Identifier: Apache-2.0 -# ############################################################################## # diff --git a/hideout-core/gradlew.bat b/hideout-core/gradlew.bat index 9b42019c..9f05b040 100644 --- a/hideout-core/gradlew.bat +++ b/hideout-core/gradlew.bat @@ -1,94 +1,110 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +# +# Copyright (C) 2024 usbharu +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/hideout-core/settings.gradle.kts b/hideout-core/settings.gradle.kts index bb105a10..07645f2b 100644 --- a/hideout-core/settings.gradle.kts +++ b/hideout-core/settings.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/ActorDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/ActorDetail.kt deleted file mode 100644 index d0c552c0..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/ActorDetail.kt +++ /dev/null @@ -1,38 +0,0 @@ -package dev.usbharu.hideout.core.application.actor - -import dev.usbharu.hideout.core.domain.model.actor.Actor -import java.net.URI - -data class ActorDetail( - val id: Long, - val name: String, - val screenName: String, - val host: String, - val remoteUrl: String?, - val locked: Boolean, - val description: String, - val postsCount: Int, - val iconUrl: URI?, - val bannerURL: URI?, - val followingCount: Int?, - val followersCount: Int?, -) { - companion object { - fun of(actor: Actor, iconUrl: URI?, bannerURL: URI?): ActorDetail { - return ActorDetail( - id = actor.id.id, - name = actor.name.name, - screenName = actor.screenName.screenName, - host = actor.url.host, - remoteUrl = actor.url.toString(), - locked = actor.locked, - description = actor.description.description, - postsCount = actor.postsCount.postsCount, - iconUrl = iconUrl, - bannerURL = bannerURL, - followingCount = actor.followingCount?.relationshipCount, - followersCount = actor.followersCount?.relationshipCount, - ) - } - } -} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/DeleteLocalActor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/DeleteLocalActor.kt deleted file mode 100644 index a00a4556..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/DeleteLocalActor.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.usbharu.hideout.core.application.actor - -import dev.usbharu.hideout.core.domain.model.actor.ActorId - -data class DeleteLocalActor(val actorId: ActorId) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetail.kt deleted file mode 100644 index 8089a404..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetail.kt +++ /dev/null @@ -1,8 +0,0 @@ -package dev.usbharu.hideout.core.application.actor - -import dev.usbharu.hideout.core.domain.model.support.acct.Acct - -data class GetActorDetail( - val actorName: Acct? = null, - val id: Long? = null -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetailApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetailApplicationService.kt index 722f16fe..5bcf059b 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetailApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetailApplicationService.kt @@ -1,11 +1,29 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.actor +import dev.usbharu.hideout.core.application.model.ActorDetail import dev.usbharu.hideout.core.application.shared.AbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.config.ApplicationConfig import dev.usbharu.hideout.core.domain.model.actor.ActorId import dev.usbharu.hideout.core.domain.model.actor.ActorRepository import dev.usbharu.hideout.core.domain.model.media.MediaRepository +import dev.usbharu.hideout.core.domain.model.support.acct.Acct import dev.usbharu.hideout.core.domain.model.support.principal.Principal import org.slf4j.LoggerFactory import org.springframework.stereotype.Component @@ -37,8 +55,8 @@ class GetActorDetailApplicationService( throw IllegalArgumentException("id and actorName are null.") } - val iconUrl = actor.icon?.let { mediaRepository.findById(it)?.url } - val bannerUrl = actor.banner?.let { mediaRepository.findById(it)?.url } + val iconUrl = actor.icon?.let { mediaRepository.findById(it) } + val bannerUrl = actor.banner?.let { mediaRepository.findById(it) } return ActorDetail.of(actor, iconUrl, bannerUrl) } @@ -47,3 +65,8 @@ class GetActorDetailApplicationService( private val logger = LoggerFactory.getLogger(GetActorDetailApplicationService::class.java) } } + +data class GetActorDetail( + val actorName: Acct? = null, + val id: Long? = null +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetUserDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetUserDetail.kt deleted file mode 100644 index 16ece3c9..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetUserDetail.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.actor - -data class GetUserDetail(val id: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetUserDetailApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetUserDetailApplicationService.kt index 6d990ee2..23da420c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetUserDetailApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetUserDetailApplicationService.kt @@ -17,6 +17,7 @@ package dev.usbharu.hideout.core.application.actor import dev.usbharu.hideout.core.application.exception.InternalServerException +import dev.usbharu.hideout.core.application.model.UserDetail import dev.usbharu.hideout.core.application.shared.AbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.ActorRepository @@ -50,3 +51,5 @@ class GetUserDetailApplicationService( val logger = LoggerFactory.getLogger(GetUserDetailApplicationService::class.java) } } + +data class GetUserDetail(val id: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/MigrationLocalActor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/MigrationLocalActor.kt deleted file mode 100644 index 71f7fe96..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/MigrationLocalActor.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.usbharu.hideout.core.application.actor - -data class MigrationLocalActor(val from: Long, val to: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/MigrationLocalActorApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/MigrationLocalActorApplicationService.kt index 24a36249..18ffeb73 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/MigrationLocalActorApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/MigrationLocalActorApplicationService.kt @@ -74,3 +74,5 @@ class MigrationLocalActorApplicationService( private val logger = LoggerFactory.getLogger(MigrationLocalActorApplicationService::class.java) } } + +data class MigrationLocalActor(val from: Long, val to: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/RegisterLocalActor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/RegisterLocalActor.kt deleted file mode 100644 index b54f2504..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/RegisterLocalActor.kt +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.actor - -data class RegisterLocalActor( - val name: String, - val password: String, -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/RegisterLocalActorApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/RegisterLocalActorApplicationService.kt index 27adac58..27f2eae0 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/RegisterLocalActorApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/RegisterLocalActorApplicationService.kt @@ -76,3 +76,8 @@ class RegisterLocalActorApplicationService( private val logger = LoggerFactory.getLogger(RegisterLocalActorApplicationService::class.java) } } + +data class RegisterLocalActor( + val name: String, + val password: String, +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/SetAlsoKnownAsLocalActorApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/SetAlsoKnownAsLocalActorApplicationService.kt deleted file mode 100644 index 3f676614..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/SetAlsoKnownAsLocalActorApplicationService.kt +++ /dev/null @@ -1,8 +0,0 @@ -package dev.usbharu.hideout.core.application.actor - -import org.springframework.stereotype.Service - -@Service -interface SetAlsoKnownAsLocalActorApplicationService { - suspend fun setAlsoKnownAs(actorId: Long, alsoKnownAs: List) -} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/StartDeleteLocalActorApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/StartDeleteLocalActorApplicationService.kt index 288fdf22..1ab250c3 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/StartDeleteLocalActorApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/StartDeleteLocalActorApplicationService.kt @@ -20,6 +20,7 @@ import dev.usbharu.hideout.core.application.exception.InternalServerException import dev.usbharu.hideout.core.application.exception.PermissionDeniedException import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction +import dev.usbharu.hideout.core.domain.model.actor.ActorId import dev.usbharu.hideout.core.domain.model.actor.ActorRepository import dev.usbharu.hideout.core.domain.model.support.principal.LocalUser import org.slf4j.LoggerFactory @@ -44,3 +45,5 @@ class StartDeleteLocalActorApplicationService( private val logger = LoggerFactory.getLogger(StartDeleteLocalActorApplicationService::class.java) } } + +data class DeleteLocalActor(val actorId: ActorId) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/SuspendLocalActor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/SuspendLocalActor.kt deleted file mode 100644 index a566ce97..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/SuspendLocalActor.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.usbharu.hideout.core.application.actor - -data class SuspendLocalActor(val actorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/SuspendLocalActorApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/SuspendLocalActorApplicationService.kt index eaeba5e7..0a8b7ab8 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/SuspendLocalActorApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/SuspendLocalActorApplicationService.kt @@ -42,3 +42,5 @@ class SuspendLocalActorApplicationService( private val logger = LoggerFactory.getLogger(SuspendLocalActorApplicationService::class.java) } } + +data class SuspendLocalActor(val actorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/UnsuspendLocalActor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/UnsuspendLocalActor.kt deleted file mode 100644 index a8107458..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/UnsuspendLocalActor.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.usbharu.hideout.core.application.actor - -data class UnsuspendLocalActor(val actorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/UnsuspendLocalActorApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/UnsuspendLocalActorApplicationService.kt index 019753e8..b27cd3eb 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/UnsuspendLocalActorApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/UnsuspendLocalActorApplicationService.kt @@ -42,3 +42,5 @@ class UnsuspendLocalActorApplicationService( private val logger = LoggerFactory.getLogger(UnsuspendLocalActorApplicationService::class.java) } } + +data class UnsuspendLocalActor(val actorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/application/RegisterApplication.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/application/RegisterApplication.kt deleted file mode 100644 index f39b957f..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/application/RegisterApplication.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.application - -import java.net.URI - -data class RegisterApplication( - val name: String, - val redirectUris: Set, - val useRefreshToken: Boolean, - val scopes: Set, -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/application/RegisterApplicationApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/application/RegisterApplicationApplicationService.kt index 752b4a78..10a50ca1 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/application/RegisterApplicationApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/application/RegisterApplicationApplicationService.kt @@ -34,6 +34,7 @@ import org.springframework.security.oauth2.server.authorization.client.Registere import org.springframework.security.oauth2.server.authorization.settings.ClientSettings import org.springframework.security.oauth2.server.authorization.settings.TokenSettings import org.springframework.stereotype.Service +import java.net.URI import java.time.Duration @Service @@ -44,9 +45,15 @@ class RegisterApplicationApplicationService( private val registeredClientRepository: RegisteredClientRepository, transaction: Transaction, private val applicationRepository: ApplicationRepository, -) : AbstractApplicationService(transaction, logger) { +) : AbstractApplicationService( + transaction, + logger +) { - override suspend fun internalExecute(command: RegisterApplication, principal: Principal): RegisteredApplication { + override suspend fun internalExecute( + command: RegisterApplication, + principal: Principal + ): dev.usbharu.hideout.core.application.model.Application { val id = idGenerateService.generateId() val clientSecret = secureTokenGenerator.generate() val registeredClient = RegisteredClient @@ -82,7 +89,7 @@ class RegisterApplicationApplicationService( val application = Application(ApplicationId(id), ApplicationName(command.name)) applicationRepository.save(application) - return RegisteredApplication( + return dev.usbharu.hideout.core.application.model.Application( id = id, name = command.name, clientSecret = clientSecret, @@ -95,3 +102,10 @@ class RegisterApplicationApplicationService( private val logger = LoggerFactory.getLogger(RegisterApplicationApplicationService::class.java) } } + +data class RegisterApplication( + val name: String, + val redirectUris: Set, + val useRefreshToken: Boolean, + val scopes: Set, +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/DomainEventSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/DomainEventSubscriber.kt index af70e1ef..59229def 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/DomainEventSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/DomainEventSubscriber.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.domainevent.subscribers import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEvent diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterHomeTimeline.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterHomeTimeline.kt index 9f2ce4b0..c3eddf7b 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterHomeTimeline.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterHomeTimeline.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.domainevent.subscribers data class RegisterHomeTimeline( diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterLocalUserSetHomeTimelineSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterLocalUserSetHomeTimelineSubscriber.kt index 776c040c..4c9ff93a 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterLocalUserSetHomeTimelineSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterLocalUserSetHomeTimelineSubscriber.kt @@ -1,5 +1,22 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.domainevent.subscribers +import dev.usbharu.hideout.core.application.timeline.UserRegisterHomeTimelineApplicationService import dev.usbharu.hideout.core.domain.event.userdetail.UserDetailEvent import dev.usbharu.hideout.core.domain.event.userdetail.UserDetailEventBody import dev.usbharu.hideout.core.domain.model.support.principal.Anonymous diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterTimelineSetTimelineStoreSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterTimelineSetTimelineStoreSubscriber.kt index 05c92128..efe28d17 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterTimelineSetTimelineStoreSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterTimelineSetTimelineStoreSubscriber.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.domainevent.subscribers import dev.usbharu.hideout.core.application.timeline.SetTimelineToTimelineStoreApplicationService diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/Subscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/Subscriber.kt index 5c42bbe8..3a83c763 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/Subscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/Subscriber.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.domainevent.subscribers interface Subscriber { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/SubscriberRunner.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/SubscriberRunner.kt index 7a7caedf..a4f11f62 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/SubscriberRunner.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/SubscriberRunner.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.domainevent.subscribers import org.slf4j.LoggerFactory diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelinePostCreateSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelinePostCreateSubscriber.kt index 3252e2bc..c9e8155f 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelinePostCreateSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelinePostCreateSubscriber.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.domainevent.subscribers import dev.usbharu.hideout.core.application.timeline.AddPost diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipFollowSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipFollowSubscriber.kt index c58b1b0f..1f67dbc4 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipFollowSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipFollowSubscriber.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.domainevent.subscribers import dev.usbharu.hideout.core.application.exception.InternalServerException diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipUnfollowSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipUnfollowSubscriber.kt index 0fc5b665..31b73d71 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipUnfollowSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipUnfollowSubscriber.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.domainevent.subscribers import dev.usbharu.hideout.core.application.timeline.RemoveTimelineRelationship diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/exception/InternalServerException.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/exception/InternalServerException.kt index 20db0f04..a4fab57e 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/exception/InternalServerException.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/exception/InternalServerException.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.exception class InternalServerException : RuntimeException { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/exception/PermissionDeniedException.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/exception/PermissionDeniedException.kt index 613609ed..e59663be 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/exception/PermissionDeniedException.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/exception/PermissionDeniedException.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.exception class PermissionDeniedException : RuntimeException { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/DeleteFilter.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/DeleteFilter.kt deleted file mode 100644 index 52a2bf0a..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/DeleteFilter.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.filter - -data class DeleteFilter(val filterId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/GetFilter.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/GetFilter.kt deleted file mode 100644 index b9089ab0..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/GetFilter.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.filter - -data class GetFilter(val filterId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/RegisterFilter.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/RegisterFilter.kt deleted file mode 100644 index 3fd9a35f..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/RegisterFilter.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.filter - -import dev.usbharu.hideout.core.domain.model.filter.FilterAction -import dev.usbharu.hideout.core.domain.model.filter.FilterContext - -data class RegisterFilter( - val filterName: String, - val filterContext: Set, - val filterAction: FilterAction, - val filterKeywords: Set, -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/RegisterFilterKeyword.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/RegisterFilterKeyword.kt deleted file mode 100644 index b6e3ed31..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/RegisterFilterKeyword.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.filter - -import dev.usbharu.hideout.core.domain.model.filter.FilterMode - -data class RegisterFilterKeyword( - val keyword: String, - val filterMode: FilterMode, -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserDeleteFilterApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserDeleteFilterApplicationService.kt index 19b07618..f500528b 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserDeleteFilterApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserDeleteFilterApplicationService.kt @@ -44,3 +44,5 @@ class UserDeleteFilterApplicationService(private val filterRepository: FilterRep private val logger = LoggerFactory.getLogger(UserDeleteFilterApplicationService::class.java) } } + +data class DeleteFilter(val filterId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserGetFilterApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserGetFilterApplicationService.kt index 1038fe2a..e97209fc 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserGetFilterApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserGetFilterApplicationService.kt @@ -17,6 +17,7 @@ package dev.usbharu.hideout.core.application.filter import dev.usbharu.hideout.core.application.exception.PermissionDeniedException +import dev.usbharu.hideout.core.application.model.Filter import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.filter.FilterId @@ -44,3 +45,5 @@ class UserGetFilterApplicationService(private val filterRepository: FilterReposi private val logger = LoggerFactory.getLogger(UserGetFilterApplicationService::class.java) } } + +data class GetFilter(val filterId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserRegisterFilterApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserRegisterFilterApplicationService.kt index 4baa0ac3..4427e484 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserRegisterFilterApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/UserRegisterFilterApplicationService.kt @@ -16,10 +16,10 @@ package dev.usbharu.hideout.core.application.filter +import dev.usbharu.hideout.core.application.model.Filter import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.filter.* -import dev.usbharu.hideout.core.domain.model.filter.FilterKeyword import dev.usbharu.hideout.core.domain.model.support.principal.LocalUser import dev.usbharu.hideout.core.domain.shared.id.IdGenerateService import org.slf4j.LoggerFactory @@ -61,3 +61,15 @@ class UserRegisterFilterApplicationService( private val logger = LoggerFactory.getLogger(UserRegisterFilterApplicationService::class.java) } } + +data class RegisterFilter( + val filterName: String, + val filterContext: Set, + val filterAction: FilterAction, + val filterKeywords: Set, +) + +data class RegisterFilterKeyword( + val keyword: String, + val filterMode: FilterMode, +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt index cdca8b84..dfaf121e 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt @@ -1,6 +1,23 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.instance import dev.usbharu.hideout.core.application.exception.InternalServerException +import dev.usbharu.hideout.core.application.model.Instance import dev.usbharu.hideout.core.application.shared.AbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.config.ApplicationConfig diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/Instance.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/Instance.kt deleted file mode 100644 index c4853256..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/Instance.kt +++ /dev/null @@ -1,17 +0,0 @@ -package dev.usbharu.hideout.core.application.instance - -import dev.usbharu.hideout.core.domain.model.instance.Instance -import java.net.URI - -data class Instance(val id: Long, val name: String, val url: URI, val description: String) { - companion object { - fun of(instance: Instance): dev.usbharu.hideout.core.application.instance.Instance { - return Instance( - instance.id.instanceId, - instance.name.name, - instance.url, - instance.description.description - ) - } - } -} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/media/Media.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/media/Media.kt deleted file mode 100644 index 5ff3e4a8..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/media/Media.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.media - -import dev.usbharu.hideout.core.domain.model.media.FileType -import dev.usbharu.hideout.core.domain.model.media.Media -import dev.usbharu.hideout.core.domain.model.media.MimeType -import java.net.URI - -data class Media( - val id: Long, - val name: String, - val url: URI, - val thumbprintURI: URI?, - val remoteURL: URI?, - val type: FileType, - val mimeType: MimeType, - val blurHash: String?, - val description: String? -) { - companion object { - fun of(media: Media): dev.usbharu.hideout.core.application.media.Media { - return Media( - id = media.id.id, - name = media.name.name, - url = media.url, - thumbprintURI = media.thumbnailUrl, - remoteURL = media.remoteUrl, - type = media.type, - mimeType = media.mimeType, - blurHash = media.blurHash?.hash, - description = media.description?.description - ) - } - } -} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/media/UploadMediaApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/media/UploadMediaApplicationService.kt index 8f796c7f..257a12fd 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/media/UploadMediaApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/media/UploadMediaApplicationService.kt @@ -16,6 +16,7 @@ package dev.usbharu.hideout.core.application.media +import dev.usbharu.hideout.core.application.model.MediaDetail import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.media.* @@ -26,6 +27,8 @@ import dev.usbharu.hideout.core.external.mediastore.MediaStore import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Qualifier import org.springframework.stereotype.Service +import java.net.URI +import java.nio.file.Path import dev.usbharu.hideout.core.domain.model.media.Media as MediaModel @Service @@ -35,11 +38,11 @@ class UploadMediaApplicationService( private val mediaRepository: MediaRepository, private val idGenerateService: IdGenerateService, transaction: Transaction -) : LocalUserAbstractApplicationService( +) : LocalUserAbstractApplicationService( transaction, logger ) { - override suspend fun internalExecute(command: UploadMedia, principal: LocalUser): Media { + override suspend fun internalExecute(command: UploadMedia, principal: LocalUser): MediaDetail { val process = mediaProcessor.process(command.path, command.name, null) val id = idGenerateService.generateId() val thumbnailUri = if (process.thumbnailPath != null) { @@ -64,10 +67,17 @@ class UploadMediaApplicationService( mediaRepository.save(media) - return Media.of(media) + return MediaDetail.of(media) } companion object { private val logger = LoggerFactory.getLogger(UploadMediaApplicationService::class.java) } } + +data class UploadMedia( + val path: Path, + val name: String, + val remoteUri: URI?, + val description: String? +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/ActorDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/ActorDetail.kt new file mode 100644 index 00000000..7cbdd246 --- /dev/null +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/ActorDetail.kt @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dev.usbharu.hideout.core.application.model + +import dev.usbharu.hideout.core.domain.model.actor.Actor +import dev.usbharu.hideout.core.domain.model.media.Media +import java.net.URI + +data class ActorDetail( + val id: Long, + val name: String, + val screenName: String, + val host: String, + val instanceId: Long, + val remoteUrl: URI?, + val locked: Boolean, + val description: String, + val postsCount: Int, + val iconUrl: URI?, + val bannerURL: URI?, + val followingCount: Int?, + val followersCount: Int?, +) { + companion object { + fun of(actor: Actor, iconMedia: Media?, bannerMedia: Media?): ActorDetail { + return ActorDetail( + id = actor.id.id, + name = actor.name.name, + screenName = actor.screenName.screenName, + host = actor.url.host, + instanceId = actor.instance.instanceId, + remoteUrl = actor.url, + locked = actor.locked, + description = actor.description.description, + postsCount = actor.postsCount.postsCount, + iconUrl = iconMedia?.url, + bannerURL = bannerMedia?.url, + followingCount = actor.followingCount?.relationshipCount, + followersCount = actor.followersCount?.relationshipCount, + ) + } + } +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/application/RegisteredApplication.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Application.kt similarity index 89% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/application/RegisteredApplication.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Application.kt index a5a18032..38e93779 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/application/RegisteredApplication.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Application.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.application +package dev.usbharu.hideout.core.application.model import java.net.URI -data class RegisteredApplication( +data class Application( val id: Long, val name: String, val redirectUris: Set, diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/Filter.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Filter.kt similarity index 95% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/Filter.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Filter.kt index e482991a..f2c625aa 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/Filter.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Filter.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.filter +package dev.usbharu.hideout.core.application.model import dev.usbharu.hideout.core.domain.model.filter.Filter import dev.usbharu.hideout.core.domain.model.filter.FilterAction @@ -29,7 +29,7 @@ data class Filter( val filterKeywords: Set, ) { companion object { - fun of(filter: Filter): dev.usbharu.hideout.core.application.filter.Filter { + fun of(filter: Filter): dev.usbharu.hideout.core.application.model.Filter { return Filter( filterId = filter.id.id, userDetailId = filter.userDetailId.id, diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/FilterKeyword.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/FilterKeyword.kt similarity index 93% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/FilterKeyword.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/FilterKeyword.kt index bb58f6e6..14eeca8b 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/filter/FilterKeyword.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/FilterKeyword.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.filter +package dev.usbharu.hideout.core.application.model import dev.usbharu.hideout.core.domain.model.filter.FilterMode diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/media/UploadMedia.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Instance.kt similarity index 53% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/media/UploadMedia.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Instance.kt index 4a8af8d3..f57470a9 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/media/UploadMedia.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Instance.kt @@ -14,9 +14,20 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.media +package dev.usbharu.hideout.core.application.model +import dev.usbharu.hideout.core.domain.model.instance.Instance import java.net.URI -import java.nio.file.Path -data class UploadMedia(val path: Path, val name: String, val remoteUri: URI?, val description: String?) +data class Instance(val id: Long, val name: String, val url: URI, val description: String) { + companion object { + fun of(instance: Instance): dev.usbharu.hideout.core.application.model.Instance { + return Instance( + instance.id.instanceId, + instance.name.name, + instance.url, + instance.description.description + ) + } + } +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/MediaDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/MediaDetail.kt similarity index 55% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/MediaDetail.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/MediaDetail.kt index e29dac77..a6f6eaa7 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/MediaDetail.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/MediaDetail.kt @@ -1,4 +1,20 @@ -package dev.usbharu.hideout.core.application.post +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dev.usbharu.hideout.core.application.model import dev.usbharu.hideout.core.domain.model.media.Media import java.net.URI diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/PostDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/PostDetail.kt similarity index 73% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/PostDetail.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/PostDetail.kt index 67dd9d96..eb7bc3dc 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/PostDetail.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/PostDetail.kt @@ -1,6 +1,21 @@ -package dev.usbharu.hideout.core.application.post +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dev.usbharu.hideout.core.application.model -import dev.usbharu.hideout.core.application.model.Reactions import dev.usbharu.hideout.core.domain.model.actor.Actor import dev.usbharu.hideout.core.domain.model.media.Media import dev.usbharu.hideout.core.domain.model.post.Post @@ -43,7 +58,7 @@ data class PostDetail( ): PostDetail { return PostDetail( id = post.id.id, - actor = ActorDetail.of(actor, iconMedia), + actor = ActorDetail.of(actor, iconMedia, null), overview = post.overview?.overview, text = post.text, content = post.content.content, diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Reactions.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Reactions.kt index 808f763a..91dfffc6 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Reactions.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Reactions.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.model import dev.usbharu.hideout.core.domain.model.emoji.CustomEmoji diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/get/Relationship.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Relationship.kt similarity index 93% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/get/Relationship.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Relationship.kt index 03237ef4..9bd6e474 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/get/Relationship.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Relationship.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.get +package dev.usbharu.hideout.core.application.model import dev.usbharu.hideout.core.domain.model.actorinstancerelationship.ActorInstanceRelationship import dev.usbharu.hideout.core.domain.model.relationship.Relationship @@ -38,7 +38,7 @@ data class Relationship( relationship: Relationship, relationship2: Relationship, actorInstanceRelationship: ActorInstanceRelationship, - ): dev.usbharu.hideout.core.application.relationship.get.Relationship { + ): dev.usbharu.hideout.core.application.model.Relationship { return Relationship( actorId = relationship.actorId.id, targetId = relationship.targetActorId.id, diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Timeline.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Timeline.kt index 8abc559a..66d5837f 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Timeline.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/Timeline.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.model import dev.usbharu.hideout.core.domain.model.timeline.TimelineVisibility diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/UserDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/UserDetail.kt similarity index 95% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/UserDetail.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/UserDetail.kt index 5b363296..bdf49fb6 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/UserDetail.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/model/UserDetail.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.actor +package dev.usbharu.hideout.core.application.model import dev.usbharu.hideout.core.domain.model.actor.Actor import dev.usbharu.hideout.core.domain.model.emoji.CustomEmoji @@ -45,7 +45,7 @@ data class UserDetail( actor: Actor, userDetail: UserDetail, customEmojis: List, - ): dev.usbharu.hideout.core.application.actor.UserDetail { + ): dev.usbharu.hideout.core.application.model.UserDetail { return UserDetail( id = actor.id.id, userDetailId = userDetail.id.id, diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/ActorDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/ActorDetail.kt deleted file mode 100644 index 7ef57687..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/ActorDetail.kt +++ /dev/null @@ -1,31 +0,0 @@ -package dev.usbharu.hideout.core.application.post - -import dev.usbharu.hideout.core.domain.model.actor.Actor -import dev.usbharu.hideout.core.domain.model.media.Media -import java.net.URI - -data class ActorDetail( - val actorId: Long, - val instanceId: Long, - val name: String, - val domain: String, - val screenName: String, - val url: URI, - val locked: Boolean, - val icon: URI?, -) { - companion object { - fun of(actor: Actor, iconMedia: Media?): ActorDetail { - return ActorDetail( - actorId = actor.id.id, - instanceId = actor.instance.instanceId, - name = actor.name.name, - domain = actor.domain.domain, - screenName = actor.screenName.screenName, - url = actor.url, - locked = actor.locked, - icon = iconMedia?.url - ) - } - } -} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/DeleteLocalPost.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/DeleteLocalPost.kt deleted file mode 100644 index 83da8dd1..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/DeleteLocalPost.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.usbharu.hideout.core.application.post - -data class DeleteLocalPost(val postId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/DeleteLocalPostApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/DeleteLocalPostApplicationService.kt index 48441863..140fa38c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/DeleteLocalPostApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/DeleteLocalPostApplicationService.kt @@ -50,3 +50,5 @@ class DeleteLocalPostApplicationService( private val logger = LoggerFactory.getLogger(DeleteLocalPostApplicationService::class.java) } } + +data class DeleteLocalPost(val postId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPost.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPost.kt deleted file mode 100644 index 90ef8560..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPost.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.post - -data class GetPost( - val postId: Long, -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPostApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPostApplicationService.kt deleted file mode 100644 index 6e1f0006..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPostApplicationService.kt +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.post - -import dev.usbharu.hideout.core.application.exception.PermissionDeniedException -import dev.usbharu.hideout.core.application.shared.AbstractApplicationService -import dev.usbharu.hideout.core.application.shared.Transaction -import dev.usbharu.hideout.core.domain.model.post.PostId -import dev.usbharu.hideout.core.domain.model.post.PostRepository -import dev.usbharu.hideout.core.domain.model.support.principal.Principal -import dev.usbharu.hideout.core.domain.service.post.IPostReadAccessControl -import org.slf4j.LoggerFactory -import org.springframework.stereotype.Service - -@Service -class GetPostApplicationService( - private val postRepository: PostRepository, - private val iPostReadAccessControl: IPostReadAccessControl, - transaction: Transaction -) : - AbstractApplicationService(transaction, logger) { - - override suspend fun internalExecute(command: GetPost, principal: Principal): Post { - val post = postRepository.findById(PostId(command.postId)) ?: throw IllegalArgumentException("Post not found") - if (iPostReadAccessControl.isAllow(post, principal).not()) { - throw PermissionDeniedException() - } - return Post.of(post) - } - - companion object { - private val logger = LoggerFactory.getLogger(GetPostApplicationService::class.java) - } -} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPostDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPostDetail.kt deleted file mode 100644 index 796e167b..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPostDetail.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.usbharu.hideout.core.application.post - -data class GetPostDetail(val postId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPostDetailApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPostDetailApplicationService.kt index 89dd080e..9fa9ff75 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPostDetailApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/GetPostDetailApplicationService.kt @@ -1,6 +1,23 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.post import dev.usbharu.hideout.core.application.exception.InternalServerException +import dev.usbharu.hideout.core.application.model.PostDetail import dev.usbharu.hideout.core.application.shared.AbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.Actor @@ -97,3 +114,5 @@ class GetPostDetailApplicationService( private val logger = LoggerFactory.getLogger(GetPostDetailApplicationService::class.java) } } + +data class GetPostDetail(val postId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/Post.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/Post.kt deleted file mode 100644 index 2ed11666..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/Post.kt +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.post - -import dev.usbharu.hideout.core.domain.model.post.Post -import dev.usbharu.hideout.core.domain.model.post.Visibility -import java.net.URI -import java.time.Instant - -data class Post( - val id: Long, - val actorId: Long, - val overview: String?, - val text: String, - val content: String, - val createdAt: Instant, - val visibility: Visibility, - val url: URI, - val repostId: Long?, - val replyId: Long?, - val sensitive: Boolean, - val mediaIds: List, - val moveTo: Long?, -) { - companion object { - fun of(post: Post): dev.usbharu.hideout.core.application.post.Post { - return Post( - id = post.id.id, - actorId = post.actorId.id, - overview = post.overview?.overview, - text = post.text, - content = post.content.content, - createdAt = post.createdAt, - visibility = post.visibility, - url = post.url, - repostId = post.repostId?.id, - replyId = post.replyId?.id, - sensitive = post.sensitive, - mediaIds = post.mediaIds.map { it.id }, - moveTo = post.moveTo?.id - ) - } - } -} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/RegisterLocalPost.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/RegisterLocalPost.kt deleted file mode 100644 index b5fd2f71..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/RegisterLocalPost.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.post - -import dev.usbharu.hideout.core.domain.model.post.Visibility - -data class RegisterLocalPost( - val content: String, - val overview: String?, - val visibility: Visibility, - val repostId: Long?, - val replyId: Long?, - val sensitive: Boolean, - val mediaIds: List, -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/RegisterLocalPostApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/RegisterLocalPostApplicationService.kt index ad950c66..bf1f1af9 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/RegisterLocalPostApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/RegisterLocalPostApplicationService.kt @@ -24,6 +24,7 @@ import dev.usbharu.hideout.core.domain.model.media.MediaId import dev.usbharu.hideout.core.domain.model.post.PostId import dev.usbharu.hideout.core.domain.model.post.PostOverview import dev.usbharu.hideout.core.domain.model.post.PostRepository +import dev.usbharu.hideout.core.domain.model.post.Visibility import dev.usbharu.hideout.core.domain.model.support.principal.LocalUser import dev.usbharu.hideout.core.infrastructure.factory.PostFactoryImpl import org.slf4j.Logger @@ -64,3 +65,13 @@ class RegisterLocalPostApplicationService( val logger: Logger = LoggerFactory.getLogger(RegisterLocalPostApplicationService::class.java) } } + +data class RegisterLocalPost( + val content: String, + val overview: String?, + val visibility: Visibility, + val repostId: Long?, + val replyId: Long?, + val sensitive: Boolean, + val mediaIds: List, +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/UpdateLocalNote.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/UpdateLocalNote.kt deleted file mode 100644 index 64ce9831..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/UpdateLocalNote.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.post - -data class UpdateLocalNote( - val postId: Long, - val overview: String?, - val content: String, - val sensitive: Boolean, - val mediaIds: List -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/UpdateLocalNoteApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/UpdateLocalNoteApplicationService.kt index 9c9b4003..2c320563 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/UpdateLocalNoteApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/post/UpdateLocalNoteApplicationService.kt @@ -64,3 +64,11 @@ class UpdateLocalNoteApplicationService( private val logger = LoggerFactory.getLogger(UpdateLocalNoteApplicationService::class.java) } } + +data class UpdateLocalNote( + val postId: Long, + val overview: String?, + val content: String, + val sensitive: Boolean, + val mediaIds: List +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/CreateReaction.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/CreateReaction.kt deleted file mode 100644 index 7d6f171b..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/CreateReaction.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.usbharu.hideout.core.application.reaction - -data class CreateReaction(val postId: Long, val customEmojiId: Long?, val unicodeEmoji: String) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/RemoveReaction.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/RemoveReaction.kt deleted file mode 100644 index 6a7dd7ff..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/RemoveReaction.kt +++ /dev/null @@ -1,7 +0,0 @@ -package dev.usbharu.hideout.core.application.reaction - -data class RemoveReaction( - val postId: Long, - val customEmojiId: Long?, - val unicodeEmoji: String -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/UserCreateReactionApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/UserCreateReactionApplicationService.kt index f0a7f2dd..d5e450a3 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/UserCreateReactionApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/UserCreateReactionApplicationService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.reaction import dev.usbharu.hideout.core.application.exception.PermissionDeniedException @@ -63,3 +79,5 @@ class UserCreateReactionApplicationService( private val logger = LoggerFactory.getLogger(UserCreateReactionApplicationService::class.java) } } + +data class CreateReaction(val postId: Long, val customEmojiId: Long?, val unicodeEmoji: String) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/UserRemoveReactionApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/UserRemoveReactionApplicationService.kt index 4335ee63..8337eb47 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/UserRemoveReactionApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/reaction/UserRemoveReactionApplicationService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.reaction import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService @@ -49,3 +65,9 @@ class UserRemoveReactionApplicationService( private val logger = LoggerFactory.getLogger(UserRemoveReactionApplicationService::class.java) } } + +data class RemoveReaction( + val postId: Long, + val customEmojiId: Long?, + val unicodeEmoji: String +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/get/GetRelationshipApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/GetRelationshipApplicationService.kt similarity index 94% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/get/GetRelationshipApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/GetRelationshipApplicationService.kt index bbecd56d..95531df1 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/get/GetRelationshipApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/GetRelationshipApplicationService.kt @@ -14,9 +14,10 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.get +package dev.usbharu.hideout.core.application.relationship import dev.usbharu.hideout.core.application.exception.InternalServerException +import dev.usbharu.hideout.core.application.model.Relationship import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -69,3 +70,5 @@ class GetRelationshipApplicationService( private val logger = LoggerFactory.getLogger(GetRelationshipApplicationService::class.java) } } + +data class GetRelationship(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/acceptfollowrequest/UserAcceptFollowRequestApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserAcceptFollowRequestApplicationService.kt similarity index 92% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/acceptfollowrequest/UserAcceptFollowRequestApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserAcceptFollowRequestApplicationService.kt index 2ec51b4b..771e4722 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/acceptfollowrequest/UserAcceptFollowRequestApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserAcceptFollowRequestApplicationService.kt @@ -14,10 +14,9 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.acceptfollowrequest +package dev.usbharu.hideout.core.application.relationship import dev.usbharu.hideout.core.application.exception.InternalServerException -import dev.usbharu.hideout.core.application.relationship.block.UserBlockApplicationService import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -52,3 +51,5 @@ class UserAcceptFollowRequestApplicationService( private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java) } } + +data class AcceptFollowRequest(val sourceActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/block/UserBlockApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserBlockApplicationService.kt similarity index 96% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/block/UserBlockApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserBlockApplicationService.kt index 0dd1e686..219dafab 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/block/UserBlockApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserBlockApplicationService.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.block +package dev.usbharu.hideout.core.application.relationship import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction @@ -61,3 +61,5 @@ class UserBlockApplicationService( private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java) } } + +data class Block(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/followrequest/UserFollowRequestApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserFollowRequestApplicationService.kt similarity index 95% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/followrequest/UserFollowRequestApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserFollowRequestApplicationService.kt index e277f786..0e31b34b 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/followrequest/UserFollowRequestApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserFollowRequestApplicationService.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.followrequest +package dev.usbharu.hideout.core.application.relationship import dev.usbharu.hideout.core.application.exception.InternalServerException import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService @@ -56,3 +56,5 @@ class UserFollowRequestApplicationService( private val logger = LoggerFactory.getLogger(UserFollowRequestApplicationService::class.java) } } + +data class FollowRequest(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/mute/UserMuteApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserMuteApplicationService.kt similarity index 93% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/mute/UserMuteApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserMuteApplicationService.kt index 537e4f1d..b3420662 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/mute/UserMuteApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserMuteApplicationService.kt @@ -14,10 +14,9 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.mute +package dev.usbharu.hideout.core.application.relationship import dev.usbharu.hideout.core.application.exception.InternalServerException -import dev.usbharu.hideout.core.application.relationship.block.UserBlockApplicationService import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -54,3 +53,5 @@ class UserMuteApplicationService( private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java) } } + +data class Mute(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/rejectfollowrequest/UserRejectFollowRequestApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserRejectFollowRequestApplicationService.kt similarity index 92% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/rejectfollowrequest/UserRejectFollowRequestApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserRejectFollowRequestApplicationService.kt index acc01ebe..4f385de4 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/rejectfollowrequest/UserRejectFollowRequestApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserRejectFollowRequestApplicationService.kt @@ -14,10 +14,9 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.rejectfollowrequest +package dev.usbharu.hideout.core.application.relationship import dev.usbharu.hideout.core.application.exception.InternalServerException -import dev.usbharu.hideout.core.application.relationship.block.UserBlockApplicationService import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -52,3 +51,5 @@ class UserRejectFollowRequestApplicationService( private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java) } } + +data class RejectFollowRequest(val sourceActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/removefromfollowers/UserRemoveFromFollowersApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserRemoveFromFollowersApplicationService.kt similarity index 92% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/removefromfollowers/UserRemoveFromFollowersApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserRemoveFromFollowersApplicationService.kt index adce9c61..ea8dd677 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/removefromfollowers/UserRemoveFromFollowersApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserRemoveFromFollowersApplicationService.kt @@ -14,10 +14,9 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.removefromfollowers +package dev.usbharu.hideout.core.application.relationship import dev.usbharu.hideout.core.application.exception.InternalServerException -import dev.usbharu.hideout.core.application.relationship.block.UserBlockApplicationService import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -54,3 +53,5 @@ class UserRemoveFromFollowersApplicationService( private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java) } } + +data class RemoveFromFollowers(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unblock/UserUnblockApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserUnblockApplicationService.kt similarity index 93% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unblock/UserUnblockApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserUnblockApplicationService.kt index 1e0e8d38..60ac97c9 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unblock/UserUnblockApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserUnblockApplicationService.kt @@ -14,10 +14,9 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.unblock +package dev.usbharu.hideout.core.application.relationship import dev.usbharu.hideout.core.application.exception.InternalServerException -import dev.usbharu.hideout.core.application.relationship.block.UserBlockApplicationService import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -54,3 +53,5 @@ class UserUnblockApplicationService( private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java) } } + +data class Unblock(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unfollow/UserUnfollowApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserUnfollowApplicationService.kt similarity index 93% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unfollow/UserUnfollowApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserUnfollowApplicationService.kt index e747fda8..51fd1085 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unfollow/UserUnfollowApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserUnfollowApplicationService.kt @@ -14,10 +14,9 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.unfollow +package dev.usbharu.hideout.core.application.relationship import dev.usbharu.hideout.core.application.exception.InternalServerException -import dev.usbharu.hideout.core.application.relationship.block.UserBlockApplicationService import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -54,3 +53,5 @@ class UserUnfollowApplicationService( private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java) } } + +data class Unfollow(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unmute/UserUnmuteApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserUnmuteApplicationService.kt similarity index 93% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unmute/UserUnmuteApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserUnmuteApplicationService.kt index 39b20e19..41438c86 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unmute/UserUnmuteApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/UserUnmuteApplicationService.kt @@ -14,10 +14,9 @@ * limitations under the License. */ -package dev.usbharu.hideout.core.application.relationship.unmute +package dev.usbharu.hideout.core.application.relationship import dev.usbharu.hideout.core.application.exception.InternalServerException -import dev.usbharu.hideout.core.application.relationship.block.UserBlockApplicationService import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -54,3 +53,5 @@ class UserUnmuteApplicationService( private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java) } } + +data class Unmute(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/acceptfollowrequest/AcceptFollowRequest.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/acceptfollowrequest/AcceptFollowRequest.kt deleted file mode 100644 index 6c0d9f20..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/acceptfollowrequest/AcceptFollowRequest.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.relationship.acceptfollowrequest - -data class AcceptFollowRequest(val sourceActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/block/Block.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/block/Block.kt deleted file mode 100644 index 7a095b92..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/block/Block.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.relationship.block - -data class Block(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/followrequest/FollowRequest.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/followrequest/FollowRequest.kt deleted file mode 100644 index 3f8de0a7..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/followrequest/FollowRequest.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.relationship.followrequest - -data class FollowRequest(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/get/GetRelationship.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/get/GetRelationship.kt deleted file mode 100644 index 90df1b82..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/get/GetRelationship.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.relationship.get - -data class GetRelationship(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/mute/Mute.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/mute/Mute.kt deleted file mode 100644 index 79a56830..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/mute/Mute.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.relationship.mute - -data class Mute(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/rejectfollowrequest/RejectFollowRequest.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/rejectfollowrequest/RejectFollowRequest.kt deleted file mode 100644 index 4662eff1..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/rejectfollowrequest/RejectFollowRequest.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.relationship.rejectfollowrequest - -data class RejectFollowRequest(val sourceActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/removefromfollowers/RemoveFromFollowers.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/removefromfollowers/RemoveFromFollowers.kt deleted file mode 100644 index f9642099..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/removefromfollowers/RemoveFromFollowers.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.relationship.removefromfollowers - -data class RemoveFromFollowers(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unblock/Unblock.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unblock/Unblock.kt deleted file mode 100644 index 7b85c603..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unblock/Unblock.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.relationship.unblock - -data class Unblock(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unfollow/Unfollow.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unfollow/Unfollow.kt deleted file mode 100644 index 60190dab..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unfollow/Unfollow.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.relationship.unfollow - -data class Unfollow(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unmute/Unmute.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unmute/Unmute.kt deleted file mode 100644 index 1939ee25..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/unmute/Unmute.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 usbharu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.usbharu.hideout.core.application.relationship.unmute - -data class Unmute(val targetActorId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/shared/LocalUserAbstractApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/shared/LocalUserAbstractApplicationService.kt index bd8d26a3..1a91ebe1 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/shared/LocalUserAbstractApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/shared/LocalUserAbstractApplicationService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.shared import dev.usbharu.hideout.core.application.exception.PermissionDeniedException diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/AddPost.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/AddPost.kt deleted file mode 100644 index bae9fc85..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/AddPost.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.usbharu.hideout.core.application.timeline - -import dev.usbharu.hideout.core.domain.model.post.PostId - -data class AddPost(val postId: PostId) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/AddTimelineRelationship.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/AddTimelineRelationship.kt deleted file mode 100644 index 21684dda..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/AddTimelineRelationship.kt +++ /dev/null @@ -1,11 +0,0 @@ -package dev.usbharu.hideout.core.application.timeline - -import dev.usbharu.hideout.core.domain.model.actor.ActorId -import dev.usbharu.hideout.core.domain.model.timeline.TimelineId -import dev.usbharu.hideout.core.domain.model.timelinerelationship.Visible - -data class AddTimelineRelationship( - val timelineId: TimelineId, - val actorId: ActorId, - val visible: Visible -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetTimelines.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetTimelines.kt deleted file mode 100644 index a4233829..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetTimelines.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.usbharu.hideout.core.application.timeline - -data class GetTimelines(val userDetailId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimeline.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimeline.kt deleted file mode 100644 index 8ebc7d15..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimeline.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.usbharu.hideout.core.application.timeline - -import dev.usbharu.hideout.core.domain.model.support.page.Page - -data class GetUserTimeline(val id: Long, val page: Page) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimelineApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimelineApplicationService.kt index 0d85511c..6e94b7e1 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimelineApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimelineApplicationService.kt @@ -1,12 +1,29 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.timeline -import dev.usbharu.hideout.core.application.post.PostDetail +import dev.usbharu.hideout.core.application.model.PostDetail import dev.usbharu.hideout.core.application.shared.AbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.actor.ActorId import dev.usbharu.hideout.core.domain.model.post.PostId import dev.usbharu.hideout.core.domain.model.post.PostRepository import dev.usbharu.hideout.core.domain.model.post.Visibility +import dev.usbharu.hideout.core.domain.model.support.page.Page import dev.usbharu.hideout.core.domain.model.support.page.PaginationList import dev.usbharu.hideout.core.domain.model.support.principal.Principal import dev.usbharu.hideout.core.query.usertimeline.UserTimelineQueryService @@ -51,3 +68,5 @@ class GetUserTimelineApplicationService( private val logger = LoggerFactory.getLogger(GetUserTimelineApplicationService::class.java) } } + +data class GetUserTimeline(val id: Long, val page: Page) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimeline.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimeline.kt deleted file mode 100644 index 40e11367..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimeline.kt +++ /dev/null @@ -1,11 +0,0 @@ -package dev.usbharu.hideout.core.application.timeline - -import dev.usbharu.hideout.core.domain.model.support.page.Page - -data class ReadTimeline( - val timelineId: Long, - val mediaOnly: Boolean, - val localOnly: Boolean, - val remoteOnly: Boolean, - val page: Page -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimelineApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimelineApplicationService.kt index 53c18e48..4ba3e2a1 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimelineApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimelineApplicationService.kt @@ -1,9 +1,26 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.timeline -import dev.usbharu.hideout.core.application.post.PostDetail +import dev.usbharu.hideout.core.application.model.PostDetail import dev.usbharu.hideout.core.application.shared.AbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.post.PostId +import dev.usbharu.hideout.core.domain.model.support.page.Page import dev.usbharu.hideout.core.domain.model.support.page.PaginationList import dev.usbharu.hideout.core.domain.model.support.principal.Principal import dev.usbharu.hideout.core.domain.model.timeline.TimelineId @@ -88,3 +105,11 @@ class ReadTimelineApplicationService( private val logger = LoggerFactory.getLogger(ReadTimelineApplicationService::class.java) } } + +data class ReadTimeline( + val timelineId: Long, + val mediaOnly: Boolean, + val localOnly: Boolean, + val remoteOnly: Boolean, + val page: Page +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/RegisterTimeline.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/RegisterTimeline.kt deleted file mode 100644 index 4283e651..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/RegisterTimeline.kt +++ /dev/null @@ -1,8 +0,0 @@ -package dev.usbharu.hideout.core.application.timeline - -import dev.usbharu.hideout.core.domain.model.timeline.TimelineVisibility - -data class RegisterTimeline( - val timelineName: String, - val visibility: TimelineVisibility -) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/RemoveTimelineRelationship.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/RemoveTimelineRelationship.kt deleted file mode 100644 index 5565ca22..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/RemoveTimelineRelationship.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.usbharu.hideout.core.application.timeline - -import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationshipId - -data class RemoveTimelineRelationship(val timelineRelationshipId: TimelineRelationshipId) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimelineToTimelineStoreApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimelineToTimelineStoreApplicationService.kt index 139b6b55..3d05fe7e 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimelineToTimelineStoreApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimelineToTimelineStoreApplicationService.kt @@ -1,8 +1,25 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.timeline import dev.usbharu.hideout.core.application.shared.AbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.support.principal.Principal +import dev.usbharu.hideout.core.domain.model.timeline.TimelineId import dev.usbharu.hideout.core.domain.model.timeline.TimelineRepository import dev.usbharu.hideout.core.external.timeline.TimelineStore import org.slf4j.LoggerFactory @@ -28,3 +45,5 @@ class SetTimelineToTimelineStoreApplicationService( private val logger = LoggerFactory.getLogger(SetTimelineToTimelineStoreApplicationService::class.java) } } + +data class SetTimleineStore(val timelineId: TimelineId) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimleineStore.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimleineStore.kt deleted file mode 100644 index a2257489..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimleineStore.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.usbharu.hideout.core.application.timeline - -import dev.usbharu.hideout.core.domain.model.timeline.TimelineId - -data class SetTimleineStore(val timelineId: TimelineId) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/TimelineAddPostApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/TimelineAddPostApplicationService.kt index c00b54ef..f1f1c33c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/TimelineAddPostApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/TimelineAddPostApplicationService.kt @@ -1,7 +1,24 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.timeline import dev.usbharu.hideout.core.application.shared.AbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction +import dev.usbharu.hideout.core.domain.model.post.PostId import dev.usbharu.hideout.core.domain.model.post.PostRepository import dev.usbharu.hideout.core.domain.model.support.principal.Principal import dev.usbharu.hideout.core.external.timeline.TimelineStore @@ -27,3 +44,5 @@ class TimelineAddPostApplicationService( private val logger = LoggerFactory.getLogger(TimelineAddPostApplicationService::class.java) } } + +data class AddPost(val postId: PostId) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserAddTimelineRelationshipApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserAddTimelineRelationshipApplicationService.kt index d78f03b2..fe6260cb 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserAddTimelineRelationshipApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserAddTimelineRelationshipApplicationService.kt @@ -1,13 +1,32 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.timeline import dev.usbharu.hideout.core.application.exception.PermissionDeniedException import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction +import dev.usbharu.hideout.core.domain.model.actor.ActorId import dev.usbharu.hideout.core.domain.model.support.principal.LocalUser +import dev.usbharu.hideout.core.domain.model.timeline.TimelineId import dev.usbharu.hideout.core.domain.model.timeline.TimelineRepository import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationship import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationshipId import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationshipRepository +import dev.usbharu.hideout.core.domain.model.timelinerelationship.Visible import dev.usbharu.hideout.core.domain.shared.id.IdGenerateService import org.slf4j.LoggerFactory import org.springframework.stereotype.Service @@ -45,3 +64,9 @@ class UserAddTimelineRelationshipApplicationService( private val logger = LoggerFactory.getLogger(UserAddTimelineRelationshipApplicationService::class.java) } } + +data class AddTimelineRelationship( + val timelineId: TimelineId, + val actorId: ActorId, + val visible: Visible +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserGetTimelinesApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserGetTimelinesApplicationService.kt index 2ebced42..edb519d0 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserGetTimelinesApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserGetTimelinesApplicationService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.timeline import dev.usbharu.hideout.core.application.model.Timeline @@ -35,3 +51,5 @@ class UserGetTimelinesApplicationService(transaction: Transaction, private val t private val logger = LoggerFactory.getLogger(UserGetTimelinesApplicationService::class.java) } } + +data class GetTimelines(val userDetailId: Long) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/UserRegisterHomeTimelineApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterHomeTimelineApplicationService.kt similarity index 77% rename from hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/UserRegisterHomeTimelineApplicationService.kt rename to hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterHomeTimelineApplicationService.kt index 3caa2ec0..3c1c47d5 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/UserRegisterHomeTimelineApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterHomeTimelineApplicationService.kt @@ -1,5 +1,22 @@ -package dev.usbharu.hideout.core.application.domainevent.subscribers +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package dev.usbharu.hideout.core.application.timeline + +import dev.usbharu.hideout.core.application.domainevent.subscribers.RegisterHomeTimeline import dev.usbharu.hideout.core.application.shared.AbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.support.principal.Principal diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterTimelineApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterTimelineApplicationService.kt index 5b0af07c..eb7c5e83 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterTimelineApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterTimelineApplicationService.kt @@ -1,12 +1,25 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.timeline import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationService import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.support.principal.LocalUser -import dev.usbharu.hideout.core.domain.model.timeline.Timeline -import dev.usbharu.hideout.core.domain.model.timeline.TimelineId -import dev.usbharu.hideout.core.domain.model.timeline.TimelineName -import dev.usbharu.hideout.core.domain.model.timeline.TimelineRepository +import dev.usbharu.hideout.core.domain.model.timeline.* import dev.usbharu.hideout.core.domain.shared.id.IdGenerateService import org.slf4j.LoggerFactory import org.springframework.stereotype.Component @@ -35,3 +48,8 @@ class UserRegisterTimelineApplicationService( private val logger = LoggerFactory.getLogger(UserRegisterTimelineApplicationService::class.java) } } + +data class RegisterTimeline( + val timelineName: String, + val visibility: TimelineVisibility +) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRemoveTimelineRelationshipApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRemoveTimelineRelationshipApplicationService.kt index ee2819bd..d7c22d65 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRemoveTimelineRelationshipApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRemoveTimelineRelationshipApplicationService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.application.timeline import dev.usbharu.hideout.core.application.exception.PermissionDeniedException @@ -5,6 +21,7 @@ import dev.usbharu.hideout.core.application.shared.LocalUserAbstractApplicationS import dev.usbharu.hideout.core.application.shared.Transaction import dev.usbharu.hideout.core.domain.model.support.principal.LocalUser import dev.usbharu.hideout.core.domain.model.timeline.TimelineRepository +import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationshipId import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationshipRepository import org.slf4j.LoggerFactory import org.springframework.stereotype.Service @@ -42,3 +59,5 @@ class UserRemoveTimelineRelationshipApplicationService( private val logger = LoggerFactory.getLogger(UserRemoveTimelineRelationshipApplicationService::class.java) } } + +data class RemoveTimelineRelationship(val timelineRelationshipId: TimelineRelationshipId) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/DefaultTimelineStoreConfig.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/DefaultTimelineStoreConfig.kt index a6db6b29..bac2288a 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/DefaultTimelineStoreConfig.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/DefaultTimelineStoreConfig.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.config import org.springframework.boot.context.properties.ConfigurationProperties diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FFmpegVideoConfig.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FFmpegVideoConfig.kt index 65e5f9be..80e2dacd 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FFmpegVideoConfig.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FFmpegVideoConfig.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.config import org.bytedeco.ffmpeg.global.avcodec diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FlywayConfig.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FlywayConfig.kt index 15133cdb..5d5fd052 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FlywayConfig.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FlywayConfig.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.config import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/ImageIOImageConfig.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/ImageIOImageConfig.kt index 03e8bfcc..c3a3baf5 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/ImageIOImageConfig.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/ImageIOImageConfig.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.config import org.springframework.boot.context.properties.ConfigurationProperties diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/LocalStorageConfig.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/LocalStorageConfig.kt index 48962c11..b38a0158 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/LocalStorageConfig.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/LocalStorageConfig.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.config import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/MessageSourceConfig.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/MessageSourceConfig.kt index dcfecd4b..73e2311c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/MessageSourceConfig.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/MessageSourceConfig.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.config import org.springframework.boot.autoconfigure.context.MessageSourceProperties diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/S3StorageConfig.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/S3StorageConfig.kt index 1a8b5677..8572e22d 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/S3StorageConfig.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/S3StorageConfig.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.config import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/reaction/ReactionEvent.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/reaction/ReactionEvent.kt index 6da7a58c..651b8497 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/reaction/ReactionEvent.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/reaction/ReactionEvent.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.event.reaction import dev.usbharu.hideout.core.domain.model.reaction.Reaction diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/timeline/TimelineEvent.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/timeline/TimelineEvent.kt index 76cc4554..b4f56789 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/timeline/TimelineEvent.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/timeline/TimelineEvent.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.event.timeline import dev.usbharu.hideout.core.domain.model.timeline.Timeline diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/userdetail/UserDetailEvent.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/userdetail/UserDetailEvent.kt index dc9f4481..f6aefa4b 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/userdetail/UserDetailEvent.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/userdetail/UserDetailEvent.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.event.userdetail import dev.usbharu.hideout.core.domain.model.userdetails.UserDetail diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/Filter.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/Filter.kt index 4267ddbe..43d18485 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/Filter.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/Filter.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter import dev.usbharu.hideout.core.domain.model.filter.Filter.Companion.Action.SET_KEYWORDS diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterAction.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterAction.kt index d19c8db8..d7df9789 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterAction.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterAction.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter enum class FilterAction { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterContext.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterContext.kt index df987e3d..d9541d46 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterContext.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterContext.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter enum class FilterContext { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterId.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterId.kt index a9ee5ce4..2174f62d 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterId.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterId.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter @JvmInline diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeyword.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeyword.kt index 6e5822fd..fb404f20 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeyword.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeyword.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter class FilterKeyword( diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeywordId.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeywordId.kt index 4f1b2df5..4db4d581 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeywordId.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeywordId.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter @JvmInline diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeywordKeyword.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeywordKeyword.kt index 89e959b3..032d8a4c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeywordKeyword.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeywordKeyword.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter @JvmInline diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterMode.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterMode.kt index 57e38fb7..10a20ec5 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterMode.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterMode.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter enum class FilterMode { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterName.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterName.kt index 2e517ceb..b88dbf71 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterName.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterName.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter class FilterName(name: String) { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterRepository.kt index 5c4d11ee..31b1cc40 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterResult.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterResult.kt index 478f05e5..7bd074c6 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterResult.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterResult.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter class FilterResult(val filter: Filter, val matchedKeyword: String) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilteredPost.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilteredPost.kt index 80226401..5d75f380 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilteredPost.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilteredPost.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.filter import dev.usbharu.hideout.core.domain.model.post.Post diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/followtimeline/FollowTimeline.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/followtimeline/FollowTimeline.kt index c5340618..463e4c32 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/followtimeline/FollowTimeline.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/followtimeline/FollowTimeline.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.followtimeline import dev.usbharu.hideout.core.domain.model.timeline.TimelineId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/followtimeline/FollowTimelineRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/followtimeline/FollowTimelineRepository.kt index 9c7bc104..92273f70 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/followtimeline/FollowTimelineRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/followtimeline/FollowTimelineRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.followtimeline interface FollowTimelineRepository { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/Reaction.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/Reaction.kt index fc40bc05..75883567 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/Reaction.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/Reaction.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.reaction import dev.usbharu.hideout.core.domain.event.reaction.ReactionEvent diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/ReactionId.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/ReactionId.kt index 948fb1ea..d7730bff 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/ReactionId.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/ReactionId.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.reaction @JvmInline diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/ReactionRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/ReactionRepository.kt index 508e2708..16dd2e8d 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/ReactionRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/reaction/ReactionRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.reaction import dev.usbharu.hideout.core.domain.model.actor.ActorId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/acct/Acct.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/acct/Acct.kt index 148e01ca..1926531a 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/acct/Acct.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/acct/Acct.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.support.acct data class Acct( diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/page/Page.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/page/Page.kt index 88ef63a5..a779b4ee 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/page/Page.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/page/Page.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.support.page sealed class Page { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/page/PaginationList.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/page/PaginationList.kt index 617ceecb..f7ff4560 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/page/PaginationList.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/page/PaginationList.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.support.page class PaginationList(list: List, val next: ID?, val prev: ID?) : List by list diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/postdetail/PostDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/postdetail/PostDetail.kt deleted file mode 100644 index 5126aa35..00000000 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/postdetail/PostDetail.kt +++ /dev/null @@ -1,22 +0,0 @@ -package dev.usbharu.hideout.core.domain.model.support.postdetail - -import dev.usbharu.hideout.core.domain.model.actor.Actor -import dev.usbharu.hideout.core.domain.model.post.Post - -data class PostDetail( - val post: Post, - val reply: Post? = null, - val repost: Post? = null, - val postActor: Actor, - val replyActor: Actor? = null, - val repostActor: Actor? = null -) { - init { - require(post.replyId == reply?.id) - require(post.repostId == repost?.id) - - require(post.actorId == postActor.id) - require(reply?.actorId == replyActor?.id) - require(repost?.actorId == repostActor?.id) - } -} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/Anonymous.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/Anonymous.kt index 56fbe4c5..015db749 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/Anonymous.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/Anonymous.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.support.principal import dev.usbharu.hideout.core.domain.model.actor.ActorId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/LocalUser.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/LocalUser.kt index a29abe6f..439dc4be 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/LocalUser.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/LocalUser.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.support.principal import dev.usbharu.hideout.core.domain.model.actor.ActorId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/Principal.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/Principal.kt index 1a0cf076..b1442350 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/Principal.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/Principal.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.support.principal import dev.usbharu.hideout.core.domain.model.actor.ActorId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/PrincipalContextHolder.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/PrincipalContextHolder.kt index 1bf8f653..59b59b7a 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/PrincipalContextHolder.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/principal/PrincipalContextHolder.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.support.principal interface PrincipalContextHolder { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/timelineobjectdetail/TimelineObjectDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/timelineobjectdetail/TimelineObjectDetail.kt index 43b0fa9f..3c70eeaf 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/timelineobjectdetail/TimelineObjectDetail.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/support/timelineobjectdetail/TimelineObjectDetail.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.support.timelineobjectdetail import dev.usbharu.hideout.core.application.model.Reactions diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/Timeline.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/Timeline.kt index ca513707..7cdc5831 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/Timeline.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/Timeline.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timeline import dev.usbharu.hideout.core.domain.event.timeline.TimelineEvent diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineId.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineId.kt index c93738d8..0622a99c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineId.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineId.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timeline @JvmInline diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineName.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineName.kt index a8dd2f87..b953f661 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineName.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineName.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timeline @JvmInline diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineRepository.kt index 93770f32..69834305 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timeline import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineVisibility.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineVisibility.kt index 506dd3af..dc6f7ccb 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineVisibility.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timeline/TimelineVisibility.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timeline enum class TimelineVisibility { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObject.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObject.kt index f7f57f22..4d9737e2 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObject.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObject.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timelineobject import dev.usbharu.hideout.core.domain.model.actor.ActorId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObjectId.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObjectId.kt index 95e24c40..9d77f4f3 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObjectId.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObjectId.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timelineobject @JvmInline diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObjectWarnFilter.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObjectWarnFilter.kt index bdd0764d..4441cc1b 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObjectWarnFilter.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObjectWarnFilter.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timelineobject import dev.usbharu.hideout.core.domain.model.filter.FilterId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationship.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationship.kt index 04bb6d25..125a7b40 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationship.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationship.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timelinerelationship import dev.usbharu.hideout.core.domain.model.actor.ActorId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationshipId.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationshipId.kt index 5de526a7..ba995260 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationshipId.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationshipId.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timelinerelationship @JvmInline diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationshipRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationshipRepository.kt index 5fd8f176..acc8ac05 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationshipRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelinerelationship/TimelineRelationshipRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.model.timelinerelationship import dev.usbharu.hideout.core.domain.model.actor.ActorId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/emoji/UnicodeEmojiService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/emoji/UnicodeEmojiService.kt index 35a44ca5..34a43117 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/emoji/UnicodeEmojiService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/emoji/UnicodeEmojiService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.service.emoji interface UnicodeEmojiService { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/filter/FilterDomainService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/filter/FilterDomainService.kt index 97ec2cfb..3e99e75c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/filter/FilterDomainService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/filter/FilterDomainService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.service.filter import dev.usbharu.hideout.core.domain.model.filter.Filter diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt index 0b82ee76..280bc9bb 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.service.post import dev.usbharu.hideout.core.domain.model.post.Post diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/shared/domainevent/DomainEventPublisher.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/shared/domainevent/DomainEventPublisher.kt index cf784458..1f0f21a1 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/shared/domainevent/DomainEventPublisher.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/shared/domainevent/DomainEventPublisher.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.shared.domainevent interface DomainEventPublisher { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/shared/repository/DomainEventPublishableRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/shared/repository/DomainEventPublishableRepository.kt index 3b385984..42c7c228 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/shared/repository/DomainEventPublishableRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/shared/repository/DomainEventPublishableRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.domain.shared.repository import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventPublisher diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/DelegateMediaProcessor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/DelegateMediaProcessor.kt index 65cbc14d..fb1650b1 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/DelegateMediaProcessor.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/DelegateMediaProcessor.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.external.media import dev.usbharu.hideout.core.domain.model.media.MimeType diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/FileTypeDeterminer.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/FileTypeDeterminer.kt index 83270bb6..d7edad0a 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/FileTypeDeterminer.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/FileTypeDeterminer.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.external.media import dev.usbharu.hideout.core.domain.model.media.MimeType diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/TikaFileTypeDeterminer.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/TikaFileTypeDeterminer.kt index 393798b7..8fcb4f07 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/TikaFileTypeDeterminer.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/media/TikaFileTypeDeterminer.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.external.media import dev.usbharu.hideout.core.domain.model.media.FileType diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/mediastore/MediaStore.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/mediastore/MediaStore.kt index d2ee30d1..1390ce79 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/mediastore/MediaStore.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/mediastore/MediaStore.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.external.mediastore import java.net.URI diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/timeline/ReadTimelineOption.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/timeline/ReadTimelineOption.kt index 5cee660f..c0318fc4 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/timeline/ReadTimelineOption.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/timeline/ReadTimelineOption.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.external.timeline data class ReadTimelineOption( diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/timeline/TimelineStore.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/timeline/TimelineStore.kt index 23db5074..f5cfe519 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/timeline/TimelineStore.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/external/timeline/TimelineStore.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.external.timeline import dev.usbharu.hideout.core.domain.model.post.Post diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/awss3/AWSS3MediaStore.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/awss3/AWSS3MediaStore.kt index 47e30858..042a6a59 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/awss3/AWSS3MediaStore.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/awss3/AWSS3MediaStore.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.awss3 import dev.usbharu.hideout.core.config.S3StorageConfig diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/emojikt/EmojiKtUnicodeEmojiService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/emojikt/EmojiKtUnicodeEmojiService.kt index afa9c6b9..9e233739 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/emojikt/EmojiKtUnicodeEmojiService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/emojikt/EmojiKtUnicodeEmojiService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.emojikt import Emojis diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposed/UriColumnType.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposed/UriColumnType.kt index 06f2388b..f1c973e4 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposed/UriColumnType.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposed/UriColumnType.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.exposed import org.jetbrains.exposed.sql.Column diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedPrincipalQueryService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedPrincipalQueryService.kt index 2c48e636..d02ce503 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedPrincipalQueryService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedPrincipalQueryService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.exposedquery import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -13,9 +29,7 @@ import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @Repository -class ExposedPrincipalQueryService : PrincipalQueryService, AbstractRepository() { - override val logger: Logger - get() = Companion.logger +class ExposedPrincipalQueryService : PrincipalQueryService, AbstractRepository(logger) { override suspend fun findByUserDetailId(userDetailId: UserDetailId): PrincipalDTO { return query { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedReactionsQueryService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedReactionsQueryService.kt index 4fa8cfed..a03d1df9 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedReactionsQueryService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedReactionsQueryService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.exposedquery import dev.usbharu.hideout.core.application.model.Reactions @@ -9,16 +25,13 @@ import dev.usbharu.hideout.core.infrastructure.exposedrepository.toCustomEmojiOr import dev.usbharu.hideout.core.infrastructure.exposedrepository.toReaction import dev.usbharu.hideout.core.query.reactions.ReactionsQueryService import org.jetbrains.exposed.sql.* -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository import java.net.URI import dev.usbharu.hideout.core.infrastructure.exposedrepository.Reactions as ExposedrepositoryReactions @Repository -class ExposedReactionsQueryService : ReactionsQueryService, AbstractRepository() { - override val logger: Logger - get() = Companion.logger +class ExposedReactionsQueryService : ReactionsQueryService, AbstractRepository(logger) { override suspend fun findAllByPostId(postId: PostId): List { return query { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt index f63a2e53..bc4c291d 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt @@ -1,25 +1,36 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.exposedquery -import dev.usbharu.hideout.core.application.post.ActorDetail -import dev.usbharu.hideout.core.application.post.MediaDetail -import dev.usbharu.hideout.core.application.post.PostDetail +import dev.usbharu.hideout.core.application.model.ActorDetail +import dev.usbharu.hideout.core.application.model.MediaDetail +import dev.usbharu.hideout.core.application.model.PostDetail import dev.usbharu.hideout.core.domain.model.post.PostId import dev.usbharu.hideout.core.domain.model.post.Visibility import dev.usbharu.hideout.core.domain.model.support.principal.Principal import dev.usbharu.hideout.core.infrastructure.exposedrepository.* import dev.usbharu.hideout.core.query.usertimeline.UserTimelineQueryService import org.jetbrains.exposed.sql.* -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository import java.net.URI @Repository -class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractRepository() { - - override val logger: Logger - get() = Companion.logger - +class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractRepository(logger) { protected fun authorizedQuery(principal: Principal? = null): QueryAlias { if (principal == null) { return Posts @@ -56,15 +67,15 @@ class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractReposi val iconMedia = Media.alias("ICON_MEDIA") return authorizedQuery - .leftJoin(PostsVisibleActors, { authorizedQuery[Posts.id] }, { PostsVisibleActors.postId }) - .leftJoin(Actors, { authorizedQuery[Posts.actorId] }, { Actors.id }) + .leftJoin(PostsVisibleActors, { authorizedQuery[Posts.id] }, { postId }) + .leftJoin(Actors, { authorizedQuery[Posts.actorId] }, { id }) .leftJoin(iconMedia, { Actors.icon }, { iconMedia[Media.id] }) - .leftJoin(PostsMedia, { authorizedQuery[Posts.id] }, { PostsMedia.postId }) - .leftJoin(Media, { PostsMedia.mediaId }, { Media.id }) + .leftJoin(PostsMedia, { authorizedQuery[Posts.id] }, { postId }) + .leftJoin(Media, { PostsMedia.mediaId }, { id }) .leftJoin( Reactions, { authorizedQuery[Posts.id] }, - { Reactions.postId }, + { postId }, { Reactions.id isDistinctFrom principal.actorId.id } ) .selectAll() @@ -85,14 +96,19 @@ class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractReposi return PostDetail( id = it[authorizedQuery[Posts.id]], actor = ActorDetail( - actorId = it[authorizedQuery[Posts.actorId]], + id = it[authorizedQuery[Posts.actorId]], instanceId = it[Actors.instance], name = it[Actors.name], - domain = it[Actors.domain], + host = it[Actors.domain], screenName = it[Actors.screenName], - url = it[Actors.url], + remoteUrl = it[Actors.url], locked = it[Actors.locked], - icon = it.getOrNull(iconMedia[Media.url]) + iconUrl = it.getOrNull(iconMedia[Media.url]), + description = it[Actors.description], + postsCount = it[Actors.postsCount], + bannerURL = null, + followingCount = it[Actors.followingCount], + followersCount = it[Actors.followersCount], ), overview = it[authorizedQuery[Posts.overview]], text = it[authorizedQuery[Posts.text]], diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/AbstractRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/AbstractRepository.kt index 6a746eea..9b04ca18 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/AbstractRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/AbstractRepository.kt @@ -28,8 +28,7 @@ import org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator import java.sql.SQLException @Suppress("VarCouldBeVal") -abstract class AbstractRepository { - protected abstract val logger: Logger +abstract class AbstractRepository(protected val logger: Logger) { private val sqlErrorCodeSQLExceptionTranslator = SQLErrorCodeSQLExceptionTranslator() private val springDataAccessExceptionSQLExceptionTranslator = SpringDataAccessExceptionSQLExceptionTranslator() diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt index 74c71f07..967fcc02 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt @@ -24,17 +24,14 @@ import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventPublisher import dev.usbharu.hideout.core.domain.shared.repository.DomainEventPublishableRepository import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @Repository class ExposedActorInstanceRelationshipRepository(override val domainEventPublisher: DomainEventPublisher) : ActorInstanceRelationshipRepository, - AbstractRepository(), + AbstractRepository(logger), DomainEventPublishableRepository { - override val logger: Logger - get() = Companion.logger override suspend fun save(actorInstanceRelationship: ActorInstanceRelationship): ActorInstanceRelationship { query { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorRepository.kt index 821d4f73..e2bfe315 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.exposedrepository import dev.usbharu.hideout.core.domain.model.actor.* @@ -9,7 +25,6 @@ import dev.usbharu.hideout.core.infrastructure.exposed.uri import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.javatime.timestamp -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @@ -17,11 +32,9 @@ import org.springframework.stereotype.Repository class ExposedActorRepository( private val actorQueryMapper: QueryMapper, override val domainEventPublisher: DomainEventPublisher, -) : AbstractRepository(), +) : AbstractRepository(logger), DomainEventPublishableRepository, ActorRepository { - override val logger: Logger - get() = Companion.logger override suspend fun save(actor: Actor): Actor { query { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedApplicationRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedApplicationRepository.kt index 42d5c460..7cc57f20 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedApplicationRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedApplicationRepository.kt @@ -22,14 +22,11 @@ import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.Table import org.jetbrains.exposed.sql.deleteWhere import org.jetbrains.exposed.sql.upsert -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @Repository -class ExposedApplicationRepository : ApplicationRepository, AbstractRepository() { - override val logger: Logger - get() = Companion.logger +class ExposedApplicationRepository : ApplicationRepository, AbstractRepository(logger) { override suspend fun save(application: Application) = query { Applications.upsert { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedCustomEmojiRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedCustomEmojiRepository.kt index 7f1a0b50..63e5312a 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedCustomEmojiRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedCustomEmojiRepository.kt @@ -25,15 +25,12 @@ import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.javatime.CurrentTimestamp import org.jetbrains.exposed.sql.javatime.timestamp -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository import java.net.URI @Repository -class ExposedCustomEmojiRepository : CustomEmojiRepository, AbstractRepository() { - override val logger: Logger - get() = Companion.logger +class ExposedCustomEmojiRepository : CustomEmojiRepository, AbstractRepository(logger) { override suspend fun save(customEmoji: CustomEmoji): CustomEmoji = query { CustomEmojis.upsert { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedFilterRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedFilterRepository.kt index 837ccee9..208ef9d3 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedFilterRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedFilterRepository.kt @@ -24,15 +24,12 @@ import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId import dev.usbharu.hideout.core.infrastructure.exposed.QueryMapper import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @Repository class ExposedFilterRepository(private val filterQueryMapper: QueryMapper) : FilterRepository, - AbstractRepository() { - override val logger: Logger - get() = Companion.logger + AbstractRepository(logger) { override suspend fun save(filter: Filter): Filter = query { Filters.upsert { upsertStatement -> diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedInstanceRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedInstanceRepository.kt index 1f4e35f4..9c085c42 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedInstanceRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedInstanceRepository.kt @@ -21,7 +21,6 @@ import dev.usbharu.hideout.core.infrastructure.exposed.uri import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.javatime.timestamp -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository import java.net.URI @@ -29,9 +28,7 @@ import dev.usbharu.hideout.core.domain.model.instance.Instance as InstanceEntity @Repository class ExposedInstanceRepository : InstanceRepository, - AbstractRepository() { - override val logger: Logger - get() = Companion.logger + AbstractRepository(logger) { override suspend fun save(instance: InstanceEntity): InstanceEntity = query { Instance.upsert { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedMediaRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedMediaRepository.kt index 03502b72..b16005f5 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedMediaRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedMediaRepository.kt @@ -21,15 +21,12 @@ import dev.usbharu.hideout.core.domain.model.media.* import dev.usbharu.hideout.core.infrastructure.exposed.uri import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository import dev.usbharu.hideout.core.domain.model.media.Media as EntityMedia @Repository -class ExposedMediaRepository : MediaRepository, AbstractRepository() { - override val logger: Logger - get() = Companion.logger +class ExposedMediaRepository : MediaRepository, AbstractRepository(logger) { override suspend fun save(media: EntityMedia): EntityMedia = query { Media.upsert { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedPostRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedPostRepository.kt index 7bbe3782..a65b6155 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedPostRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedPostRepository.kt @@ -43,7 +43,6 @@ import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.SqlExpressionBuilder.inList import org.jetbrains.exposed.sql.javatime.timestamp -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @@ -53,9 +52,8 @@ class ExposedPostRepository( override val domainEventPublisher: DomainEventPublisher, ) : PostRepository, - AbstractRepository(), + AbstractRepository(logger), DomainEventPublishableRepository { - override val logger: Logger = Companion.logger override suspend fun save(post: Post): Post { query { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedReactionRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedReactionRepository.kt index 4f0fc2f7..9bbe45f2 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedReactionRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedReactionRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.exposedrepository import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -12,19 +28,15 @@ import dev.usbharu.hideout.core.domain.shared.repository.DomainEventPublishableR import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.javatime.timestamp -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @Repository class ExposedReactionRepository(override val domainEventPublisher: DomainEventPublisher) : ReactionRepository, - AbstractRepository(), + AbstractRepository(logger), DomainEventPublishableRepository { - override val logger: Logger - get() = Companion.logger - override suspend fun save(reaction: Reaction): Reaction { return query { Reactions.upsert { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt index b4827a4f..7c91af8d 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt @@ -23,17 +23,14 @@ import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventPublisher import dev.usbharu.hideout.core.domain.shared.repository.DomainEventPublishableRepository import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @Repository class ExposedRelationshipRepository(override val domainEventPublisher: DomainEventPublisher) : RelationshipRepository, - AbstractRepository(), + AbstractRepository(logger), DomainEventPublishableRepository { - override val logger: Logger - get() = Companion.logger override suspend fun save(relationship: Relationship): Relationship { query { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRelationshipRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRelationshipRepository.kt index 1ab6986a..745a5405 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRelationshipRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRelationshipRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.exposedrepository import dev.usbharu.hideout.core.domain.model.actor.ActorId @@ -8,14 +24,11 @@ import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelati import dev.usbharu.hideout.core.domain.model.timelinerelationship.Visible import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @Repository -class ExposedTimelineRelationshipRepository : AbstractRepository(), TimelineRelationshipRepository { - override val logger: Logger - get() = Companion.logger +class ExposedTimelineRelationshipRepository : AbstractRepository(logger), TimelineRelationshipRepository { override suspend fun save(timelineRelationship: TimelineRelationship): TimelineRelationship { query { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRepository.kt index 8f5f8c65..e6f447fe 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.exposedrepository import dev.usbharu.hideout.core.domain.model.timeline.* @@ -6,17 +22,14 @@ import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventPublisher import dev.usbharu.hideout.core.domain.shared.repository.DomainEventPublishableRepository import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @Repository class ExposedTimelineRepository(override val domainEventPublisher: DomainEventPublisher) : TimelineRepository, - AbstractRepository(), + AbstractRepository(logger), DomainEventPublishableRepository { - override val logger: Logger - get() = Companion.logger override suspend fun save(timeline: Timeline): Timeline { query { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedUserDetailRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedUserDetailRepository.kt index cacaa922..e1fbff07 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedUserDetailRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedUserDetailRepository.kt @@ -27,17 +27,14 @@ import dev.usbharu.hideout.core.domain.shared.repository.DomainEventPublishableR import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.javatime.timestamp -import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @Repository class ExposedUserDetailRepository(override val domainEventPublisher: DomainEventPublisher) : UserDetailRepository, - AbstractRepository(), + AbstractRepository(logger), DomainEventPublishableRepository { - override val logger: Logger - get() = Companion.logger override suspend fun save(userDetail: UserDetail): UserDetail = query { UserDetails.upsert { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/localfilesystem/LocalFileSystemMediaStore.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/localfilesystem/LocalFileSystemMediaStore.kt index da95574a..5a47a520 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/localfilesystem/LocalFileSystemMediaStore.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/localfilesystem/LocalFileSystemMediaStore.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.localfilesystem import dev.usbharu.hideout.core.config.ApplicationConfig diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/common/GenerateBlurhash.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/common/GenerateBlurhash.kt index 6ee2893d..f75a10ec 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/common/GenerateBlurhash.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/common/GenerateBlurhash.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.media.common import java.awt.image.BufferedImage diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/common/GenerateBlurhashImpl.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/common/GenerateBlurhashImpl.kt index cb269364..fd43d87f 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/common/GenerateBlurhashImpl.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/common/GenerateBlurhashImpl.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.media.common import io.trbl.blurhash.BlurHash diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/image/ImageIOImageProcessor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/image/ImageIOImageProcessor.kt index 89b0ae1e..98adaa05 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/image/ImageIOImageProcessor.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/image/ImageIOImageProcessor.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.media.image import dev.usbharu.hideout.core.application.exception.InternalServerException diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/video/FFmpegVideoProcessor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/video/FFmpegVideoProcessor.kt index 9625c2c1..9cb58ec6 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/video/FFmpegVideoProcessor.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/media/video/FFmpegVideoProcessor.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.media.video import dev.usbharu.hideout.core.config.FFmpegVideoConfig diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/mongorepository/MongoInternalTimelineObjectRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/mongorepository/MongoInternalTimelineObjectRepository.kt index c6dec873..41196755 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/mongorepository/MongoInternalTimelineObjectRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/mongorepository/MongoInternalTimelineObjectRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.mongorepository import dev.usbharu.hideout.core.domain.model.actor.ActorId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/ApplicationRequestLogInterceptor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/ApplicationRequestLogInterceptor.kt index 9f42749b..6af2139f 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/ApplicationRequestLogInterceptor.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/ApplicationRequestLogInterceptor.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.springframework import dev.usbharu.hideout.core.infrastructure.springframework.oauth2.HideoutUserDetails diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SPAInterceptor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SPAInterceptor.kt index b3d9a394..1928b4e9 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SPAInterceptor.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SPAInterceptor.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.springframework import dev.usbharu.hideout.core.interfaces.web.common.OGP diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SpringSecurityFormLoginPrincipalContextHolder.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SpringSecurityFormLoginPrincipalContextHolder.kt index a2b466c1..a2beef2b 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SpringSecurityFormLoginPrincipalContextHolder.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SpringSecurityFormLoginPrincipalContextHolder.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.springframework import dev.usbharu.hideout.core.application.shared.Transaction diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventSubscriber.kt index 4230303a..04471796 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventSubscriber.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.springframework.domainevent import dev.usbharu.hideout.core.application.domainevent.subscribers.DomainEventConsumer diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/oauth2/SpringSecurityOauth2PrincipalContextHolder.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/oauth2/SpringSecurityOauth2PrincipalContextHolder.kt index eefb47b1..f3f0e049 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/oauth2/SpringSecurityOauth2PrincipalContextHolder.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/oauth2/SpringSecurityOauth2PrincipalContextHolder.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.springframework.oauth2 import dev.usbharu.hideout.core.application.shared.Transaction diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/AbstractTimelineStore.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/AbstractTimelineStore.kt index b22d0121..7cf5b91e 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/AbstractTimelineStore.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/AbstractTimelineStore.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.timeline import dev.usbharu.hideout.core.application.model.Reactions diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/DefaultTimelineStore.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/DefaultTimelineStore.kt index e25751cd..b9e646f6 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/DefaultTimelineStore.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/DefaultTimelineStore.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.timeline import dev.usbharu.hideout.core.application.model.Reactions diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/InternalTimelineObjectRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/InternalTimelineObjectRepository.kt index c0cf4ac6..cc191748 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/InternalTimelineObjectRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/InternalTimelineObjectRepository.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.infrastructure.timeline import dev.usbharu.hideout.core.domain.model.actor.ActorId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/IndexController.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/IndexController.kt index 6f181ce4..62c86043 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/IndexController.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/IndexController.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.interfaces.web import dev.usbharu.hideout.core.application.instance.GetLocalInstanceApplicationService diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/auth/SignUpForm.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/auth/SignUpForm.kt index 320187d8..0deccbd6 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/auth/SignUpForm.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/auth/SignUpForm.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.interfaces.web.auth data class SignUpForm( diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/common/OGP.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/common/OGP.kt index e3206294..83539f45 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/common/OGP.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/common/OGP.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.interfaces.web.common data class OGP( diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PostsController.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PostsController.kt index f1005327..09245b2f 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PostsController.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PostsController.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.interfaces.web.posts import dev.usbharu.hideout.core.application.exception.PermissionDeniedException diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PublishController.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PublishController.kt index a3313ba2..a41798e4 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PublishController.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PublishController.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.interfaces.web.posts import dev.usbharu.hideout.core.application.actor.GetUserDetail diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PublishPost.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PublishPost.kt index 5da5aa30..061fa1e1 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PublishPost.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/posts/PublishPost.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.interfaces.web.posts @Suppress("ConstructorParameterNaming") diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/timeline/TimelineController.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/timeline/TimelineController.kt index c80b999b..776fe2df 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/timeline/TimelineController.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/timeline/TimelineController.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.interfaces.web.timeline import dev.usbharu.hideout.core.application.exception.InternalServerException diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/user/UserController.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/user/UserController.kt index a7d8a900..bdcba22f 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/user/UserController.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/user/UserController.kt @@ -1,14 +1,25 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.interfaces.web.user import dev.usbharu.hideout.core.application.actor.GetActorDetail import dev.usbharu.hideout.core.application.actor.GetActorDetailApplicationService import dev.usbharu.hideout.core.application.instance.GetLocalInstanceApplicationService -import dev.usbharu.hideout.core.application.relationship.followrequest.FollowRequest -import dev.usbharu.hideout.core.application.relationship.followrequest.UserFollowRequestApplicationService -import dev.usbharu.hideout.core.application.relationship.get.GetRelationship -import dev.usbharu.hideout.core.application.relationship.get.GetRelationshipApplicationService -import dev.usbharu.hideout.core.application.relationship.unfollow.Unfollow -import dev.usbharu.hideout.core.application.relationship.unfollow.UserUnfollowApplicationService +import dev.usbharu.hideout.core.application.relationship.* import dev.usbharu.hideout.core.application.timeline.GetUserTimeline import dev.usbharu.hideout.core.application.timeline.GetUserTimelineApplicationService import dev.usbharu.hideout.core.domain.model.support.acct.Acct diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/principal/PrincipalDTO.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/principal/PrincipalDTO.kt index 4861b80a..97feae23 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/principal/PrincipalDTO.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/principal/PrincipalDTO.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.query.principal import dev.usbharu.hideout.core.domain.model.actor.ActorId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/principal/PrincipalQueryService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/principal/PrincipalQueryService.kt index 49a0fc1d..a31fa41c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/principal/PrincipalQueryService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/principal/PrincipalQueryService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.query.principal import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/reactions/ReactionsQueryService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/reactions/ReactionsQueryService.kt index e410c4ae..25decd7b 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/reactions/ReactionsQueryService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/reactions/ReactionsQueryService.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.query.reactions import dev.usbharu.hideout.core.application.model.Reactions diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/usertimeline/UserTimelineQueryService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/usertimeline/UserTimelineQueryService.kt index 2981cfa7..e4b35461 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/usertimeline/UserTimelineQueryService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/usertimeline/UserTimelineQueryService.kt @@ -1,6 +1,22 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package dev.usbharu.hideout.core.query.usertimeline -import dev.usbharu.hideout.core.application.post.PostDetail +import dev.usbharu.hideout.core.application.model.PostDetail import dev.usbharu.hideout.core.domain.model.post.PostId import dev.usbharu.hideout.core.domain.model.support.principal.Principal diff --git a/hideout-core/src/main/resources/application.yml b/hideout-core/src/main/resources/application.yml index 3c3df36d..18ef2dd8 100644 --- a/hideout-core/src/main/resources/application.yml +++ b/hideout-core/src/main/resources/application.yml @@ -1,4 +1,4 @@ -#file: noinspection SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection +#file: noinspection SpellCheckingInspection hideout: url: "https://test-hideout-dev.usbharu.dev" private: true diff --git a/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql b/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql index f4c62702..3c6cce85 100644 --- a/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql +++ b/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql @@ -1,3 +1,35 @@ +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Copyright (C) 2024 usbharu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + create table if not exists emojis ( id bigint primary key, diff --git a/hideout-core/src/main/resources/logback-spring.xml b/hideout-core/src/main/resources/logback-spring.xml index dfb52736..c935da07 100644 --- a/hideout-core/src/main/resources/logback-spring.xml +++ b/hideout-core/src/main/resources/logback-spring.xml @@ -1,4 +1,20 @@ + + diff --git a/hideout-core/src/main/resources/messages/hideout-web-messages.properties b/hideout-core/src/main/resources/messages/hideout-web-messages.properties index d2c0de78..a7c2d794 100644 --- a/hideout-core/src/main/resources/messages/hideout-web-messages.properties +++ b/hideout-core/src/main/resources/messages/hideout-web-messages.properties @@ -1,3 +1,19 @@ +# +# Copyright (C) 2024 usbharu +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + auth-signIn.title=\u30ED\u30B0\u30A4\u30F3 - {0} auth-signUp.password=\u30D1\u30B9\u30EF\u30FC\u30C9 auth-signUp.register=\u767B\u9332\u3059\u308B diff --git a/hideout-core/src/main/resources/messages/hideout-web-messages_en_US.properties b/hideout-core/src/main/resources/messages/hideout-web-messages_en_US.properties index e19ac2b5..fe124f2f 100644 --- a/hideout-core/src/main/resources/messages/hideout-web-messages_en_US.properties +++ b/hideout-core/src/main/resources/messages/hideout-web-messages_en_US.properties @@ -1,3 +1,19 @@ +# +# Copyright (C) 2024 usbharu +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + auth-signIn.title=Sign in - {0} auth-signUp.password=Password auth-signUp.register=Register Account diff --git a/hideout-core/src/main/resources/messages/hideout-web-messages_ja_JP.properties b/hideout-core/src/main/resources/messages/hideout-web-messages_ja_JP.properties index d2c0de78..a7c2d794 100644 --- a/hideout-core/src/main/resources/messages/hideout-web-messages_ja_JP.properties +++ b/hideout-core/src/main/resources/messages/hideout-web-messages_ja_JP.properties @@ -1,3 +1,19 @@ +# +# Copyright (C) 2024 usbharu +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + auth-signIn.title=\u30ED\u30B0\u30A4\u30F3 - {0} auth-signUp.password=\u30D1\u30B9\u30EF\u30FC\u30C9 auth-signUp.register=\u767B\u9332\u3059\u308B diff --git a/hideout-core/src/main/resources/templates/fragments-actor.html b/hideout-core/src/main/resources/templates/fragments-actor.html index 566549bd..c6492d55 100644 --- a/hideout-core/src/main/resources/templates/fragments-actor.html +++ b/hideout-core/src/main/resources/templates/fragments-actor.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/main/resources/templates/fragments-post.html b/hideout-core/src/main/resources/templates/fragments-post.html index d16f4861..177051b0 100644 --- a/hideout-core/src/main/resources/templates/fragments-post.html +++ b/hideout-core/src/main/resources/templates/fragments-post.html @@ -1,3 +1,19 @@ + + @@ -8,11 +24,11 @@
- - + +
- +
@@ -43,7 +59,7 @@
- +
Reply diff --git a/hideout-core/src/main/resources/templates/fragments-timeline.html b/hideout-core/src/main/resources/templates/fragments-timeline.html index ef29250c..3e3496c9 100644 --- a/hideout-core/src/main/resources/templates/fragments-timeline.html +++ b/hideout-core/src/main/resources/templates/fragments-timeline.html @@ -1,3 +1,19 @@ + + @@ -6,7 +22,7 @@ - + diff --git a/hideout-core/src/main/resources/templates/homeTimeline.html b/hideout-core/src/main/resources/templates/homeTimeline.html index c1f982ac..f03cd62c 100644 --- a/hideout-core/src/main/resources/templates/homeTimeline.html +++ b/hideout-core/src/main/resources/templates/homeTimeline.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/main/resources/templates/index.html b/hideout-core/src/main/resources/templates/index.html index f739ba1a..c7dc5545 100644 --- a/hideout-core/src/main/resources/templates/index.html +++ b/hideout-core/src/main/resources/templates/index.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/main/resources/templates/layout.html b/hideout-core/src/main/resources/templates/layout.html index c0f4c0b4..dd6052b0 100644 --- a/hideout-core/src/main/resources/templates/layout.html +++ b/hideout-core/src/main/resources/templates/layout.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/main/resources/templates/post-postForm.html b/hideout-core/src/main/resources/templates/post-postForm.html index 1142d823..656179ee 100644 --- a/hideout-core/src/main/resources/templates/post-postForm.html +++ b/hideout-core/src/main/resources/templates/post-postForm.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/main/resources/templates/postById.html b/hideout-core/src/main/resources/templates/postById.html index 7f1a3c3d..2c41b69e 100644 --- a/hideout-core/src/main/resources/templates/postById.html +++ b/hideout-core/src/main/resources/templates/postById.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/main/resources/templates/sign_in.html b/hideout-core/src/main/resources/templates/sign_in.html index bf8d29c4..18381cd2 100644 --- a/hideout-core/src/main/resources/templates/sign_in.html +++ b/hideout-core/src/main/resources/templates/sign_in.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/main/resources/templates/sign_out.html b/hideout-core/src/main/resources/templates/sign_out.html index 9daf6994..3c643a0b 100644 --- a/hideout-core/src/main/resources/templates/sign_out.html +++ b/hideout-core/src/main/resources/templates/sign_out.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/main/resources/templates/sign_up.html b/hideout-core/src/main/resources/templates/sign_up.html index 52d7abdd..479e6ad6 100644 --- a/hideout-core/src/main/resources/templates/sign_up.html +++ b/hideout-core/src/main/resources/templates/sign_up.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/main/resources/templates/top.html b/hideout-core/src/main/resources/templates/top.html index 94dd75fc..8cf18497 100644 --- a/hideout-core/src/main/resources/templates/top.html +++ b/hideout-core/src/main/resources/templates/top.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/main/resources/templates/userById.html b/hideout-core/src/main/resources/templates/userById.html index cf45d55f..7efd6866 100644 --- a/hideout-core/src/main/resources/templates/userById.html +++ b/hideout-core/src/main/resources/templates/userById.html @@ -1,3 +1,19 @@ + + diff --git a/hideout-core/src/test/kotlin/dev/usbharu/hideout/core/application/post/GetPostApplicationServiceTest.kt b/hideout-core/src/test/kotlin/dev/usbharu/hideout/core/application/post/GetPostApplicationServiceTest.kt deleted file mode 100644 index c8cf9561..00000000 --- a/hideout-core/src/test/kotlin/dev/usbharu/hideout/core/application/post/GetPostApplicationServiceTest.kt +++ /dev/null @@ -1,64 +0,0 @@ -package dev.usbharu.hideout.core.application.post - -import dev.usbharu.hideout.core.application.exception.PermissionDeniedException -import dev.usbharu.hideout.core.domain.model.post.PostId -import dev.usbharu.hideout.core.domain.model.post.PostRepository -import dev.usbharu.hideout.core.domain.model.post.TestPostFactory -import dev.usbharu.hideout.core.domain.model.support.principal.Anonymous -import dev.usbharu.hideout.core.domain.service.post.IPostReadAccessControl -import kotlinx.coroutines.test.runTest -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith -import org.mockito.InjectMocks -import org.mockito.Mock -import org.mockito.Spy -import org.mockito.junit.jupiter.MockitoExtension -import org.mockito.kotlin.any -import org.mockito.kotlin.doReturn -import org.mockito.kotlin.whenever -import utils.TestTransaction - -@ExtendWith(MockitoExtension::class) -class GetPostApplicationServiceTest { - @InjectMocks - lateinit var service: GetPostApplicationService - - @Mock - lateinit var postRepository: PostRepository - - @Mock - lateinit var iPostReadAccessControl: IPostReadAccessControl - - @Spy - val transaction = TestTransaction - - @Test - fun postReadAccessControlがtrueを返したらPostが返ってくる() = runTest { - val post = TestPostFactory.create(id = 1) - whenever(postRepository.findById(PostId(1))).doReturn(post) - whenever(iPostReadAccessControl.isAllow(any(), any())).doReturn(true) - - val actual = service.execute(GetPost(1), Anonymous) - assertEquals(Post.of(post), actual) - } - - @Test - fun postが見つからない場合失敗() = runTest { - assertThrows { - service.execute(GetPost(2), Anonymous) - } - } - - @Test - fun postReadAccessControlがfalseを返したら失敗() = runTest { - val post = TestPostFactory.create(id = 1) - whenever(postRepository.findById(PostId(1))).doReturn(post) - whenever(iPostReadAccessControl.isAllow(any(), any())).doReturn(false) - assertThrows { - service.execute(GetPost(1), Anonymous) - } - - } -} \ No newline at end of file diff --git a/hideout-core/src/test/kotlin/dev/usbharu/hideout/core/application/relationship/acceptfollowrequest/UserAcceptFollowRequestApplicationServiceTest.kt b/hideout-core/src/test/kotlin/dev/usbharu/hideout/core/application/relationship/acceptfollowrequest/UserAcceptFollowRequestApplicationServiceTest.kt index 353a9769..e8af07c6 100644 --- a/hideout-core/src/test/kotlin/dev/usbharu/hideout/core/application/relationship/acceptfollowrequest/UserAcceptFollowRequestApplicationServiceTest.kt +++ b/hideout-core/src/test/kotlin/dev/usbharu/hideout/core/application/relationship/acceptfollowrequest/UserAcceptFollowRequestApplicationServiceTest.kt @@ -1,6 +1,8 @@ package dev.usbharu.hideout.core.application.relationship.acceptfollowrequest import dev.usbharu.hideout.core.application.exception.InternalServerException +import dev.usbharu.hideout.core.application.relationship.AcceptFollowRequest +import dev.usbharu.hideout.core.application.relationship.UserAcceptFollowRequestApplicationService import dev.usbharu.hideout.core.domain.model.actor.ActorId import dev.usbharu.hideout.core.domain.model.actor.ActorRepository import dev.usbharu.hideout.core.domain.model.actor.TestActorFactory diff --git a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringAccountApi.kt b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringAccountApi.kt index a9471098..7f984a77 100644 --- a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringAccountApi.kt +++ b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringAccountApi.kt @@ -19,26 +19,7 @@ package dev.usbharu.hideout.mastodon.interfaces.api import dev.usbharu.hideout.core.application.actor.GetUserDetail import dev.usbharu.hideout.core.application.actor.GetUserDetailApplicationService import dev.usbharu.hideout.core.application.exception.PermissionDeniedException -import dev.usbharu.hideout.core.application.relationship.acceptfollowrequest.AcceptFollowRequest -import dev.usbharu.hideout.core.application.relationship.acceptfollowrequest.UserAcceptFollowRequestApplicationService -import dev.usbharu.hideout.core.application.relationship.block.Block -import dev.usbharu.hideout.core.application.relationship.block.UserBlockApplicationService -import dev.usbharu.hideout.core.application.relationship.followrequest.FollowRequest -import dev.usbharu.hideout.core.application.relationship.followrequest.UserFollowRequestApplicationService -import dev.usbharu.hideout.core.application.relationship.get.GetRelationship -import dev.usbharu.hideout.core.application.relationship.get.GetRelationshipApplicationService -import dev.usbharu.hideout.core.application.relationship.mute.Mute -import dev.usbharu.hideout.core.application.relationship.mute.UserMuteApplicationService -import dev.usbharu.hideout.core.application.relationship.rejectfollowrequest.RejectFollowRequest -import dev.usbharu.hideout.core.application.relationship.rejectfollowrequest.UserRejectFollowRequestApplicationService -import dev.usbharu.hideout.core.application.relationship.removefromfollowers.RemoveFromFollowers -import dev.usbharu.hideout.core.application.relationship.removefromfollowers.UserRemoveFromFollowersApplicationService -import dev.usbharu.hideout.core.application.relationship.unblock.Unblock -import dev.usbharu.hideout.core.application.relationship.unblock.UserUnblockApplicationService -import dev.usbharu.hideout.core.application.relationship.unfollow.Unfollow -import dev.usbharu.hideout.core.application.relationship.unfollow.UserUnfollowApplicationService -import dev.usbharu.hideout.core.application.relationship.unmute.Unmute -import dev.usbharu.hideout.core.application.relationship.unmute.UserUnmuteApplicationService +import dev.usbharu.hideout.core.application.relationship.* import dev.usbharu.hideout.core.domain.model.support.principal.Principal import dev.usbharu.hideout.core.infrastructure.springframework.oauth2.SpringSecurityOauth2PrincipalContextHolder import dev.usbharu.hideout.mastodon.application.accounts.GetAccount diff --git a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringFilterApi.kt b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringFilterApi.kt index 788a4c29..1734be87 100644 --- a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringFilterApi.kt +++ b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringFilterApi.kt @@ -27,8 +27,6 @@ import dev.usbharu.hideout.mastodon.application.filter.GetFilterV1 import dev.usbharu.hideout.mastodon.application.filter.GetFilterV1ApplicationService import dev.usbharu.hideout.mastodon.interfaces.api.generated.FilterApi import dev.usbharu.hideout.mastodon.interfaces.api.generated.model.* -import dev.usbharu.hideout.mastodon.interfaces.api.generated.model.Filter -import dev.usbharu.hideout.mastodon.interfaces.api.generated.model.FilterKeyword import dev.usbharu.hideout.mastodon.interfaces.api.generated.model.FilterPostRequest.Context import dev.usbharu.hideout.mastodon.interfaces.api.generated.model.V1FilterPostRequest.Context.* import org.springframework.http.ResponseEntity @@ -131,7 +129,7 @@ class SpringFilterApi( ) } - private fun filter(filter: dev.usbharu.hideout.core.application.filter.Filter) = Filter( + private fun filter(filter: dev.usbharu.hideout.core.application.model.Filter) = Filter( id = filter.filterId.toString(), title = filter.name, context = filter.filterContext.map { diff --git a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringMediaApi.kt b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringMediaApi.kt index 16fbe9cb..d5bed541 100644 --- a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringMediaApi.kt +++ b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringMediaApi.kt @@ -18,7 +18,6 @@ package dev.usbharu.hideout.mastodon.interfaces.api import dev.usbharu.hideout.core.application.media.UploadMedia import dev.usbharu.hideout.core.application.media.UploadMediaApplicationService -import dev.usbharu.hideout.core.domain.model.media.FileType.* import dev.usbharu.hideout.core.infrastructure.springframework.oauth2.SpringSecurityOauth2PrincipalContextHolder import dev.usbharu.hideout.mastodon.interfaces.api.generated.MediaApi import dev.usbharu.hideout.mastodon.interfaces.api.generated.model.MediaAttachment @@ -58,18 +57,18 @@ class SpringMediaApi( return ResponseEntity.ok( MediaAttachment( - id = media.id.toString(), + id = media.mediaId.toString(), type = when (media.type) { - Image -> MediaAttachment.Type.image - Video -> MediaAttachment.Type.video - Audio -> MediaAttachment.Type.audio - Unknown -> MediaAttachment.Type.unknown + "Image" -> MediaAttachment.Type.image + "Video" -> MediaAttachment.Type.video + "Audio" -> MediaAttachment.Type.audio + else -> MediaAttachment.Type.unknown }, url = media.url.toString(), - previewUrl = media.thumbprintURI?.toString(), - remoteUrl = media.remoteURL?.toString(), + previewUrl = media.thumbnailUrl?.toString(), + remoteUrl = null, description = media.description, - blurhash = media.blurHash, + blurhash = media.blurhash, textUrl = media.url.toASCIIString() ) )