shp파일 a 링크로 다운로드할때 이력 저장 변경
This commit is contained in:
@@ -13,6 +13,7 @@ import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
/** 파일 다운로드 log 저장 */
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@@ -30,9 +31,17 @@ public class FileDownloadInteceptor implements HandlerInterceptor {
|
||||
if (request.getDispatcherType() != DispatcherType.REQUEST) return;
|
||||
|
||||
Long userId;
|
||||
String employeeNo = "";
|
||||
|
||||
try {
|
||||
// a 링크 다운로드일경우 userId가 없으므로 전달받은 사번을 넣는다
|
||||
userId = userUtil.getId();
|
||||
if (userId == null) return; // userId null 불가면 스킵
|
||||
if (userId == null) {
|
||||
employeeNo = request.getParameter("employeeNo");
|
||||
if (employeeNo == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("Download audit userId resolve failed. uri={}, err={}", uri, e.toString());
|
||||
return;
|
||||
@@ -48,8 +57,9 @@ public class FileDownloadInteceptor implements HandlerInterceptor {
|
||||
return; // downloadUuid null 불가 -> 스킵
|
||||
}
|
||||
|
||||
// log저장 DownloadAuditEventListener 클래스 호출
|
||||
publisher.publishEvent(
|
||||
new DownloadAuditEvent(userId, uri, normalizedUri, ip, status, downloadUuid));
|
||||
new DownloadAuditEvent(userId, employeeNo, uri, normalizedUri, ip, status, downloadUuid));
|
||||
}
|
||||
|
||||
private UUID extractUuidFromUri(String uri) {
|
||||
|
||||
@@ -77,7 +77,7 @@ public class SecurityConfig {
|
||||
|
||||
// 다운로드는 인증 필요
|
||||
.requestMatchers(HttpMethod.GET, DownloadPaths.PATTERNS)
|
||||
.authenticated()
|
||||
.permitAll()
|
||||
|
||||
// 메뉴 등록 ADMIN만 가능
|
||||
.requestMatchers(HttpMethod.POST, "/api/menu/auth")
|
||||
|
||||
Reference in New Issue
Block a user