shp 파일생성 baseurl 설정 추가, 추론데이터 테이블 수정
This commit is contained in:
@@ -1,13 +1,12 @@
|
|||||||
package com.kamco.cd.kamcoback.auth;
|
package com.kamco.cd.kamcoback.auth;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.enums.RoleType;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MenuEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MenuEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.menu.MenuRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.menu.MenuRepository;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
import org.springframework.security.authorization.AuthorizationDecision;
|
import org.springframework.security.authorization.AuthorizationDecision;
|
||||||
import org.springframework.security.authorization.AuthorizationManager;
|
import org.springframework.security.authorization.AuthorizationManager;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
@@ -24,8 +23,6 @@ import org.springframework.stereotype.Component;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class MenuAuthorizationManager implements AuthorizationManager<RequestAuthorizationContext> {
|
public class MenuAuthorizationManager implements AuthorizationManager<RequestAuthorizationContext> {
|
||||||
|
|
||||||
private static final Logger log = LogManager.getLogger(MenuAuthorizationManager.class);
|
|
||||||
|
|
||||||
private final MenuRepository menuAuthQueryRepository;
|
private final MenuRepository menuAuthQueryRepository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -45,7 +42,7 @@ public class MenuAuthorizationManager implements AuthorizationManager<RequestAut
|
|||||||
return new AuthorizationDecision(false);
|
return new AuthorizationDecision(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isAdmin = "ADMIN".equalsIgnoreCase(role);
|
boolean isAdmin = RoleType.ADMIN.getId().equalsIgnoreCase(role);
|
||||||
|
|
||||||
// URL별 권한 조회
|
// URL별 권한 조회
|
||||||
List<MenuEntity> matchedMenus = menuAuthQueryRepository.findMenusByRequestPath(requestPath);
|
List<MenuEntity> matchedMenus = menuAuthQueryRepository.findMenusByRequestPath(requestPath);
|
||||||
@@ -72,12 +69,12 @@ public class MenuAuthorizationManager implements AuthorizationManager<RequestAut
|
|||||||
return new AuthorizationDecision(false);
|
return new AuthorizationDecision(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 3) 보호 URL이 아니면 ADMIN은 전부 허용
|
// ADMIN은 전부 허용
|
||||||
if (isAdmin) {
|
if (isAdmin) {
|
||||||
return new AuthorizationDecision(true);
|
return new AuthorizationDecision(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 4) 일반 role은 기존대로 매핑 기반
|
// 일반 role은 기존대로 매핑 기반
|
||||||
List<MenuEntity> allowedMenus = menuAuthQueryRepository.findAllowedMenuUrlsByRole(role);
|
List<MenuEntity> allowedMenus = menuAuthQueryRepository.findAllowedMenuUrlsByRole(role);
|
||||||
if (allowedMenus == null || allowedMenus.isEmpty()) {
|
if (allowedMenus == null || allowedMenus.isEmpty()) {
|
||||||
return new AuthorizationDecision(false);
|
return new AuthorizationDecision(false);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.kamco.cd.kamcoback.inference.dto.WriteCnt;
|
|||||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultShpCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.InferenceResultShpCoreService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -16,6 +17,9 @@ public class InferenceResultShpService {
|
|||||||
private final InferenceResultShpCoreService coreService;
|
private final InferenceResultShpCoreService coreService;
|
||||||
private final ShpWriter shpWriter;
|
private final ShpWriter shpWriter;
|
||||||
|
|
||||||
|
@Value("${mapsheet.shp.baseurl}")
|
||||||
|
private String baseDir;
|
||||||
|
|
||||||
/** inference_results 테이블을 기준으로 분석 결과 테이블과 도형 테이블을 최신 상태로 반영한다. */
|
/** inference_results 테이블을 기준으로 분석 결과 테이블과 도형 테이블을 최신 상태로 반영한다. */
|
||||||
@Transactional
|
@Transactional
|
||||||
public InferenceResultShpDto.InferenceCntDto saveInferenceResultData() {
|
public InferenceResultShpDto.InferenceCntDto saveInferenceResultData() {
|
||||||
@@ -33,9 +37,6 @@ public class InferenceResultShpService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public InferenceResultShpDto.FileCntDto createShpFile() {
|
public InferenceResultShpDto.FileCntDto createShpFile() {
|
||||||
|
|
||||||
// TODO 파일 경로는 정해지면 수정, properties 사용
|
|
||||||
String baseDir = "/app/detect/result";
|
|
||||||
|
|
||||||
// TODO 배치 실행으로 변경 필요
|
// TODO 배치 실행으로 변경 필요
|
||||||
int batchSize = 100;
|
int batchSize = 100;
|
||||||
int geomLimit = 500_000;
|
int geomLimit = 500_000;
|
||||||
|
|||||||
@@ -146,4 +146,10 @@ public class MapSheetAnalDataInferenceGeomEntity {
|
|||||||
|
|
||||||
@Column(name = "file_created_dttm")
|
@Column(name = "file_created_dttm")
|
||||||
private ZonedDateTime fileCreatedDttm;
|
private ZonedDateTime fileCreatedDttm;
|
||||||
|
|
||||||
|
@Column(name = "pass_yn")
|
||||||
|
private Boolean passYn;
|
||||||
|
|
||||||
|
@Column(name = "pass_yn_dttm")
|
||||||
|
private ZonedDateTime passYnDttm;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,4 +73,6 @@ logging:
|
|||||||
mapsheet:
|
mapsheet:
|
||||||
upload:
|
upload:
|
||||||
skipGdalValidation: true
|
skipGdalValidation: true
|
||||||
|
shp:
|
||||||
|
baseurl: /app/detect/result
|
||||||
|
|
||||||
|
|||||||
@@ -53,3 +53,9 @@ token:
|
|||||||
springdoc:
|
springdoc:
|
||||||
swagger-ui:
|
swagger-ui:
|
||||||
persist-authorization: true # 스웨거 새로고침해도 토큰 유지, 로컬스토리지에 저장
|
persist-authorization: true # 스웨거 새로고침해도 토큰 유지, 로컬스토리지에 저장
|
||||||
|
|
||||||
|
mapsheet:
|
||||||
|
upload:
|
||||||
|
skipGdalValidation: true
|
||||||
|
shp:
|
||||||
|
baseurl: /Users/bokmin/detect/result
|
||||||
|
|||||||
@@ -30,5 +30,9 @@ token:
|
|||||||
refresh-cookie-name: kamco # 개발용 쿠키 이름
|
refresh-cookie-name: kamco # 개발용 쿠키 이름
|
||||||
refresh-cookie-secure: true # 로컬 http 테스트면 false
|
refresh-cookie-secure: true # 로컬 http 테스트면 false
|
||||||
|
|
||||||
|
mapsheet:
|
||||||
|
upload:
|
||||||
|
skipGdalValidation: true
|
||||||
|
shp:
|
||||||
|
baseurl: /app/detect/result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user