From cd26e7f23df3fd4d223d1b8d8bd287b244ba4f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Tue, 15 Jul 2025 10:24:15 +0900 Subject: [PATCH 01/10] =?UTF-8?q?=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notice/getNotice/adapters/persistence/GetNoticeDao.java | 6 ++++++ front/src/main/resources/templates/info/notice/{id}.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/front/src/main/java/app/module/front/usecase/info/notice/getNotice/adapters/persistence/GetNoticeDao.java b/front/src/main/java/app/module/front/usecase/info/notice/getNotice/adapters/persistence/GetNoticeDao.java index a48e5861..7535bd5e 100644 --- a/front/src/main/java/app/module/front/usecase/info/notice/getNotice/adapters/persistence/GetNoticeDao.java +++ b/front/src/main/java/app/module/front/usecase/info/notice/getNotice/adapters/persistence/GetNoticeDao.java @@ -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 operate(GetNoticeCmd command) { GetNotice secArticle = mapper.getNotice(command); + if (secArticle.getContent() != null) { + String cleanedContent = HtmlUtils.htmlUnescape(secArticle.getContent()); + cleanedContent = cleanedContent.replaceAll("

\\s*

", "
"); + secArticle.setContent(cleanedContent); + } List setArticleUploadFile = mapper.getUploadFiles(command.getId()); diff --git a/front/src/main/resources/templates/info/notice/{id}.html b/front/src/main/resources/templates/info/notice/{id}.html index a56633a6..8d09afee 100644 --- a/front/src/main/resources/templates/info/notice/{id}.html +++ b/front/src/main/resources/templates/info/notice/{id}.html @@ -13,7 +13,7 @@
-

+

From 9d78336ed41c20e323c08f9a7a8cabbc35889863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Tue, 15 Jul 2025 10:51:38 +0900 Subject: [PATCH 02/10] =?UTF-8?q?=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=B2=A8=EB=B6=80=ED=8C=8C=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mappers/notice/GetNoticeMapper.xml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/front/src/main/resources/mappers/notice/GetNoticeMapper.xml b/front/src/main/resources/mappers/notice/GetNoticeMapper.xml index 205eb61d..1bb11861 100644 --- a/front/src/main/resources/mappers/notice/GetNoticeMapper.xml +++ b/front/src/main/resources/mappers/notice/GetNoticeMapper.xml @@ -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' \ No newline at end of file From 63387856e9e7796959f680f035e7d6effec9ef22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=84=EC=A3=BC?= Date: Tue, 15 Jul 2025 13:09:08 +0900 Subject: [PATCH 03/10] =?UTF-8?q?FO/BO=20YML=20=EA=B3=B5=ED=86=B5=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/main/resources/application-dev.yml | 39 ++++----- .../src/main/resources/application-local.yml | 47 +++++------ admin/src/main/resources/application-prod.yml | 30 ++----- admin/src/main/resources/application.yml | 36 ++++---- front/src/main/resources/application-dev.yml | 32 ++++---- .../src/main/resources/application-local.yml | 39 ++++++--- front/src/main/resources/application-prod.yml | 21 +---- front/src/main/resources/application.yml | 82 ++++++++----------- 8 files changed, 143 insertions(+), 183 deletions(-) diff --git a/admin/src/main/resources/application-dev.yml b/admin/src/main/resources/application-dev.yml index bd584fd4..a40f9336 100644 --- a/admin/src/main/resources/application-dev.yml +++ b/admin/src/main/resources/application-dev.yml @@ -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 # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정) + # ============================================== # 암호화 설정 # ============================================== diff --git a/admin/src/main/resources/application-local.yml b/admin/src/main/resources/application-local.yml index 61912755..1236aac5 100644 --- a/admin/src/main/resources/application-local.yml +++ b/admin/src/main/resources/application-local.yml @@ -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 # ============================================== # 암호화 설정 diff --git a/admin/src/main/resources/application-prod.yml b/admin/src/main/resources/application-prod.yml index 368452f4..5dadfef0 100644 --- a/admin/src/main/resources/application-prod.yml +++ b/admin/src/main/resources/application-prod.yml @@ -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: diff --git a/admin/src/main/resources/application.yml b/admin/src/main/resources/application.yml index 35b91794..a340d4f4 100644 --- a/admin/src/main/resources/application.yml +++ b/admin/src/main/resources/application.yml @@ -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: #별도관리 diff --git a/front/src/main/resources/application-dev.yml b/front/src/main/resources/application-dev.yml index d985f574..30b532aa 100644 --- a/front/src/main/resources/application-dev.yml +++ b/front/src/main/resources/application-dev.yml @@ -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 # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정) + # ============================================== # 암호화 설정 # ============================================== diff --git a/front/src/main/resources/application-local.yml b/front/src/main/resources/application-local.yml index 11a10ad4..308b58f1 100644 --- a/front/src/main/resources/application-local.yml +++ b/front/src/main/resources/application-local.yml @@ -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 + # ============================================== # 암호화 설정 # ============================================== diff --git a/front/src/main/resources/application-prod.yml b/front/src/main/resources/application-prod.yml index 6fe93171..e932066c 100644 --- a/front/src/main/resources/application-prod.yml +++ b/front/src/main/resources/application-prod.yml @@ -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: diff --git a/front/src/main/resources/application.yml b/front/src/main/resources/application.yml index 1cad9524..cf24f99a 100644 --- a/front/src/main/resources/application.yml +++ b/front/src/main/resources/application.yml @@ -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 \ No newline at end of file + name: FRONT_SESSION + +# ============================================== +# 암호화 설정 +# ============================================== +jasypt: + encryptor: + password: #별도관리 + algorithm: #별도관리 From 4794afcfd05c0e6979989249c960a6f817ba6e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=84=EC=A3=BC?= Date: Tue, 15 Jul 2025 14:07:20 +0900 Subject: [PATCH 04/10] =?UTF-8?q?[BO]=20=EC=9D=BC=EA=B3=84=EB=B6=80=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=EB=82=A0=EC=A7=9C=20=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EC=A0=9C=ED=95=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/households/tab/daily-record.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/src/main/resources/templates/households/tab/daily-record.html b/admin/src/main/resources/templates/households/tab/daily-record.html index 730f41a3..66d8260a 100644 --- a/admin/src/main/resources/templates/households/tab/daily-record.html +++ b/admin/src/main/resources/templates/households/tab/daily-record.html @@ -425,7 +425,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; } From fe9a0a059e50520454ecde252d656e1fbce93fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Tue, 15 Jul 2025 15:30:10 +0900 Subject: [PATCH 05/10] =?UTF-8?q?=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=B2=A8=EB=B6=80=20=ED=8C=8C=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapters/DownloadFileController.java | 2 +- .../adapters/persistence/UpdateFileDao.java | 4 +- .../url/strategy/SftpFileUrlStrategy.java | 2 +- .../adapters/web/GetAttachmentController.java | 99 +++++++++++++++---- .../resources/templates/info/notice/{id}.html | 70 ++++++++++++- 5 files changed, 149 insertions(+), 28 deletions(-) diff --git a/core/src/main/java/app/module/core/usecase/file/downloadFile/adapters/DownloadFileController.java b/core/src/main/java/app/module/core/usecase/file/downloadFile/adapters/DownloadFileController.java index 68cb3270..d9a8f718 100644 --- a/core/src/main/java/app/module/core/usecase/file/downloadFile/adapters/DownloadFileController.java +++ b/core/src/main/java/app/module/core/usecase/file/downloadFile/adapters/DownloadFileController.java @@ -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("파일 다운로드에 실패하였습니다."); } diff --git a/core/src/main/java/app/module/core/usecase/file/updateFile/adapters/persistence/UpdateFileDao.java b/core/src/main/java/app/module/core/usecase/file/updateFile/adapters/persistence/UpdateFileDao.java index 4465e0b4..bf43ea60 100644 --- a/core/src/main/java/app/module/core/usecase/file/updateFile/adapters/persistence/UpdateFileDao.java +++ b/core/src/main/java/app/module/core/usecase/file/updateFile/adapters/persistence/UpdateFileDao.java @@ -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( diff --git a/core/src/main/java/app/module/core/usecase/file/url/strategy/SftpFileUrlStrategy.java b/core/src/main/java/app/module/core/usecase/file/url/strategy/SftpFileUrlStrategy.java index adde9d46..34f25031 100644 --- a/core/src/main/java/app/module/core/usecase/file/url/strategy/SftpFileUrlStrategy.java +++ b/core/src/main/java/app/module/core/usecase/file/url/strategy/SftpFileUrlStrategy.java @@ -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); } } diff --git a/core/src/main/java/app/module/core/usecase/getAttachment/adapters/web/GetAttachmentController.java b/core/src/main/java/app/module/core/usecase/getAttachment/adapters/web/GetAttachmentController.java index 8a27bab1..ef498537 100644 --- a/core/src/main/java/app/module/core/usecase/getAttachment/adapters/web/GetAttachmentController.java +++ b/core/src/main/java/app/module/core/usecase/getAttachment/adapters/web/GetAttachmentController.java @@ -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);*/ } } diff --git a/front/src/main/resources/templates/info/notice/{id}.html b/front/src/main/resources/templates/info/notice/{id}.html index 8d09afee..791241cd 100644 --- a/front/src/main/resources/templates/info/notice/{id}.html +++ b/front/src/main/resources/templates/info/notice/{id}.html @@ -20,8 +20,14 @@

첨부파일

@@ -62,8 +68,66 @@ root: /*[[|#{uri.front.info.user.path}/password|]]*/'rootUrl', } 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); + }); - } + }, } From dfb20241a6dce74de784bce64e89784ebfa153a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Tue, 15 Jul 2025 15:32:31 +0900 Subject: [PATCH 06/10] =?UTF-8?q?=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=20=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD?= =?UTF-8?q?=EC=8B=9C=20=EA=B2=80=EC=83=89=EC=A1=B0=EA=B1=B4=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/main/resources/templates/info/notice/{id}.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/front/src/main/resources/templates/info/notice/{id}.html b/front/src/main/resources/templates/info/notice/{id}.html index 791241cd..210173fd 100644 --- a/front/src/main/resources/templates/info/notice/{id}.html +++ b/front/src/main/resources/templates/info/notice/{id}.html @@ -63,11 +63,11 @@ 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; From bac40ff0b0807317e1872b4cd41e1e5c17f408d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Tue, 15 Jul 2025 16:12:08 +0900 Subject: [PATCH 07/10] =?UTF-8?q?=EA=B0=9C=EC=9D=B8=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=EC=8B=9C=20=EC=9D=B4=EB=A6=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/application/security/FrontHouseholdUser.java | 2 ++ .../updateUserUI/adapters/web/UpdateUserController.java | 8 ++++++++ front/src/main/resources/templates/info/user/user.html | 2 -- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/front/src/main/java/app/module/front/config/application/security/FrontHouseholdUser.java b/front/src/main/java/app/module/front/config/application/security/FrontHouseholdUser.java index a3dc23f6..439918b3 100644 --- a/front/src/main/java/app/module/front/config/application/security/FrontHouseholdUser.java +++ b/front/src/main/java/app/module/front/config/application/security/FrontHouseholdUser.java @@ -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 { diff --git a/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/UpdateUserController.java b/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/UpdateUserController.java index d5332c63..981795d9 100644 --- a/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/UpdateUserController.java +++ b/front/src/main/java/app/module/front/usecase/info/userUI/updateUserUI/adapters/web/UpdateUserController.java @@ -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(), diff --git a/front/src/main/resources/templates/info/user/user.html b/front/src/main/resources/templates/info/user/user.html index 4157850d..8c0d95bc 100644 --- a/front/src/main/resources/templates/info/user/user.html +++ b/front/src/main/resources/templates/info/user/user.html @@ -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'; }); From 9296dd4575c4eb20c09428797a9cc3707af298a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Tue, 15 Jul 2025 16:35:59 +0900 Subject: [PATCH 08/10] =?UTF-8?q?FO=20=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/main/resources/static/ui/uiUtil.js | 2 +- .../src/main/resources/templates/info/notice/notices.html | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/front/src/main/resources/static/ui/uiUtil.js b/front/src/main/resources/static/ui/uiUtil.js index 14f766d6..ba2b121d 100644 --- a/front/src/main/resources/static/ui/uiUtil.js +++ b/front/src/main/resources/static/ui/uiUtil.js @@ -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); diff --git a/front/src/main/resources/templates/info/notice/notices.html b/front/src/main/resources/templates/info/notice/notices.html index 855484a1..0bf5ee93 100644 --- a/front/src/main/resources/templates/info/notice/notices.html +++ b/front/src/main/resources/templates/info/notice/notices.html @@ -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(); - } } From 05a1a0f3300cc0637024d777250740dd7bdac6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=88=98=ED=98=84?= Date: Tue, 15 Jul 2025 16:36:57 +0900 Subject: [PATCH 09/10] =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=95=2010=EA=B0=9C?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../getNoticesUI/adapters/web/GetNoticesUIController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/main/java/app/module/front/usecase/info/noticeUI/getNoticesUI/adapters/web/GetNoticesUIController.java b/front/src/main/java/app/module/front/usecase/info/noticeUI/getNoticesUI/adapters/web/GetNoticesUIController.java index 47ce01df..ed76cc5d 100644 --- a/front/src/main/java/app/module/front/usecase/info/noticeUI/getNoticesUI/adapters/web/GetNoticesUIController.java +++ b/front/src/main/java/app/module/front/usecase/info/noticeUI/getNoticesUI/adapters/web/GetNoticesUIController.java @@ -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"); From 15f29bdf1169f99f4ebab621c0ca0b1e8b1e5386 Mon Sep 17 00:00:00 2001 From: kangsunlee Date: Tue, 15 Jul 2025 17:40:06 +0900 Subject: [PATCH 10/10] =?UTF-8?q?[BO]=20=EC=88=98=EC=A0=95=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/validator/AdminUpdateValidator.java | 9 ------- .../household/CreateHouseholdMapper.xml | 8 ------ .../household/UpdateHouseholdMapper.xml | 8 ------ .../mappers/researcher/ResearcherMapper.xml | 8 +++++- admin/src/main/resources/static/ui/uiUtil.js | 11 +++++--- .../templates/common/components.html | 1 - .../common/modal-household-mapping.html | 25 +++++++++++++++--- .../templates/households/create.html | 14 +++++----- .../templates/households/households.html | 26 ++++++++++--------- .../households/tab/daily-record.html | 3 --- .../templates/households/update/{seq}.html | 4 ++- .../templates/researcher/researchers.html | 2 +- .../resources/templates/security/login.html | 2 +- 13 files changed, 64 insertions(+), 57 deletions(-) diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java index a9a06577..2f1f0e60 100644 --- a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java @@ -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개 이상입니다."); - } } } diff --git a/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml b/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml index d76fd0ce..4aee8c9a 100644 --- a/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml +++ b/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml @@ -24,18 +24,10 @@ region_sub_code, region_detail_code, address, - industry_large_code, - - industry_middle_code, - - industry_sub_middle, - - industry_detail, - is_panel, usage_type, employment_type, diff --git a/admin/src/main/resources/mappers/household/UpdateHouseholdMapper.xml b/admin/src/main/resources/mappers/household/UpdateHouseholdMapper.xml index 5d16fa24..ca0668e3 100644 --- a/admin/src/main/resources/mappers/household/UpdateHouseholdMapper.xml +++ b/admin/src/main/resources/mappers/household/UpdateHouseholdMapper.xml @@ -18,18 +18,10 @@ region_sub_code = #{regionSubCode}, region_detail_code = #{regionDetailCode}, address = #{address}, - industry_large_code = #{industryLargeCode}, - - industry_middle_code = #{industryMiddleCode}, - - industry_sub_middle = #{industrySubMiddle}, - - industry_detail = #{industryDetail}, - is_panel = #{isPanel}, usage_type = #{usageType}, diff --git a/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml b/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml index c5745ffa..18185429 100644 --- a/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml +++ b/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml @@ -342,9 +342,15 @@ ) AS hvr 1=1 - + /* 경영주 검색 */ + + AND ( + hvr.householdName ILIKE '%' || #{cmd.ownerValue} || '%' + OR hvr.householdPhone ILIKE '%' || #{cmd.ownerValue} || '%' + ) + AND hvr.householdName ILIKE '%' || #{cmd.ownerValue} || '%' diff --git a/admin/src/main/resources/static/ui/uiUtil.js b/admin/src/main/resources/static/ui/uiUtil.js index 3d681c70..816ba08e 100644 --- a/admin/src/main/resources/static/ui/uiUtil.js +++ b/admin/src/main/resources/static/ui/uiUtil.js @@ -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(''); + $el.html(``); list.forEach(item => { const val = item.id.split('.').pop(); const isSelected = item.id === selected ? 'selected' : ''; $el.append(``); }); + + if (selected) { + $el.val(selected); + } }; const loadChildren = (parentId, selectedChild = '') => { - $child.html(''); + $child.html(``); if (!parentId) return; const parent = codeList.nodes.find(n => n.id === parentId); diff --git a/admin/src/main/resources/templates/common/components.html b/admin/src/main/resources/templates/common/components.html index 39bccce9..fc9b66dd 100644 --- a/admin/src/main/resources/templates/common/components.html +++ b/admin/src/main/resources/templates/common/components.html @@ -168,7 +168,6 @@ 홈 diff --git a/admin/src/main/resources/templates/common/modal-household-mapping.html b/admin/src/main/resources/templates/common/modal-household-mapping.html index 073890fb..4c139999 100644 --- a/admin/src/main/resources/templates/common/modal-household-mapping.html +++ b/admin/src/main/resources/templates/common/modal-household-mapping.html @@ -10,7 +10,7 @@ -
+ @@ -94,7 +95,7 @@ - @@ -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 @@ `); }); + + // nodata 처리 + if (!$(response.content).length) { + tbody.append(` + + 임가정보가 존재하지 않습니다. + + `); + } + // Pagination 구성하기 const paging = $('.mapping-paging'); paging.empty(); @@ -271,6 +285,11 @@ ); } }; + + const initSearchHousehold = () => { + const regionMainCode = document.querySelector('[name="regionMainCode"]')?.value || ''; + searchHouseholdList(0, regionMainCode); + }; \ No newline at end of file diff --git a/admin/src/main/resources/templates/households/create.html b/admin/src/main/resources/templates/households/create.html index ae0bbb64..5b985079 100644 --- a/admin/src/main/resources/templates/households/create.html +++ b/admin/src/main/resources/templates/households/create.html @@ -121,7 +121,7 @@
- +
@@ -140,7 +140,7 @@
@@ -160,7 +160,7 @@
@@ -168,7 +168,7 @@
@@ -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: '선택' }); }); diff --git a/admin/src/main/resources/templates/households/households.html b/admin/src/main/resources/templates/households/households.html index 1d8dd70c..9de2bce3 100644 --- a/admin/src/main/resources/templates/households/households.html +++ b/admin/src/main/resources/templates/households/households.html @@ -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); }); @@ -409,9 +414,6 @@ 'json' ); } - - // 최초 리스트 로드 - getHouseholds(document.reqForm.page.value);