Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.61'
ext.kotlin_version = '1.3.71'

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
// API
api("com.google.protobuf:protobuf-java:3.6.1")
api("io.grpc:grpc-stub:1.18.0")
api("de.hpi.cloud:hpi-cloud:0.0.13")
api("de.hpi.cloud:hpi-cloud:0.0.14")

// Storage
api("com.couchbase.client:java-client:2.7.9")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import de.hpi.cloud.common.grpc.throwAlreadyExists

inline fun <reified E : Entity<E>, reified Proto : GeneratedMessageV3> Bucket.tryInsert(wrapper: Wrapper<E>) {
try {
insert<E, Proto>(wrapper)
insert(wrapper)
} catch (e: DocumentAlreadyExistsException) {
throwAlreadyExists<Proto>(wrapper.id)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package de.hpi.cloud.common.couchbase
import com.couchbase.client.java.AsyncBucket
import com.couchbase.client.java.Bucket
import com.couchbase.client.java.document.RawJsonDocument
import com.google.protobuf.GeneratedMessageV3
import de.hpi.cloud.common.entity.Entity
import de.hpi.cloud.common.entity.Id
import de.hpi.cloud.common.entity.Wrapper
Expand Down Expand Up @@ -37,9 +36,9 @@ inline fun <reified E : Entity<E>> Wrapper<E>.toJsonDocument(): RawJsonDocument
)
}

inline fun <reified E : Entity<E>, reified Proto : GeneratedMessageV3> Bucket.insert(wrapper: Wrapper<E>) =
inline fun <reified E : Entity<E>> Bucket.insert(wrapper: Wrapper<E>) =
insert(wrapper.toJsonDocument())

inline fun <reified E : Entity<E>> Bucket.upsert(entityWrapper: Wrapper<E>) {
upsert(entityWrapper.toJsonDocument())
inline fun <reified E : Entity<E>> Bucket.upsert(wrapper: Wrapper<E>) {
upsert(wrapper.toJsonDocument())
}
2 changes: 0 additions & 2 deletions common/src/main/kotlin/de/hpi/cloud/common/entity/Entity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package de.hpi.cloud.common.entity
import com.google.protobuf.GeneratedMessageV3
import de.hpi.cloud.common.Context
import de.hpi.cloud.common.protobuf.setId
import de.hpi.cloud.common.serializers.proto.InstantSerializer
import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.KSerializer
import kotlinx.serialization.serializer
import java.time.Instant
import kotlin.reflect.KClass
import kotlin.reflect.full.companionObjectInstance
import de.hpi.cloud.common.serializers.proto.ProtoSerializer as AnyProtoSerializer
Expand Down
31 changes: 0 additions & 31 deletions service-food-crawler/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 15 additions & 3 deletions service-food/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,33 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.40")
classpath("com.github.jengelman.gradle.plugins:shadow:5.1.0")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

plugins {
id "kotlin"
id "application"
id "com.github.johnrengelman.shadow" version "5.1.0"
}
apply plugin: 'kotlinx-serialization'
apply plugin: 'kotlin'

repositories {
jcenter()
mavenCentral()
maven { url "https://dl.bintray.com/hpi/hpi-cloud-mvn" }
}

dependencies {
implementation(project(":common"))

// Crawling
implementation("com.beust:klaxon:5.0.11")
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

application {
// mainClassName = "de.hpi.cloud.food.crawler.MainKt"

mainClassName = "de.hpi.cloud.food.FoodServiceKt"
}
Loading