Skip to content

Commit 64f594a

Browse files
committed
AOP 환경 세팅
1 parent ff5085e commit 64f594a

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,3 +306,5 @@ private Claims getPayloadFromJwtToken(String token) {
306306
return claims;
307307
}
308308
```
309+
310+
3.**AOP 적용하여 메타데이터 생성하기**

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ dependencies {
3030
implementation 'org.springframework.boot:spring-boot-starter-web'
3131
implementation 'org.springframework.boot:spring-boot-starter-security'
3232
implementation 'org.springframework.boot:spring-boot-starter-logging' // Spring Boot 로깅 스타터 (SLF4J와 Logback 포함)
33-
33+
implementation 'org.springframework.boot:spring-boot-starter-aop' // aop 추가
34+
3435
developmentOnly 'org.springframework.boot:spring-boot-devtools'
3536

3637
// Lombok
38+
3739
compileOnly 'org.projectlombok:lombok'
3840
annotationProcessor 'org.projectlombok:lombok'
3941

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.develop.backend.aspect;
2+
3+
import org.aspectj.lang.annotation.Aspect;
4+
5+
/**
6+
* <p>
7+
* 사용자 정보 CMMaster 사전 세팅
8+
* </p>
9+
* <p>
10+
* Controller 진입 전 단계에 해당
11+
* </p>
12+
*
13+
* @author gyeongwooPark
14+
* @version 1.0
15+
* @since 2024.07
16+
*/
17+
@Aspect
18+
public class UserAspect {
19+
20+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.develop.backend.fw.master;
2+
3+
import lombok.Data;
4+
5+
/**
6+
* <p>
7+
* 비즈니스 처리 시 공통으로 확장 받아야 하는 vo 객체
8+
* DB 메타데이터로 등록 될 데이터
9+
* </p>
10+
*
11+
* @author gyeongwooPark
12+
* @version 1.0
13+
* @since 2024.07
14+
*/
15+
@Data
16+
public class CMMaster {
17+
18+
// 사용자 ID
19+
private String userId;
20+
// 사용자 IP
21+
private String userIp;
22+
}

0 commit comments

Comments
 (0)