Merge branch 'dev' into deploy-dev-admin

This commit is contained in:
kangsunlee
2025-07-15 17:41:40 +09:00
34 changed files with 386 additions and 288 deletions

View File

@@ -10,9 +10,6 @@ import org.springframework.validation.Validator;
@Component
public class AdminUpdateValidator implements Validator {
// 비밀번호: 5자, 숫자 + 특수문자(!@#$%_-) 1개 이상
private final String PASSWORD_REGEX = "^(?=.*[0-9])(?=.*[!@#$%_\\-]).{5}$";
@Override
public boolean supports(Class<?> clazz) {
return AdminUpdateBindingVO.class.equals(clazz);
@@ -66,11 +63,5 @@ public class AdminUpdateValidator implements Validator {
errors.rejectValue("regionMainCode", "valid.common.required","필수입력항목을 확인해주세요.");
}
});
// [2] 비밀번호 형식 검사
if (!vo.getUpdatePassword().matches(PASSWORD_REGEX)) {
errors.rejectValue("updatePassword", "valid.common.password.wrong",
"비밀번호는 5자, 숫자 + 특수문자(!@#$%_-) 1개 이상입니다.");
}
}
}

View File

@@ -1,32 +1,17 @@
# ==============================================
# 애플리케이션 로깅 설정
# ==============================================
logging:
file:
# 로그 파일 저장 경로 (사용자 홈 디렉토리 내 logs 폴더)
# ${user.home}은 시스템 사용자 홈 디렉토리를 가리킵니다
path: ${user.home}/logs
level:
# 애플리케이션 기본 패키지 로깅 레벨 설정 (DEBUG로 설정됨)
# 중요: 실제 애플리케이션 기본 패키지 경로로 변경해야 정상 작동합니다
app.module: DEBUG
# Spring 프레임워크 코어 로깅 레벨 (INFO 로 설정)
org.springframework: INFO
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
spring:
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
messages:
# 메시지 소스 캐시 지속 시간(초)
# 4초마다 메시지 파일을 다시 읽어옵니다
# 개발 시에는 짧은 간격으로, 운영 시에는 길게 설정하는 것이 일반적
cache-duration: 10s
thymeleaf:
# 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
cache: false
# ==============================================
# 타임리프 설정
# ==============================================
thymeleaf:
cache: false # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
# ==============================================
# 데이터베이스 설정
# ==============================================
@@ -44,6 +29,14 @@ spring:
maximum-pool-size: 2
minimum-idle: 1
# ==============================================
# 로깅 설정
# ==============================================
logging:
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 암호화 설정
# ==============================================

View File

@@ -1,29 +1,15 @@
# ==============================================
# 애플리케이션 로깅 설정
# ==============================================
logging:
file:
# 로그 파일 저장 경로 (시스템 사용자 홈 디렉토리 하위 logs 폴더)
path: ${user.home}/logs
level:
# 애플리케이션 기본 패키지 로깅 레벨 (INFO 로 설정)
# 주의: 기본 패키지 변경 시 app.module 부분을 반드시 수정해야 애플리케이션 로그가 출력됨
app.module: DEBUG
# Spring 프레임워크 로깅 레벨
org.springframework: INFO
# Spring Security 로깅 레벨
org.springframework.security: INFO
# ==============================================
# 메시지 및 다국어 처리 설정
# ==============================================
spring:
# ==============================================
# 메시지 및 다국어 처리 설정
# ==============================================
messages:
# 메시지 캐시 지속 시간(초)
cache-duration: 10s
# ==============================================
# 타임리프 설정
# ==============================================
thymeleaf:
# 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
cache: false
cache: false # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
# ==============================================
# 데이터베이스 설정
# ==============================================
@@ -40,13 +26,18 @@ spring:
password: hyunjoo1@#4
maximum-pool-size: 2
minimum-idle: 1
hikari:
maximum-pool-size: 10
minimum-idle: 5
idle-timeout: 120000
max-lifetime: 900000
connection-timeout: 5000
leak-detection-threshold: 30000
# ==============================================
# 로깅 설정
# ==============================================
logging:
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# Spring Bean 등록 과정도 확인
org.springframework.beans.factory.support.DefaultListableBeanFactory: DEBUG
org.apache.ibatis: TRACE
org.mybatis.spring: TRACE
# ==============================================
# 암호화 설정

View File

@@ -1,25 +1,12 @@
# ==============================================
# 애플리케이션 로깅 설정
# ==============================================
logging:
file:
# 로그 파일 저장 위치 (사용자 홈 디렉토리 내 logs 폴더)
# ${user.home}은 시스템의 사용자 홈 디렉토리를 참조합니다
path: ${user.home}/logs
level:
# 애플리케이션 기본 패키지 로깅 레벨 (INFO 레벨로 설정)
# 주의: 실제 애플리케이션의 기본 패키지 경로로 변경해야 합니다
app.module: INFO
# Spring Framework 코어 모듈 로깅 레벨 (INFO 레벨로 설정)
org.springframework: INFO
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
spring:
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
messages:
# 메시지 소스 캐시 지속 시간 (단위: 초)
# 개발 환경에서는 짧은 간격(10-60초), 운영 환경에서는 긴 간격(3600초 이상) 권장
cache-duration: 5m
# ==============================================
# 데이터베이스 설정
# ==============================================
datasource:
@@ -35,8 +22,9 @@ spring:
password: ENC(kUIzqWTu0+bqjYH4Jq9TFOOh3UwY+XVvA2OlT4VXJvxWCas66UNdGRmWDQKri5fI)
maximum-pool-size: 2
minimum-idle: 1
# ==============================================
# 서버 압축 설정
# 세션 설정
# ==============================================
server:
servlet:

View File

@@ -1,7 +1,7 @@
# ==============================================
# 메세지 및 다국어 처리 설정
# ==============================================
spring:
# ==============================================
# 메세지 및 다국어 처리 설정
# ==============================================
messages:
# 다국어 메시지 파일 위치 설정 (쉼표로 구분)
basename: messages/message,messages/exception,messages/validation,messages/uri,messages/operation,messages/security-message,messages/operation-log
@@ -36,11 +36,6 @@ spring:
enabled: true
# 버저닝 적용 경로
paths: /**
# ==============================================
# 타임리프 설정
# ==============================================
thymeleaf: # 타임리프 템플릿 캐시 비활성화 (개발시 false 권장)
cache: false
# ==============================================
# 서버 압축 설정
@@ -90,6 +85,9 @@ app:
# 로깅 설정
# ==============================================
logging:
file:
# 로그 파일 저장 경로 (시스템 사용자 홈 디렉토리 하위 logs 폴더)
path: ${user.home}/logs
level:
org:
hibernate:
@@ -97,16 +95,10 @@ logging:
jdbc:
# Hibernate SQL 파라미터 바인딩 값 로깅 레벨
bind: trace
app.module: DEBUG
org.springframework: INFO
org.apache.ibatis: TRACE
org.mybatis.spring: TRACE
# Spring Bean 등록 과정도 확인
org.springframework.beans.factory.support.DefaultListableBeanFactory: DEBUG
file:
# 로그 파일 저장 경로
path: ${user.home}/logs
# Spring Framework 코어 모듈 로깅 레벨 (INFO 레벨로 설정)
springframework: INFO
app:
module: INFO # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# MyBatis 설정
@@ -117,3 +109,11 @@ mybatis:
mms: classpath*:mappers/mms/*Mapper.xml # 매퍼 파일 위치
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # SQL 로깅 구현체
# ==============================================
# 암호화 설정
# ==============================================
jasypt:
encryptor:
password: #별도관리
algorithm: #별도관리

View File

@@ -24,18 +24,10 @@
region_sub_code,
region_detail_code,
address,
<if test="industryLargeCode != null and industryLargeCode != ''">
industry_large_code,
</if>
<if test="industryMiddleCode != null and industryMiddleCode != ''">
industry_middle_code,
</if>
<if test="industrySubMiddle != null and industrySubMiddle != ''">
industry_sub_middle,
</if>
<if test="industryDetail != null and industryDetail != ''">
industry_detail,
</if>
is_panel,
usage_type,
employment_type,

View File

@@ -18,18 +18,10 @@
region_sub_code = #{regionSubCode},
region_detail_code = #{regionDetailCode},
address = #{address},
<if test="industryLargeCode != null and industryLargeCode != ''">
industry_large_code = #{industryLargeCode},
</if>
<if test="industryMiddleCode != null and industryMiddleCode != ''">
industry_middle_code = #{industryMiddleCode},
</if>
<if test="industrySubMiddle != null and industrySubMiddle != ''">
industry_sub_middle = #{industrySubMiddle},
</if>
<if test="industryDetail != null and industryDetail != ''">
industry_detail = #{industryDetail},
</if>
is_panel = #{isPanel},
<if test="usageType != null and usageType != ''">
usage_type = #{usageType},

View File

@@ -342,9 +342,15 @@
) AS hvr
<where>
1=1
<if test="cmd.ownerField != null and cmd.ownerField != ''">
<if test="cmd.ownerValue != null and cmd.ownerValue != ''">
/* 경영주 검색 */
<choose>
<when test="cmd.ownerField == ''">
AND (
hvr.householdName ILIKE '%' || #{cmd.ownerValue} || '%'
OR hvr.householdPhone ILIKE '%' || #{cmd.ownerValue} || '%'
)
</when>
<when test="cmd.ownerField eq 'name'">
AND hvr.householdName ILIKE '%' || #{cmd.ownerValue} || '%'
</when>

View File

@@ -492,8 +492,9 @@ const setSelectBoxUiCode = ({
codeList,
parentSelector,
childSelector,
defaultOptionText = '전체',
selectedParentCode = '',
selectedChildCode = ''
selectedChildCode = '',
}) => {
const $parent = $(parentSelector);
const $child = $(childSelector);
@@ -501,16 +502,20 @@ const setSelectBoxUiCode = ({
if (!codeList?.nodes || !$parent.length || !$child.length) return;
const renderOptions = ($el, list, selected) => {
$el.html('<option value="">전체</option>');
$el.html(`<option value="">${defaultOptionText}</option>`);
list.forEach(item => {
const val = item.id.split('.').pop();
const isSelected = item.id === selected ? 'selected' : '';
$el.append(`<option value="${item.id}" ${isSelected}>${val}. ${item.codeText}</option>`);
});
if (selected) {
$el.val(selected);
}
};
const loadChildren = (parentId, selectedChild = '') => {
$child.html('<option value="">전체</option>');
$child.html(`<option value="">${defaultOptionText}</option>`);
if (!parentId) return;
const parent = codeList.nodes.find(n => n.id === parentId);

View File

@@ -168,7 +168,6 @@
<th:block th:each="item, status : ${menuHierarchy}">
<a th:if="${status.first}" th:href="${item.uri}" >홈</a>
<a th:if="${!status.first and item.id != currentURI.id}"
th:href="${item.uri}"
th:text="${@coreUtil.getUriTitle(item)}"></a>
<span th:if="${!status.first and item.id == currentURI.id}" th:text="${@coreUtil.getUriTitle(item)}" ></span>
</th:block>

View File

@@ -10,7 +10,7 @@
<div class="modal-header">
<h3 class="modal-tit" >임가 매핑</h3>
</div>
<form autocomplete="off" method="get" name="reqHouseholdForm" id="reqHouseholdForm">
<form autocomplete="off" method="get" name="reqHouseholdForm" id="reqHouseholdForm" onsubmit="return false;">
<div class="modal-content">
<div class="modal-content-inner">
<section class="filter-wrap">
@@ -34,7 +34,8 @@
</div>
<div class="component-input">
<div class="input-field">
<input type="text" id="ownerValue" name="ownerValue" placeholder="입력" th:value="${ownerValue}">
<input type="text" id="ownerValue" name="ownerValue" placeholder="입력" th:value="${ownerValue}"
onkeydown="if(event.key === 'Enter'){ event.preventDefault(); initSearchHousehold(); }">
</div>
</div>
</div>
@@ -94,7 +95,7 @@
<button type="button" class="btn" onclick="resetSearchForm()">
<span class="btn-txt">초기화</span>
</button>
<button type="button" class="btn btn-primary" th:onclick="|searchHouseholdList(0,${regionMainCode})|">
<button type="button" class="btn btn-primary" onclick="initSearchHousehold();">
<span class="btn-txt">검색</span>
</button>
</div>
@@ -161,6 +162,7 @@
codeList: regionList,
parentSelector: '#regionSubCode',
childSelector: '#regionDetailCode',
defaultOptionText: '전체'
});
document.querySelector(".modal01").ui.open();
@@ -178,6 +180,8 @@
$('#isPanel').val('');
$('#searchMapping').val('');
$('#ownerValue').val('');
initSearchHousehold();
};
const searchHouseholdList = (pageNo,regionMainCode) => {
@@ -214,6 +218,16 @@
</tr>
`);
});
// nodata 처리
if (!$(response.content).length) {
tbody.append(`
<tr>
<td colspan="8" class="text-center text-muted">임가정보가 존재하지 않습니다.</td>
</tr>
`);
}
// Pagination 구성하기
const paging = $('.mapping-paging');
paging.empty();
@@ -271,6 +285,11 @@
);
}
};
const initSearchHousehold = () => {
const regionMainCode = document.querySelector('[name="regionMainCode"]')?.value || '';
searchHouseholdList(0, regionMainCode);
};
</script>
</div>
</html>

View File

@@ -121,7 +121,7 @@
<td>
<div class="component-select">
<select class="select-list" name="regionMainCode" required>
<option value="">전체</option>
<option value="">선택</option>
<option th:each="item : ${regionMainList}"
th:value="${item.id}"
th:text="${item.codeText}">
@@ -132,7 +132,7 @@
<td>
<div class="component-select">
<select class="select-list" name="regionSubCode" id="regionSubCode" required>
<option value="">전체</option>
<option value="">선택</option>
</select>
</div>
</td>
@@ -140,7 +140,7 @@
<td>
<div class="component-select">
<select class="select-list" name="regionDetailCode" id="regionDetailCode" required>
<option value="">전체</option>
<option value="">선택</option>
</select>
</div>
</td>
@@ -160,7 +160,7 @@
<td>
<div class="component-select">
<select class="select-list" name="industryLargeCode" id="industryLargeCode">
<option value="">전체</option>
<option value="">선택</option>
</select>
</div>
</td>
@@ -168,7 +168,7 @@
<td>
<div class="component-select">
<select class="select-list" name="industryMiddleCode" id="industryMiddleCode">
<option value="">전체</option>>
<option value="">선택</option>>
</select>
</div>
</td>
@@ -320,7 +320,8 @@
setSelectBoxUiCode({
codeList: regionList,
parentSelector: '#regionSubCode',
childSelector: '#regionDetailCode'
childSelector: '#regionDetailCode',
defaultOptionText: '선택'
});
// 업종 대분류, 중분류 셀렉트박스 세팅
@@ -328,6 +329,7 @@
codeList: industryLargeList,
parentSelector: '#industryLargeCode',
childSelector: '#industryMiddleCode',
defaultOptionText: '선택'
});
});
</script>

View File

@@ -307,22 +307,27 @@
$(document).ready(function () {
// 지역, 세부지역 셀렉트박스 세팅
setSelectBoxUiCode({
setSelectBoxUiCode({
codeList: regionList,
parentSelector: '#regionSubCode',
childSelector: '#regionDetailCode',
defaultOptionText: '전체',
selectedParentCode: selectedRegionSubCode,
selectedChildCode: selectedRegionDetailCode
});
// 업종 대분류, 중분류 셀렉트박스 세팅
setSelectBoxUiCode({
codeList: industryLargeList,
parentSelector: '#industryLargeCode',
childSelector: '#industryMiddleCode',
selectedParentCode: selectedIndustryLargeCode,
selectedChildCode: selectedIndustryMiddleCode
});
// 업종 대분류, 중분류 셀렉트박스 세팅
setSelectBoxUiCode({
codeList: industryLargeList,
parentSelector: '#industryLargeCode',
childSelector: '#industryMiddleCode',
defaultOptionText: '전체',
selectedParentCode: selectedIndustryLargeCode,
selectedChildCode: selectedIndustryMiddleCode
});
// 최초 리스트 로드
getHouseholds(document.reqForm.page.value);
});
</script>
@@ -409,9 +414,6 @@
'json'
);
}
// 최초 리스트 로드
getHouseholds(document.reqForm.page.value);
</script>
<script th:inline="javascript">

View File

@@ -191,9 +191,6 @@
<h3>지출 <strong>(<span id="expenseCount">0</span>건)</strong></h3>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button type="button" class="btn small">
<span class="btn-txt">영수증 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
</button>
<button type="button" class="btn small">
<span class="btn-txt">
<label class="radio-inner">
@@ -425,7 +422,11 @@
// 일계부 등록 현황 상세
const getDailyRecordsView = (id, groupNo, dayGroupText) => {
if (id == null) {
showDailyCreateConfirm(groupNo);
if ($('.underline:contains("' + dayGroupText + '")').parent().find('.tag').text().indexOf('대기') === -1) {
showDailyCreateConfirm(groupNo);
} else {
alert('등록된 내역이 없습니다.');
}
return;
}

View File

@@ -313,7 +313,7 @@
<div class="input-textarea-field">
<textarea id="memo" name="memo" class="textarea"
placeholder=""
th:value="${householdInfo.memo}"></textarea>
th:text="${householdInfo.memo}"></textarea>
</div>
</div>
</td>
@@ -353,6 +353,7 @@
codeList: regionList,
parentSelector: '#regionSubCode',
childSelector: '#regionDetailCode',
defaultOptionText: '선택',
selectedParentCode: selectedRegionSubCode,
selectedChildCode: selectedRegionDetailCode
});
@@ -362,6 +363,7 @@
codeList: industryLargeList,
parentSelector: '#industryLargeCode',
childSelector: '#industryMiddleCode',
defaultOptionText: '선택',
selectedParentCode: selectedIndustryLargeCode,
selectedChildCode: selectedIndustryMiddleCode
});

View File

@@ -64,7 +64,7 @@
</div>
<div class="component-btns">
<div class="btns-row">
<button type="button" class="btn" onclick="goInit();">
<button type="button" class="btn" onclick="location.href = location.pathname">
<span class="btn-txt">초기화</span>
</button>
<button type="button" class="btn btn-primary" onclick="goSearch();" >

View File

@@ -31,7 +31,7 @@
</div>
<div class="component-input">
<div class="input-field">
<input type="password" id="floatingPassword" name="password" placeholder="비밀번호 입력">
<input type="password" id="floatingPassword" name="password" placeholder="비밀번호 입력" maxlength="5">
</div>
</div>
</div>

View File

@@ -38,7 +38,7 @@ class DownloadFileController {
// 로컬 파일 경로
File downloadedFile = new File(file.getLocalPath());
if (!downloadedFile.exists()) {
throw new IllegalStateException("Downloaded file not found: " + file.getLocalPath());
throw new IllegalStateException("파일 다운로드에 실패하였습니다.");
}

View File

@@ -41,7 +41,7 @@ class UpdateFileDao implements UpdateFilePortOut {
command.getType().getName()
)));
for (UploadFileDto file : deletedFileList) {
/* for (UploadFileDto file : deletedFileList) {
try {
sftpFileDeleteUtil.deleteRealFile(file);
} catch (JSchException | SftpException e) {
@@ -51,7 +51,7 @@ class UpdateFileDao implements UpdateFilePortOut {
log.error("Unexpected error while deleting file for mapping ID {}: {}", file.getId(), e.getMessage(), e);
throw new RuntimeException("Unexpected error while deleting file", e);
}
}
}*/
if (!deletedFileList.isEmpty()) {
mapper.deleteFile(

View File

@@ -18,7 +18,7 @@ public class SftpFileUrlStrategy implements FileUrlStrategy {
@Override
public String getAttachmentURL(Long fileId) {
return String.format("/api/file/download/%s", fileId);
return String.format("/content-disposition/attachment/%s", fileId);
}
}

View File

@@ -1,27 +1,42 @@
package app.module.core.usecase.getAttachment.adapters.web;
import app.module.core.config.application.enums.FileStorageType;
import app.module.core.config.application.util.SftpFileDownloader;
import app.module.core.usecase.file.getFile.ports.GetFilePortIn;
import app.module.core.usecase.file.getFile.ports.application.domain.GetFile;
import app.module.core.usecase.file.getFile.ports.application.domain.GetFileCmd;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.SftpException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.UrlResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.util.UriUtils;
@Slf4j
@RestController
@RequiredArgsConstructor
class GetAttachmentController {
private final GetFilePortIn getFilePortIn;
private final SftpFileDownloader sftpFileDownloader;
@Value("${path.upload.public}")
private String publicPath;
@Value("${app.aws.s3.domain:null}")
@@ -34,11 +49,14 @@ class GetAttachmentController {
@GetMapping(path = "/content-disposition/attachment/{fileId}")
ResponseEntity<?> operate(@PathVariable Long fileId) throws MalformedURLException {
GetFile getFile =
getFilePortIn
.operate(new GetFileCmd(fileId))
.orElseThrow(
() -> new RuntimeException(String.format("파일을 찾을 수 없습니다. ID: %s", fileId)));
GetFile getFile;
try {
getFile = getFilePortIn.operate(new GetFileCmd(fileId))
.orElseThrow(() -> new RuntimeException(String.format("파일을 찾을 수 없습니다. ID: %s", fileId)));
} catch (RuntimeException e) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body("파일을 찾을 수 없습니다: " + e.getMessage());
}
// TODO - private 업로드 기능을 일단 mute
@@ -56,35 +74,74 @@ class GetAttachmentController {
// () -> new AccessDeniedException("[AccessDenied] Private 파일 리소스 접근 권한이 없습니다."));
// }
// HTTP 헤더 설정
String encodedFileName = URLEncoder.encode(getFile.getOriginName(), StandardCharsets.UTF_8)
.replace("+", "%20");
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename*=UTF-8''" + encodedFileName);
headers.add(HttpHeaders.CACHE_CONTROL, "no-cache, no-store, must-revalidate");
headers.add(HttpHeaders.PRAGMA, "no-cache");
headers.add(HttpHeaders.EXPIRES, "0");
UrlResource resource = null;
switch (FileStorageType.valueOf(uploadStorageType)) {
case LOCAL:
String filePath =
Paths.get(publicPath, getFile.getPath(), getFile.getName())
.toString();
String filePath = Paths.get(publicPath, getFile.getPath(), getFile.getName()).toString();
File localFile = new File(filePath);
if (!localFile.exists()) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body("파일을 찾을 수 없습니다: ");
}
return ResponseEntity.ok()
.headers(headers)
.contentLength(localFile.length())
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(new FileSystemResource(localFile));
resource = new UrlResource("file:" + filePath);
break;
case S3:
resource =
new UrlResource(
"https://"
+ cloudFrontDomain
+ bucketFolder
+ getFile.getPath()
+ "/"
+ getFile.getName());
break;
String s3Url = "https://" + cloudFrontDomain + bucketFolder + getFile.getPath() + "/" + getFile.getName();
UrlResource s3Resource = new UrlResource(s3Url);
if (!s3Resource.exists()) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body("S3 파일을 찾을 수 없습니다: " + s3Url);
}
return ResponseEntity.ok()
.headers(headers)
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(s3Resource);
case SFTP:
try {
sftpFileDownloader.downloadFile(getFile);
} catch (JSchException | SftpException | IOException e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("SFTP 파일 다운로드에 실패했습니다: " + e.getMessage());
}
File downloadedFile = new File(getFile.getLocalPath());
if (!downloadedFile.exists()) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body("다운로드된 파일을 찾을 수 없습니다: " + getFile.getLocalPath());
}
return ResponseEntity.ok()
.headers(headers)
.contentLength(downloadedFile.length())
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(new FileSystemResource(downloadedFile));
default:
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body("지원되지 않는 저장소 타입입니다: " + uploadStorageType);
}
String encodedUploadFileName = UriUtils.encode(getFile.getOriginName(),
/* String encodedUploadFileName = UriUtils.encode(getFile.getOriginName(),
StandardCharsets.UTF_8);
String contentDisposition = "attachment; filename=\"" + encodedUploadFileName + "\"";
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, contentDisposition)
.body(resource);
.body(resource);*/
}
}

View File

@@ -2,9 +2,11 @@ package app.module.front.config.application.security;
import java.util.Collection;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
@Setter
@Getter
public class FrontHouseholdUser extends User {

View File

@@ -10,6 +10,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.util.HtmlUtils;
import java.util.List;
import java.util.Optional;
@@ -29,6 +30,11 @@ class GetNoticeDao implements GetNoticePortOut {
@Transactional
public Optional<GetNotice> operate(GetNoticeCmd command) {
GetNotice secArticle = mapper.getNotice(command);
if (secArticle.getContent() != null) {
String cleanedContent = HtmlUtils.htmlUnescape(secArticle.getContent());
cleanedContent = cleanedContent.replaceAll("<p>\\s*</p>", "</br>");
secArticle.setContent(cleanedContent);
}
List<GetNoticeUploadFile> setArticleUploadFile =
mapper.getUploadFiles(command.getId());

View File

@@ -20,7 +20,7 @@ class GetNoticesUIController {
private final GetNoticesPortIn getNoticesPortIn;
@GetMapping(path = "/info/notice")
String operate(Model model, @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC, page = 0, size = 5) Pageable pageable
String operate(Model model, @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC, page = 0, size = 10) Pageable pageable
, GetNoticesReqVO reqVO) {
reqVO.setSearchOpen("true");

View File

@@ -3,6 +3,7 @@ package app.module.front.usecase.info.userUI.updateUserUI.adapters.web;
import app.module.core.config.application.util.CommonUtil;
import app.module.core.config.application.util.CoreUtil;
import app.module.front.config.application.response.ApiResponse;
import app.module.front.config.application.security.FrontHouseholdUser;
import app.module.front.usecase.info.userFront.getUserFront.ports.GetUserFrontPortIn;
import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFront;
import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFrontCmd;
@@ -14,6 +15,9 @@ import app.module.front.usecase.info.userUI.updateUserUI.adapters.web.model.Upda
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
@@ -45,6 +49,10 @@ class UpdateUserController {
getHousehold.getOwnerName(),
"PERSONAL"
));
Authentication currentAuth = SecurityContextHolder.getContext().getAuthentication();
FrontHouseholdUser householdUser = (FrontHouseholdUser) currentAuth.getPrincipal();
householdUser.setOwnerName(reqVO.getOwnerName());
}
updateUserPortIn.operate(new UpdateUserFrontCmd(
getHousehold.getSeq(),

View File

@@ -1,25 +1,17 @@
# ==============================================
# 로깅 설정
# ==============================================
logging:
file:
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
spring:
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
messages:
# 메시지 소스 캐시 지속 시간(초)
# 4초마다 메시지 파일을 다시 읽어옵니다
# 개발 시에는 짧은 간격으로, 운영 시에는 길게 설정하는 것이 일반적
cache-duration: 10s
thymeleaf:
# 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
cache: false
# ==============================================
# 타임리프 설정
# ==============================================
thymeleaf:
cache: false # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
# ==============================================
# 데이터베이스 설정
# ==============================================
@@ -30,6 +22,14 @@ spring:
username: ENC(37ccHxlpbsEz8vVcZUZA/j6azKYhP3eHwhOYVjYGf+zKC3u/qc+khKcKuBuE8+Ck)
password: ENC(uBHyXdI39UzPNvYNHDGfjmMMuhN83xoP8F3wDq/S9DxizhFwbMeEqa36oZ205CBg)
# ==============================================
# 로깅 설정
# ==============================================
logging:
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 암호화 설정
# ==============================================

View File

@@ -1,22 +1,37 @@
# ==============================================
# 로깅 설정
# ==============================================
logging:
file:
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 메시지 및 다국어 처리 설정
# ==============================================
spring:
# ==============================================
# 메시지 및 다국어 처리 설정
# ==============================================
messages:
# 메시지 캐시 지속 시간(초)
cache-duration: 10s
# ==============================================
# 타임리프 설정
# ==============================================
thymeleaf:
cache: false # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
# ==============================================
# 데이터베이스 설정
# ==============================================
datasource:
kri:
driver-class-name: org.postgresql.Driver
jdbc-url: ENC(SH5G+4mdOrW3PpVEmVyNXIFyV7eFC6uLTa0e18qa+7ueQeWrduIeGVJLrQP3mUw86dzqLK7AUHjTRuex4ud+rTt026L7csDLFYzLWGkGCTEqfFBOwHng3uQ7n+qmkKiW)
username: ENC(37ccHxlpbsEz8vVcZUZA/j6azKYhP3eHwhOYVjYGf+zKC3u/qc+khKcKuBuE8+Ck)
password: ENC(uBHyXdI39UzPNvYNHDGfjmMMuhN83xoP8F3wDq/S9DxizhFwbMeEqa36oZ205CBg)
# ==============================================
# 로깅 설정
# ==============================================
logging:
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# Spring Bean 등록 과정도 확인
org.springframework.beans.factory.support.DefaultListableBeanFactory: DEBUG
org.apache.ibatis: TRACE
org.mybatis.spring: TRACE
# ==============================================
# 암호화 설정
# ==============================================

View File

@@ -1,24 +1,11 @@
# ==============================================
# 로깅 설정
# ==============================================
logging:
file:
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
level:
app:
module: INFO # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
spring:
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
messages:
# 메시지 소스 캐시 지속 시간 (단위: 초)
# 개발 환경에서는 짧은 간격(10-60초), 운영 환경에서는 긴 간격(3600초 이상) 권장
cache-duration: 5m
thymeleaf:
# 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
cache: false
# ==============================================
# 데이터베이스 설정
# ==============================================
@@ -30,7 +17,7 @@ spring:
password: ENC(kUIzqWTu0+bqjYH4Jq9TFOOh3UwY+XVvA2OlT4VXJvxWCas66UNdGRmWDQKri5fI)
# ==============================================
# 서버 압축 설정
# 세션 설정
# ==============================================
server:
servlet:

View File

@@ -1,7 +1,7 @@
# ==============================================
# 메세지 및 다국어 처리를 위한 설정
# ==============================================
spring:
# ==============================================
# 메세지 및 다국어 처리를 위한 설정
# ==============================================
messages:
basename: messages/exception,messages/validation,messages/uri,messages/operation
encoding: UTF-8
@@ -21,56 +21,25 @@ spring:
max-lifetime: 900000
connection-timeout: 5000
leak-detection-threshold: 30000
# 정적 자원 캐싱 설정
# ==============================================
# 정적 리소스 설정
# ==============================================
web:
resources:
# 정적 리소스 캐싱 기간(초) - 1년 (31536000초)
cache:
period: 31536000 # 캐싱 기간 1년(초)
period: 31536000
# 리소스 버저닝 설정
chain:
strategy:
content:
enabled: true # 리소스 버저닝 활성화
paths: /** # 버저닝 적용 경로
# 타임리프 설정
thymeleaf:
cache: false # 타임리프 캐시 비활성화
# OAuth2 설정
security:
oauth2:
client:
registration:
naver:
client-id: vxAbBgwMTU0gXiMSCSGT # 네이버 개발자센터에서 발급받은 클라이언트 ID
client-secret: fBVwFSOcGd # 네이버 개발자센터에서 발급받은 클라이언트 시크릿 (보안 주의!)
redirect-uri: http://localhost:9001/login/oauth2/code/naver # 인증 후 리다이렉트될 URI
authorization-grant-type: authorization_code # OAuth2 인증 유형 (authorization_code 고정)
client-name: Naver # 로그인 화면에 표시될 프로바이더 이름
scope: name,email,birthday,phone # 요청할 사용자 정보 범위 (프로필, 이메일, 생일, 전화번호)
kakao:
client-id: 75ab31248046bef7b5077a07b9bee808 # 카카오 개발자센터에서 발급받은 클라이언트 ID
client-secret: 2YEhGfQ8fFTf3A5IexrrII8qvMzFw998 # 카카오 개발자센터에서 발급받은 클라이언트 시크릿
redirect-uri: http://localhost:9001/login/oauth2/code/kakao # 인증 후 리다이렉트 URI
authorization-grant-type: authorization_code
client-name: Kakao # 로그인 버튼에 표시될 이름
client-authentication-method: client_secret_post
scope: profile_nickname, profile_image # 카카오에서 지원하는 스코프 (필요한 정보 선택)
provider:
naver:
authorization-uri: https://nid.naver.com/oauth2.0/authorize # 인증 요청 URI
token-uri: https://nid.naver.com/oauth2.0/token # 토큰 발급 URI
user-info-uri: https://openapi.naver.com/v1/nid/me # 사용자 정보 조회 URI
user-name-attribute: response # 사용자 정보 응답에서 이름을 추출할 JSON 필드 경로
kakao:
authorization-uri: https://kauth.kakao.com/oauth/authorize # 카카오 인증 URI
token-uri: https://kauth.kakao.com/oauth/token # 토큰 발급 URI
user-info-uri: https://kapi.kakao.com/v2/user/me # 사용자 정보 조회 URI
user-name-attribute: id # 사용자 정보 응답에서 이름 추출할 필드 (기본값은 'id')
# 콘텐츠 기반 버저닝 활성화
enabled: true
# 버저닝 적용 경로
paths: /**
# ==============================================
# 프론트엔드 설정
# 사용자 관련 설정
# ==============================================
app:
front:
@@ -96,12 +65,20 @@ app:
# 로깅 설정
# ==============================================
logging:
file:
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
level:
org:
hibernate:
orm:
jdbc:
bind: trace # Hibernate SQL 파라미터 바인딩 로깅
# Hibernate SQL 파라미터 바인딩 값 로깅 레벨
bind: trace
# Spring Framework 코어 모듈 로깅 레벨 (INFO 레벨로 설정)
springframework: INFO
app:
module: INFO # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# MyBatis 설정
# ==============================================
@@ -110,11 +87,20 @@ mybatis:
kri: classpath*:mappers/**/*Mapper.xml # 매퍼 파일 위치
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # SQL 로깅 구현체
# ==============================================
# 서버 압축 설정
# 세션 설정
# ==============================================
server:
servlet:
session:
cookie:
name: FRONT_SESSION
name: FRONT_SESSION
# ==============================================
# 암호화 설정
# ==============================================
jasypt:
encryptor:
password: #별도관리
algorithm: #별도관리

View File

@@ -39,8 +39,7 @@
resultType="app.module.front.usecase.info.notice.getNotice.ports.application.domain.GetNoticeUploadFile">
/* getUploadFiles 상세 게시글 조회 시, 첨부파일 조회 */
SELECT
awuf.notice_id AS noticeId,
awuf.upload_files_id AS uploadfileId,
uf.mapping_id AS noticeId,
uf.id AS id,
uf.created_at AS createdAt,
uf.created_by AS createdBy,
@@ -51,9 +50,7 @@
uf.origin_name AS originName,
uf.path AS path,
uf.type AS type
FROM notice_has_upload_file awuf
INNER JOIN upload_file uf
ON awuf.upload_files_id = uf.id
WHERE awuf.notice_id = #{id}
FROM upload_file uf
WHERE uf.mapping_id = #{id} and uf.is_deleted = false and uf.type='NOTICE'
</select>
</mapper>

View File

@@ -6,7 +6,7 @@
*/
function goPageable(page, size, orderBy, orderDir) {
let uri = new Uri(location.href);
uri.replaceQueryParam('pageNumber', page).replaceQueryParam('pageSize', size)
uri.replaceQueryParam('page', page).replaceQueryParam('pageSize', size)
.replaceQueryParam('orderBy', orderBy).replaceQueryParam('orderDir',
orderDir);

View File

@@ -113,15 +113,10 @@
*/
goSearch() {
const f = document.reqForm;
f.page.value = 0;
f.searchField.value = document.getElementById('searchFieldId').value;
f.submit();
},
goPageable(page, size, sort) {
const f = document.reqForm;
f.page.value = page;
f.submit();
}
}
</script>

View File

@@ -13,15 +13,21 @@
</dd>
</dl>
<div class="detail-content">
<p th:utext="${notice.content}"></p>
<p th:utext="${ notice.content }"></p>
</div>
<div class="download-file" th:if="${!#lists.isEmpty(notice.uploadFiles)}">
<p class="tit">첨부파일</p>
<ul>
<li th:each="item : ${notice.uploadFiles}"><a th:href="${item.attachmentURL}" download
th:text="${item.originName}"></a></li>
<li th:each="item : ${notice.uploadFiles}">
<a href="javascript:void(0);"
th:text="${item.originName}"
th:data-url="${item.attachmentURL}"
th:data-filename="${item.originName}"
onclick="formControl.fileDownload(this)">
</a>
</li>
</ul>
</div>
@@ -57,13 +63,71 @@ root: /*[[|#{uri.front.info.user.path}/password|]]*/'rootUrl',
*/
const previousUrl = document.referrer;
if (previousUrl.includes('/info/notice')) {
/* if (previousUrl.includes('/info/notice')) {
history.back();
} else {
} else {*/
location.href = '/info/notice';
// }
},
fileDownload(element) {
const url = element.dataset.url;
const fileName = element.dataset.filename;
if (!url || !fileName) {
console.error('Invalid URL or fileName:', url, fileName);
ajaxUtil._alert('파일 다운로드를 시작할 수 없습니다: 유효하지 않은 URL 또는 파일명입니다.', null);
return;
}
fetch(url, {
method: 'GET',
headers: {
'Accept': 'application/octet-stream'
}
}).then(response => {
console.log('Response status:', response.status);
if (!response.ok) {
// 응답 본문 읽기
return response.text().then(errorMessage => {
let message = errorMessage || '파일 다운로드에 실패했습니다. 상태 코드: ' + response.status;
if (response.status === 404) {
message = errorMessage || '파일을 찾을 수 없습니다.';
} else if (response.status === 500) {
message = errorMessage || '서버 오류로 인해 파일 다운로드에 실패했습니다.';
}
throw new Error(message);
});
}
// Content-Disposition 헤더에서 파일명 추출
const disposition = response.headers.get('Content-Disposition');
console.log('Content-Disposition:', disposition);
let serverFileName = fileName;
if (disposition && disposition.includes('filename*=')) {
const matches = disposition.match(/filename\*=UTF-8''(.+)/);
if (matches && matches[1]) {
try {
serverFileName = decodeURIComponent(matches[1]);
} catch (e) {
console.error('Failed to decode filename:', e);
}
}
}
return response.blob().then(blob => ({ blob, fileName: serverFileName }));
})
.then(({ blob, fileName }) => {
console.log('Blob received, size:', blob.size);
const link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(link.href);
})
.catch(error => {
console.error('Download error:', error);
ajaxUtil._alert('파일 다운로드에 실패했습니다: ', null);
});
}
},
}
</script>

View File

@@ -420,13 +420,11 @@
f.tel1.value = ENV.select.selectTel.getValue();
f.phone1.value = ENV.select.selectPhone.getValue();
const obj = $(f).serializeObject();
ajaxUtil._ajaxAsync(
ENV.httpUrl.user,
$(f).serializeObject(),
function (rstData, status) {
if (rstData.code === 'SUCCESS') {
// 유효성 검사를 모두 통과한 후
ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, () => {
location.href = '/info';
});