diff --git a/build.gradle.kts b/build.gradle.kts index 0dace59..961d6bf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,6 +51,7 @@ subprojects { implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor") + implementation("software.amazon.awssdk:dynamodb:2.17.37") } java { diff --git a/modules/server-test/src/test/kotlin/com/editor/appcha/repository/UserRepositoryTest.kt b/modules/server-test/src/test/kotlin/com/editor/appcha/repository/UserRepositoryTest.kt new file mode 100644 index 0000000..90bd9d0 --- /dev/null +++ b/modules/server-test/src/test/kotlin/com/editor/appcha/repository/UserRepositoryTest.kt @@ -0,0 +1,4 @@ +package com.editor.appcha.repository + +class UserRepositoryTest { +} diff --git a/modules/server/src/main/kotlin/com/editor/appcha/configuration/DynamoConfiguration.kt b/modules/server/src/main/kotlin/com/editor/appcha/configuration/DynamoConfiguration.kt new file mode 100644 index 0000000..8e778b4 --- /dev/null +++ b/modules/server/src/main/kotlin/com/editor/appcha/configuration/DynamoConfiguration.kt @@ -0,0 +1,21 @@ +package com.editor.appcha.configuration + +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration +import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider +import software.amazon.awssdk.regions.Region +import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient +import java.net.URI + +@Configuration +class DynamoConfiguration { + + @Bean + fun dynamoDbAsynceClient(): DynamoDbAsyncClient { + return DynamoDbAsyncClient.builder() + .region(Region.AP_NORTHEAST_2) + .endpointOverride(URI.create("")) + .credentialsProvider(DefaultCredentialsProvider.builder().build()) + .build() + } +} diff --git a/modules/server/src/main/kotlin/com/editor/appcha/domain/User.kt b/modules/server/src/main/kotlin/com/editor/appcha/domain/User.kt new file mode 100644 index 0000000..0925532 --- /dev/null +++ b/modules/server/src/main/kotlin/com/editor/appcha/domain/User.kt @@ -0,0 +1,6 @@ +package com.editor.appcha.domain + +data class User ( + val id: Int, + val userName: String +) diff --git a/modules/server/src/main/kotlin/com/editor/appcha/repository/UserRepository.kt b/modules/server/src/main/kotlin/com/editor/appcha/repository/UserRepository.kt new file mode 100644 index 0000000..621347a --- /dev/null +++ b/modules/server/src/main/kotlin/com/editor/appcha/repository/UserRepository.kt @@ -0,0 +1,13 @@ +package com.editor.appcha.repository + +import org.springframework.stereotype.Repository +import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient + +@Repository +class UserRepository( + private val dbClient: DynamoDbAsyncClient +) { + fun findById(id: Int) { + // TODO + } +} diff --git a/modules/server/src/main/resources/application.properties b/modules/server/src/main/resources/application.properties deleted file mode 100644 index e69de29..0000000 diff --git a/modules/server/src/main/resources/application.yml b/modules/server/src/main/resources/application.yml new file mode 100644 index 0000000..7b3bc60 --- /dev/null +++ b/modules/server/src/main/resources/application.yml @@ -0,0 +1,3 @@ +spring: + datasource: + url: "https://dynamodb.ap-southeast-2.amazonaws.com"