diff --git a/neighbor/src/main/java/com/likelion/neighbor/global/cache/ShortUrlRedisRepository.java b/neighbor/src/main/java/com/likelion/neighbor/global/cache/ShortUrlRedisRepository.java new file mode 100644 index 0000000..7d9035e --- /dev/null +++ b/neighbor/src/main/java/com/likelion/neighbor/global/cache/ShortUrlRedisRepository.java @@ -0,0 +1,8 @@ +package com.likelion.neighbor.global.cache; + +import org.springframework.data.repository.CrudRepository; + +import com.likelion.neighbor.global.dto.ShortUrlReponseDto; + +public interface ShortUrlRedisRepository extends CrudRepository { +} diff --git a/neighbor/src/main/java/com/likelion/neighbor/global/config/RedisCacheConfig.java b/neighbor/src/main/java/com/likelion/neighbor/global/config/RedisCacheConfig.java new file mode 100644 index 0000000..93eb47b --- /dev/null +++ b/neighbor/src/main/java/com/likelion/neighbor/global/config/RedisCacheConfig.java @@ -0,0 +1,23 @@ +package com.likelion.neighbor.global.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; + +@Configuration +public class RedisCacheConfig { + + @Value("${spring.data.redis.host") + private String host; + + @Value("${spring.data.redis.port") + private int port; + + @Bean + public RedisConnectionFactory redisConnectionFactory(){return new LettuceConnectionFactory(host,port); + } + +} diff --git a/neighbor/src/main/java/com/likelion/neighbor/global/dto/ShortUrlReponseDto.java b/neighbor/src/main/java/com/likelion/neighbor/global/dto/ShortUrlReponseDto.java new file mode 100644 index 0000000..a56e3ca --- /dev/null +++ b/neighbor/src/main/java/com/likelion/neighbor/global/dto/ShortUrlReponseDto.java @@ -0,0 +1,4 @@ +package com.likelion.neighbor.global.dto; + +public class ShortUrlReponseDto { +}