first commit

This commit is contained in:
2025-11-12 15:53:31 +09:00
commit a2a9402270
22 changed files with 911 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package com.kri.common.web;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.slf4j.MDC;
import org.springframework.stereotype.Component;
@Aspect
@Component
public class ServiceMdcAspect {
@Around("within(@org.springframework.stereotype.Service *)")
public Object aroundService(ProceedingJoinPoint pjp) throws Throwable {
boolean first = (MDC.get("service") == null);
if (first) {
String cls = pjp.getSignature().getDeclaringType().getSimpleName(); // ex) ExportService
String mtd = pjp.getSignature().getName(); // ex) enqueue
MDC.put("service", cls + "#" + mtd); // ex) ExportService#enqueue
}
try {
return pjp.proceed();
} finally {
if (first) MDC.remove("service");
}
}
}