Skip to content

Commit

Permalink
#50 feature: redis config로 cd테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
sss4920 committed Aug 11, 2024
1 parent 5e59ecf commit 73c0d76
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<ShortUrlReponseDto, String> {
}
Original file line number Diff line number Diff line change
@@ -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);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.likelion.neighbor.global.dto;

public class ShortUrlReponseDto {
}

0 comments on commit 73c0d76

Please sign in to comment.