Skip to content

Commit

Permalink
refactor : Infrastructure 의존성 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
GaBaljaintheroom committed Jun 9, 2024
1 parent 754672e commit 5c51539
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 10 deletions.
1 change: 0 additions & 1 deletion app/api/common-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ jar.enabled = true

dependencies {
implementation project(":app:domain:user-domain")
implementation project(":app:infrastructure")

// spring-security
implementation 'org.springframework.boot:spring-boot-starter-security'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package org.example.config;

import org.example.property.TokenProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(TokenProperty.class)
@ComponentScan(basePackages = "org.example")
public class CommonApiConfig {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.example.repository;

import org.springframework.stereotype.Component;

@Component
public interface RedisRepository {

void save(String userId, String refreshToken);
}
2 changes: 0 additions & 2 deletions app/api/user-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ dependencies {
implementation project(":app:domain:user-domain")

implementation project(":app:api:common-api")

implementation project(":app:infrastructure")
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package org.example.config;

import org.example.property.TokenProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import(UserDomainConfig.class)
@EnableConfigurationProperties(TokenProperty.class)
@ComponentScan(basePackages = "org.example")
public class UserApiConfig {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.example.repository;

import org.springframework.stereotype.Component;

@Component
public interface RedisRepository {

void save(String userId, String refreshToken);
}
7 changes: 5 additions & 2 deletions app/infrastructure/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
bootJar.enabled = false;
jar.enabled = true;
bootJar.enabled = false
jar.enabled = true

dependencies {
implementation project(":app:api:user-api")
implementation project(":app:api:common-api")

implementation "org.springframework.boot:spring-boot-starter-web"

//redis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

@Component
@RequiredArgsConstructor
public class RedisRepository {
public class LettuceRedisRepository implements RedisRepository {

private final StringRedisTemplate stringRedisTemplate;

public final void save(String userId, String refreshToken) {
public void save(String userId, String refreshToken) {
stringRedisTemplate.opsForValue().set("userId:" + userId, refreshToken, 14, TimeUnit.DAYS);
}

Expand Down

0 comments on commit 5c51539

Please sign in to comment.