Skip to content

Commit

Permalink
refactor(be) #639: Redis를 사용하고 있지 않으므로 Redis 관련 로직 주석 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
devbattery committed Dec 16, 2024
1 parent f9beafa commit fd784b9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion be/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webflux'

// Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis:2.7.14'
// implementation 'org.springframework.boot:spring-boot-starter-data-redis:2.7.14'
}

ext {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@Service
@RequiredArgsConstructor
public class RedisRefreshTokenStorage implements RefreshTokenStorage {
public class refreshTokenStorage implements RefreshTokenStorage {

private final ConcurrentHashMap<String, String> refreshTokens = new ConcurrentHashMap<>();
private final ConcurrentHashMap<String, Long> blacklist = new ConcurrentHashMap<>();
Expand Down
48 changes: 24 additions & 24 deletions be/src/main/java/com/foodymoody/be/common/config/RedisConfig.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package com.foodymoody.be.common.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;

@Configuration
@EnableRedisRepositories(excludeFilters = @ComponentScan.Filter(
type = FilterType.ASSIGNABLE_TYPE,
classes = com.foodymoody.be.feed_collection_comment.infra.persistence.jpa.FeedCollectionCommentJpaRepository.class)
)
public class RedisConfig {

public RedisTemplate<?, ?> redisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<?, ?> template = new RedisTemplate<>();
template.setConnectionFactory(connectionFactory);

return template;
}

}
//package com.foodymoody.be.common.config;
//
//import org.springframework.context.annotation.ComponentScan;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.FilterType;
//import org.springframework.data.redis.connection.RedisConnectionFactory;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;
//
//@Configuration
//@EnableRedisRepositories(excludeFilters = @ComponentScan.Filter(
// type = FilterType.ASSIGNABLE_TYPE,
// classes = com.foodymoody.be.feed_collection_comment.infra.persistence.jpa.FeedCollectionCommentJpaRepository.class)
//)
//public class RedisConfig {
//
// public RedisTemplate<?, ?> redisTemplate(RedisConnectionFactory connectionFactory) {
// RedisTemplate<?, ?> template = new RedisTemplate<>();
// template.setConnectionFactory(connectionFactory);
//
// return template;
// }
//
//}
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
public abstract class AcceptanceTest {

public static final DockerImageName MYSQL_IMAGE = DockerImageName.parse("mysql:8.0");
public static final DockerImageName REDIS_IMAGE = DockerImageName.parse("redis:7.2");
// public static final DockerImageName REDIS_IMAGE = DockerImageName.parse("redis:7.2");
public static final MySQLContainer<?> MYSQL = new MySQLContainer<>(MYSQL_IMAGE)
.withDatabaseName("foodymoody").withUsername("bono").withPassword("1111").withReuse(true);
public static final GenericContainer<?> REDIS = new GenericContainer<>(REDIS_IMAGE).withReuse(true);
// public static final GenericContainer<?> REDIS = new GenericContainer<>(REDIS_IMAGE).withReuse(true);

static {
MYSQL.setPortBindings(List.of("3306:3306"));
REDIS.setPortBindings(List.of("6379:6379"));
// REDIS.setPortBindings(List.of("6379:6379"));
}

@LocalServerPort
Expand Down Expand Up @@ -94,7 +94,7 @@ void setSpec(RestDocumentationContextProvider provider) {
@BeforeAll
static void startContainer() {
MYSQL.start();
REDIS.start();
// REDIS.start();
}

private void initAccessToken() {
Expand Down

0 comments on commit fd784b9

Please sign in to comment.