-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
805 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: '3' | ||
services: | ||
gremlin: | ||
# image: "arcadedata/arcadedb:23.4.1" | ||
image: "arcadedata/arcadedb:23.7.1" | ||
container_name: gremlin | ||
ports: | ||
- "2480:2480" | ||
- "2424:2424" | ||
- "8182:8182" | ||
volumes: | ||
- gremlin_data:/home/arcadedb/databases | ||
environment: | ||
JAVA_OPTS: "-Darcadedb.server.rootPassword=root_root -Darcadedb.server.plugins=GremlinServer:com.arcadedb.server.gremlin.GremlinServerPlugin -Darcadedb.server.defaultDatabases=mkpl[root1:playwithdata]" | ||
|
||
# app: | ||
# image: "ok-marketplace-app-ktor:0.0.3" | ||
# container_name: app-ktor | ||
# ports: | ||
# - "8080:8080" | ||
## expose: | ||
## - "8080" | ||
# environment: | ||
# DB_TYPE_PROD: gremlin | ||
# DB_GREMLIN_HOST: gremlin | ||
# DB_GREMLIN_PORT: 8182 | ||
# DB_GREMLIN_USER: root | ||
# DB_GREMLIN_PASS: root_root | ||
# depends_on: | ||
# - gremlin | ||
|
||
volumes: | ||
gremlin_data: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Модуль `ok-marketplace-repo-gremlin` | ||
|
||
|
||
Модуль реализует интерфейс репозитория ArcadeDb с вариантом Apache TinkerPop Gremlin. | ||
|
||
Поддерживается только JVM платформа. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated | ||
|
||
plugins { | ||
kotlin("jvm") | ||
} | ||
|
||
val generatedPath = "$buildDir/generated/main/kotlin" | ||
sourceSets { | ||
main { | ||
java.srcDir(generatedPath) | ||
} | ||
} | ||
|
||
dependencies { | ||
val arcadeDbVersion: String by project | ||
val tinkerpopVersion: String by project | ||
val coroutinesVersion: String by project | ||
val kmpUUIDVersion: String by project | ||
val testContainersVersion: String by project | ||
|
||
implementation(project(":ok-marketplace-common")) | ||
|
||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion") | ||
implementation("com.benasher44:uuid:$kmpUUIDVersion") | ||
|
||
testImplementation(project(":ok-marketplace-repo-tests")) | ||
|
||
implementation(kotlin("stdlib-jdk8")) | ||
implementation("org.apache.tinkerpop:gremlin-driver:$tinkerpopVersion") | ||
// constraints { | ||
// implementation("commons-collections:commons-collections:3.2.2") { | ||
// because("Uncontrolled Recursion vulnerability pending CVSS allocation") | ||
// } | ||
// } | ||
implementation("com.arcadedb:arcadedb-engine:$arcadeDbVersion") | ||
implementation("com.arcadedb:arcadedb-network:$arcadeDbVersion") | ||
implementation("com.arcadedb:arcadedb-gremlin:$arcadeDbVersion") | ||
|
||
testImplementation(kotlin("test-junit")) | ||
testImplementation("org.testcontainers:testcontainers:$testContainersVersion") | ||
} | ||
|
||
val arcadeDbVersion: String by project | ||
|
||
tasks { | ||
val gradleConstants by creating { | ||
file("$generatedPath/GradleConstants.kt").apply { | ||
ensureParentDirsCreated() | ||
writeText( | ||
""" | ||
package ru.otus.otuskotlin.marketplace.backend.repository.gremlin | ||
const val ARCADEDB_VERSION = "$arcadeDbVersion" | ||
""".trimIndent() | ||
) | ||
} | ||
} | ||
compileKotlin.get().dependsOn(gradleConstants) | ||
} |
16 changes: 16 additions & 0 deletions
16
ok-marketplace-repo-gremlin/src/main/kotlin/AdGremlinConst.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package ru.otus.otuskotlin.marketplace.backend.repository.gremlin | ||
|
||
object AdGremlinConst { | ||
const val RESULT_SUCCESS = "success" | ||
const val RESULT_LOCK_FAILURE = "lock-failure" | ||
|
||
const val FIELD_ID = "#id" | ||
const val FIELD_TITLE = "title" | ||
const val FIELD_DESCRIPTION = "description" | ||
const val FIELD_AD_TYPE = "adType" | ||
const val FIELD_OWNER_ID = "ownerId" | ||
const val FIELD_VISIBILITY = "visibility" | ||
const val FIELD_PRODUCT_ID = "productId" | ||
const val FIELD_LOCK = "lock" | ||
const val FIELD_TMP_RESULT = "_result" | ||
} |
Oops, something went wrong.