-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#50 feature: redis config로 cd테스트
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
neighbor/src/main/java/com/likelion/neighbor/global/cache/ShortUrlRedisRepository.java
This file contains 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
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> { | ||
} |
23 changes: 23 additions & 0 deletions
23
neighbor/src/main/java/com/likelion/neighbor/global/config/RedisCacheConfig.java
This file contains 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
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); | ||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
neighbor/src/main/java/com/likelion/neighbor/global/dto/ShortUrlReponseDto.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.likelion.neighbor.global.dto; | ||
|
||
public class ShortUrlReponseDto { | ||
} |