Created
April 13, 2025 12:56
-
-
Save ArtDu/7560100d1355efc73bf35c135f483a26 to your computer and use it in GitHub Desktop.
Diff patch as addition to vk internal practice 2 (from spring redis to tarantool redis)
This file contains hidden or 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
| diff --git a/pom.xml b/pom.xml | |
| index 975111a..8d917f9 100644 | |
| --- a/pom.xml | |
| +++ b/pom.xml | |
| @@ -19,15 +19,10 @@ | |
| <artifactId>spring-boot-starter</artifactId> | |
| <version>3.2.12</version> | |
| </dependency> | |
| - <dependency> | |
| - <groupId>org.springframework.boot</groupId> | |
| - <artifactId>spring-boot-starter-data-redis</artifactId> | |
| - <version>3.2.12</version> | |
| - </dependency> | |
| -<!-- <dependency>--> | |
| -<!-- <groupId>io.tarantool</groupId>--> | |
| -<!-- <artifactId>tarantool-spring-data-32</artifactId>--> | |
| -<!-- <version>1.2.1</version>--> | |
| -<!-- </dependency>--> | |
| + <dependency> | |
| + <groupId>io.tarantool</groupId> | |
| + <artifactId>tarantool-spring-data-32</artifactId> | |
| + <version>1.2.1</version> | |
| + </dependency> | |
| </dependencies> | |
| </project> | |
| diff --git a/src/main/java/com/example/App.java b/src/main/java/com/example/App.java | |
| index 0bfdc90..cc6a7b5 100644 | |
| --- a/src/main/java/com/example/App.java | |
| +++ b/src/main/java/com/example/App.java | |
| @@ -1,14 +1,12 @@ | |
| package com.example; | |
| -//import io.tarantool.spring.data32.repository.config.EnableTarantoolRepositories; | |
| +import io.tarantool.spring.data32.repository.config.EnableTarantoolRepositories; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.context.ApplicationContext; | |
| -import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; | |
| @SpringBootApplication | |
| -//@EnableTarantoolRepositories | |
| -@EnableRedisRepositories | |
| +@EnableTarantoolRepositories | |
| public class App { | |
| public static void main(String[] args) { | |
| App.bootstrap(args); | |
| diff --git a/src/main/java/com/example/Person.java b/src/main/java/com/example/Person.java | |
| index 645b410..f4d8b6d 100644 | |
| --- a/src/main/java/com/example/Person.java | |
| +++ b/src/main/java/com/example/Person.java | |
| @@ -1,23 +1,19 @@ | |
| package com.example; | |
| -//import com.fasterxml.jackson.annotation.JsonFormat; | |
| -//import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| +import com.fasterxml.jackson.annotation.JsonFormat; | |
| +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| import org.springframework.data.annotation.Id; | |
| import org.springframework.data.keyvalue.annotation.KeySpace; | |
| -import org.springframework.data.redis.core.RedisHash; | |
| -import org.springframework.data.redis.core.index.Indexed; | |
| import java.time.Instant; | |
| import java.util.Map; | |
| -//@JsonFormat(shape = JsonFormat.Shape.ARRAY) | |
| -//@JsonIgnoreProperties(ignoreUnknown = true) // for example bucket_id | |
| +@JsonFormat(shape = JsonFormat.Shape.ARRAY) | |
| +@JsonIgnoreProperties(ignoreUnknown = true) // for example bucket_id | |
| @KeySpace("person") | |
| -@RedisHash("person") | |
| public class Person { | |
| @Id | |
| public Integer id; | |
| - @Indexed | |
| public String name; | |
| public Instant createdAt; | |
| public Map metadata; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment