Java SDK
Less than 1 minute
Java SDK
Note
The Java SDK is under development, and APIs might be changed in later versions. Pull requests are welcomed: https://github.com/gorse-io/gorse4j
Install
<dependency>
<groupId>io.gorse</groupId>
<artifactId>gorse-client</artifactId>
<version>0.4.0</version>
</dependency>
implementation 'io.gorse:gorse-client:0.4.0'
libraryDependencies += "io.gorse" % "gorse-client" % "0.4.0"
@Grapes(
@Grab(group='io.gorse', module='gorse-client', version='0.4.0')
)
[io.gorse/gorse-client "0.4.0"]
Usage
import io.gorse.gorse4j.*;
public class Main {
public static void main(String[] args) {
// Create a client.
Gorse client = new Gorse("http://127.0.0.1:8087", "api_key");
// Insert feedback.
List<Feedback> feedbacks = List.of(
new Feedback("read", "100", "300", "2022-11-20T13:55:27Z"),
new Feedback("read", "100", "400", "2022-11-20T13:55:27Z")
);
client.insertFeedback(feedbacks);
// Get recommendation.
client.getRecommend("100");
}
}