feat: API 관리에서 API 호출 통제 내 API 목록 수정 건

main
thkim 2025-10-10 14:55:09 +09:00
commit 92bda42136
6 changed files with 150 additions and 104 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
/target
admin_list.txt
admin_list.txt
path.txt

View File

@ -1,90 +1,140 @@
@echo off
setlocal enabledelayedexpansion
rem # ----------------------------------------------------------------------
rem # 환경 설정: path.txt에서 이클립스 경로를 읽고 워크스페이스 경로를 설정합니다.
rem # ----------------------------------------------------------------------
set source_prefix=src\main\webapp\
set target_prefix=C:\Users\dbnt\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\geoinfo_admin\
set target_directory=C:\Users\dbnt\git\dbnt\geoinfo.or.kr\old-geoinfo-or-kr-admin\
rem # target_directory를 현재 배치 파일이 실행되는 경로로 설정합니다.
set "target_directory=%~dp0"
set "path_file=%target_directory%path.txt"
set "eclipse_path="
rem For 192.168.10.20
hostname | find "DESKTOP-9C42CR8" > nul
if %errorlevel% == 0 (
set target_prefix=D:\app_geoinfo\app\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\old-geoinfo-or-kr-admin\
set target_directory=D:\app_geoinfo\app\eclipse\workspace\old-geoinfo-or-kr-admin\
) else (
echo goodbye
rem # path.txt 파일이 존재하는지 확인합니다.
if not exist "%path_file%" (
echo [ERROR] "%path_file%"을 찾을 수 없습니다. 스크립트를 종료합니다.
pause
exit /b
)
rem # path.txt에서 'eclipse='로 시작하는 라인을 찾아 이클립스 경로를 설정합니다.
for /f "tokens=1,* delims==" %%a in ('findstr /b "eclipse=" "%path_file%"') do (
set "eclipse_path=%%b"
)
if not defined eclipse_path (
echo [ERROR] "%path_file%"에서 이클립스 경로를 찾을 수 없습니다.
pause
exit /b
)
rem # 이클립스 설정 파일 경로를 만듭니다.
set "prefs_file=!eclipse_path!\configuration\.settings\org.eclipse.ui.ide.prefs"
if not exist "!prefs_file!" (
echo [ERROR] Eclipse 설정 파일을 찾을 수 없습니다: "!prefs_file!"
pause
exit /b
)
rem # 설정 파일에서 최근 워크스페이스 목록을 읽어옵니다.
for /f "tokens=1,* delims==" %%a in ('findstr /b "RECENT_WORKSPACES=" "!prefs_file!"') do (
set "workspaces_line=%%b"
)
rem # \n을 공백으로 치환하여 여러 경로가 있을 경우 첫 번째 경로만 가져옵니다.
set "workspaces_line_cleaned=!workspaces_line:\n= !"
for /f "tokens=1" %%w in ("!workspaces_line_cleaned!") do (
set "workspace_path=%%w"
)
rem # 경로에 포함된 이스케이프 문자(\\)를 단일 백슬래시(\)로 변경합니다.
set "workspace_path=!workspace_path:\\=\!"
rem # 드라이브 경로 형식이 'D\:\'와 같이 잘못된 경우 'D:\'로 바로잡습니다.
set "drive_letter=!workspace_path:~0,1!"
if /i "!workspace_path:~1,2!" == "\:" (
set "workspace_path=!drive_letter!:!workspace_path:~3!"
)
rem # 최종 target_prefix를 설정합니다.
set "target_prefix=!workspace_path!\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\geoinfo_admin\"
explorer "!target_prefix!"
echo target_prefix: "!target_prefix!"
set "source_prefix=src\main\webapp\"
echo --- File Copy Script Start (Robust Version) ---
echo.
rem for 루프는 각 줄을 서브루틴으로 넘기는 역할만 수행
for /f "delims=" %%i in (admin_list.txt) do (
set line=%%i
if "!line:~-5!" == ".java" (
echo Skip
) else if "!line:~-4!" == ".xml" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
:: "src\main\resources\" Á¦°Å
set relative_path=!relative_path:*src\main\resources\=!
set target_file=%target_prefix%WEB-INF\classes\!relative_path!
) else if "!line:~-4!" == ".jsp" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-4!" == ".css" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-4!" == ".png" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-4!" == ".svg" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-3!" == ".js" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-4!" == ".svg" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-4!" == ".reb" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-4!" == ".png" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-6!" == ".woff2" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-5!" == ".woff" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-4!" == ".otf" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-11!" == ".properties" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
) else if "!line:~-4!" == ".gif" (
set source_file=%target_directory%!line!
set relative_path=!line:%source_prefix%=!
set target_file=%target_prefix%!relative_path!
)
rem Copy the source file to the target location, overwriting if necessary
echo Copying "!source_file!" to "!target_file!"
xcopy /i /Y "!source_file!" "!target_file!"
call :processLine "%%i"
)
rem pause
echo.
echo --- All operations completed. ---
pause
goto :eof
rem ======================================================
rem :processLine 서브루틴 - 실제 파일 처리 로직
rem ======================================================
:processLine
set "line=%~1"
rem 루프 시작 시 변수 초기화
set "source_file="
set "target_file="
set "relative_path="
rem #으로 시작하는 주석 라인 건너뛰기
if "!line:~0,1!" == "#" (
echo [SKIP] Comment: !line!
goto :eof
)
echo [PROCESS] !line!
rem .java 파일 건너뛰기
if "!line:~-5!" == ".java" (
echo [SKIP] Java source file.
goto :eof
)
set "source_file=%target_directory%!line!"
set "relative_path=!line:%source_prefix%=!"
rem .xml 파일은 WEB-INF\classes 경로로 처리
if "!line:~-4!" == ".xml" (
set "relative_path=!line:*src\main\resources\=!"
set "target_file=%target_prefix%WEB-INF\classes\!relative_path!"
) else (
rem 그 외 모든 파일 처리
set "target_file=%target_prefix%!relative_path!"
)
rem --- [수정된 부분] 파일 복사 실행 및 결과 출력 ---
if defined source_file (
if exist "!source_file!" (
echo [COPY]
echo FROM: "!source_file!"
echo TO: "!target_file!"
xcopy /i /Y "!source_file!" "!target_file!" > nul
rem xcopy 성공 여부 확인 (errorlevel이 0이면 성공)
if !errorlevel! == 0 (
echo -> SUCCESS
) else (
echo -> FAILED (Error Code: !errorlevel!)
)
) else (
echo [ERROR] Source file not found: "!source_file!"
)
)
echo.
goto :eof

1
SUCCESS Normal file
View File

@ -0,0 +1 @@
-

View File

@ -19,3 +19,4 @@ src\main\webapp\WEB-INF\views\admins\main\main.jsp
src\main\webapp\WEB-INF\views\admins\mgmtApi\api-request-statistics-index.jsp
src\main\webapp\WEB-INF\views\admins\mgmtApi\left.jsp
src\main\webapp\images\admins\mgmtApi\1_tit_01.gif
src\main\webapp\WEB-INF\views\admins\constructionProjectManagement\left.jsp

View File

@ -77,9 +77,11 @@ img { border:0; }
<div class="menu-item active">
<span style="cursor:hand" onClick="javascript:goUrl('construction-project-statistics-index', '${menuId}')"><img src="${pageContext.request.contextPath}/images/renew/arrow-right.png" /> &nbsp;건설현장 통계</span>
</div>
<div class="menu-item">
<span style="cursor:hand" onClick="javascript:goUrl('construction-project-statistics-index', '${menuId}')"><img src="${pageContext.request.contextPath}/images/renew/arrow-right.png" /> &nbsp;발주기관 계정</span>
</div>
</td>
</tr>
</table>
</td>
</tr>

View File

@ -195,8 +195,8 @@
<div class="switch-container" id="apiSwitchList">
<div class="api-switch">
<div>
<div class="switch-title">프로젝트 관련 데이터 갯수(전체 합)</div>
<div class="switch-desc">사용자 작업용 API</div>
<div class="switch-title">프로젝트 목록 조회</div>
<div class="switch-desc">TBL_PROJECT_INFO 테이블에서 검색 조건에 해당하는 레코드를 모두 검색</div>
</div>
<label class="mui-switch">
<input type="checkbox" class="api-toggle" data-api="api1" checked>
@ -206,8 +206,8 @@
<div class="api-switch">
<div>
<div class="switch-title">프로젝트 관련 데이터 갯수 (시추 개별)</div>
<div class="switch-desc">사용자 작업용 API</div>
<div class="switch-title">프로젝트 개수 조회</div>
<div class="switch-desc">TBL_PROJECT_INFO 테이블에서 검색 조건에 해당하는 레코드의 개수를 조회</div>
</div>
<label class="mui-switch">
<input type="checkbox" class="api-toggle" data-api="api2" checked>
@ -217,8 +217,8 @@
<div class="api-switch">
<div>
<div class="switch-title">시추정보 관련 데이터 갯수</div>
<div class="switch-desc">사용자 작업용 API</div>
<div class="switch-title">프로젝트 관련 하위 정보 개수 조회</div>
<div class="switch-desc">특정 프로젝트에 속한 각 테이블(물리탐사, 시추조사, 각종 시험 등)의 데이터 개수를 조회</div>
</div>
<label class="mui-switch">
<input type="checkbox" class="api-toggle" data-api="api3" checked>
@ -230,8 +230,8 @@
<div class="api-switch">
<div>
<div class="switch-title">사업(프로젝트)정보</div>
<div class="switch-desc">사용자 작업용 API</div>
<div class="switch-title">프로젝트 관련 하위 시추공 정보 개수 조회</div>
<div class="switch-desc">특정 프로젝트에 속한 전체 시추공의 시험정보 개수를 조회</div>
</div>
<label class="mui-switch">
<input type="checkbox" class="api-toggle" data-api="api4" checked>
@ -241,8 +241,8 @@
<div class="api-switch">
<div>
<div class="switch-title">지질정보</div>
<div class="switch-desc">사용자 작업용 API</div>
<div class="switch-title">지형 및 지 정보 조회</div>
<div class="switch-desc">TBL_TOPO_GEOLOGY 테이블에서 특정 프로젝트의 지형 및 지질 정보를 조회</div>
</div>
<label class="mui-switch">
<input type="checkbox" class="api-toggle" data-api="api5" checked>
@ -253,7 +253,7 @@
<div class="api-switch">
<div>
<div class="switch-title">전기비저항탐사시험</div>
<div class="switch-desc">사용자 작업용 API</div>
<div class="switch-desc">TBL_RESISTIVITY_SURVEY 테이블에서 특정 프로젝트의 전기 비저항 탐사 정보를 조회</div>
</div>
<label class="mui-switch">
<input type="checkbox" class="api-toggle" data-api="api6" checked>
@ -264,7 +264,7 @@
<div class="api-switch">
<div>
<div class="switch-title">굴절법탄성파</div>
<div class="switch-desc">사용자 작업용 API</div>
<div class="switch-desc">TBL_REFRACTION_SURVEY 테이블에서 특정 프로젝트의 굴절법 탐사 정보를 조회</div>
</div>
<label class="mui-switch">
<input type="checkbox" class="api-toggle" data-api="api7" checked>
@ -379,7 +379,7 @@
<th>응답결과</th>
</tr>
</thead>
<tbody>
<tbody id="apiLogBody">
<tr>
<td>/API_CHA_085/request</td>
<td>POST</td>
@ -538,16 +538,7 @@
pageData.forEach(row => {
const tr = document.createElement("tr");
tr.innerHTML = `
<td>${row.api}</td>
<td>${row.method}</td>
<td>${row.params}</td>
<td>${row.status}</td>
<td>${row.time}</td>
<td>
${getResultIcon(row.result)} ${row.result}
</td>
`;
tr.innerHTML += '<td>' + row.api + '</td><td>' + row.method + '</td><td>' + row.params + '</td><td>' + row.status + '</td><td>' + row.time + '</td><td>' + getResultIcon(row.result) + ' ' +row.result + '</td>';
tableBody.appendChild(tr);
});
}