69 | ```
--------------------------------------------------------------------------------
/src/main/java/egovframework/EgovBootApplication.java:
--------------------------------------------------------------------------------
1 | package egovframework;
2 |
3 | import org.springframework.boot.Banner;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.web.servlet.ServletComponentScan;
7 |
8 | import lombok.extern.slf4j.Slf4j;
9 |
10 | @Slf4j
11 | @ServletComponentScan
12 | @SpringBootApplication
13 | public class EgovBootApplication {
14 | public static void main(String[] args) {
15 | log.debug("##### EgovBootApplication Start #####");
16 |
17 | SpringApplication springApplication = new SpringApplication(EgovBootApplication.class);
18 | springApplication.setBannerMode(Banner.Mode.OFF);
19 | //springApplication.setLogStartupInfo(false);
20 | springApplication.run(args);
21 |
22 | log.debug("##### EgovBootApplication End #####");
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/ComDefaultCodeVO.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import java.io.Serializable;
4 |
5 | import lombok.Getter;
6 | import lombok.Setter;
7 | import org.apache.commons.lang3.builder.ToStringBuilder;
8 |
9 | /**
10 | * 클래스
11 | * @author 공통서비스개발팀 이삼섭
12 | * @since 2009.06.01
13 | * @version 1.0
14 | * @see
15 | *
16 | *
17 | * << 개정이력(Modification Information) >>
18 | *
19 | * 수정일 수정자 수정내용
20 | * ------- -------- ---------------------------
21 | * 2009.3.11 이삼섭 최초 생성
22 | *
23 | *
24 | */
25 | @Getter
26 | @Setter
27 | public class ComDefaultCodeVO implements Serializable {
28 | /**
29 | * serialVersion UID
30 | */
31 | private static final long serialVersionUID = -2020648489890016404L;
32 |
33 | /** 코드 ID */
34 | private String codeId = "";
35 |
36 | /** 상세코드 */
37 | private String code = "";
38 |
39 | /** 코드명 */
40 | private String codeNm = "";
41 |
42 | /** 코드설명 */
43 | private String codeDc = "";
44 |
45 | /** 특정테이블명 */
46 | private String tableNm = ""; //특정테이블에서 코드정보를추출시 사용
47 |
48 | /** 상세 조건 여부 */
49 | private String haveDetailCondition = "N";
50 |
51 | /** 상세 조건 */
52 | private String detailCondition = "";
53 |
54 | /**
55 | * toString 메소드를 대치한다.
56 | */
57 | public String toString() {
58 | return ToStringBuilder.reflectionToString(this);
59 | }
60 | }
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/ComDefaultVO.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import java.io.Serializable;
4 |
5 | import lombok.Getter;
6 | import lombok.Setter;
7 | import org.apache.commons.lang3.builder.ToStringBuilder;
8 |
9 | /**
10 | * @Class Name : ComDefaultVO.java
11 | * @Description : ComDefaultVO class
12 | * @Modification Information
13 | * @
14 | * @ 수정일 수정자 수정내용
15 | * @ ------- -------- ---------------------------
16 | * @ 2009.02.01 조재영 최초 생성
17 | *
18 | * @author 공통서비스 개발팀 조재영
19 | * @since 2009.02.01
20 | * @version 1.0
21 | * @see
22 | *
23 | */
24 | @Getter
25 | @Setter
26 | public class ComDefaultVO implements Serializable {
27 |
28 | private static final long serialVersionUID = 1L;
29 |
30 | /** 검색조건 */
31 | private String searchCondition = "";
32 |
33 | /** 검색Keyword */
34 | private String searchKeyword = "";
35 |
36 | /** 검색사용여부 */
37 | private String searchUseYn = "";
38 |
39 | /** 현재페이지 */
40 | private int pageIndex = 1;
41 |
42 | /** 페이지갯수 */
43 | private int pageUnit = 10;
44 |
45 | /** 페이지사이즈 */
46 | private int pageSize = 10;
47 |
48 | /** firstIndex */
49 | private int firstIndex = 1;
50 |
51 | /** lastIndex */
52 | private int lastIndex = 1;
53 |
54 | /** recordCountPerPage */
55 | private int recordCountPerPage = 10;
56 |
57 | /** 검색KeywordFrom */
58 | private String searchKeywordFrom = "";
59 |
60 | /** 검색KeywordTo */
61 | private String searchKeywordTo = "";
62 |
63 | public String toString() {
64 | return ToStringBuilder.reflectionToString(this);
65 | }
66 |
67 |
68 | }
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/EgovComExcepHndlr.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import org.egovframe.rte.fdl.cmmn.exception.handler.ExceptionHandler;
4 |
5 | import lombok.extern.slf4j.Slf4j;
6 |
7 | /**
8 | * @Class Name : EgovComExcepHndlr.java
9 | * @Description : 공통서비스의 exception 처리 클래스
10 | * @Modification Information
11 | *
12 | * 수정일 수정자 수정내용
13 | * ------- ------- -------------------
14 | * 2009. 3. 13. 이삼섭
15 | *
16 | * @author 공통 서비스 개발팀 이삼섭
17 | * @since 2009. 3. 13.
18 | * @version
19 | * @see
20 | *
21 | */
22 | @Slf4j
23 | public class EgovComExcepHndlr implements ExceptionHandler {
24 |
25 |
26 | /**
27 | * 발생된 Exception을 처리한다.
28 | */
29 | public void occur(Exception ex, String packageName) {
30 | log.debug("[HANDLER][PACKAGE]::: {}", packageName);
31 | log.debug("[HANDLER][Exception]:::", ex);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/EgovComOthersExcepHndlr.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import org.egovframe.rte.fdl.cmmn.exception.handler.ExceptionHandler;
4 |
5 | import lombok.extern.slf4j.Slf4j;
6 |
7 | @Slf4j
8 | public class EgovComOthersExcepHndlr implements ExceptionHandler {
9 |
10 | public void occur(Exception exception, String packageName) {
11 | //log.debug(" EgovServiceExceptionHandler run...............");
12 | log.error(packageName, exception);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/EgovComTraceHandler.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import org.egovframe.rte.fdl.cmmn.trace.handler.TraceHandler;
4 |
5 | import lombok.extern.slf4j.Slf4j;
6 |
7 | /**
8 | * @Class Name : EgovComTraceHandler.java
9 | * @Description : 공통서비스의 trace 처리 클래스
10 | * @Modification Information
11 | *
12 | * 수정일 수정자 수정내용
13 | * ------- ------- -------------------
14 | * 2011. 09. 30. JJY
15 | *
16 | * @author JJY
17 | * @since 2011. 9. 30.
18 | *
19 | */
20 | @Slf4j
21 | public class EgovComTraceHandler implements TraceHandler {
22 |
23 | /**
24 | * 발생된 메시지를 출력한다.
25 | */
26 | public void todo(Class> clazz, String message) {
27 | //log.debug("log ==> DefaultTraceHandler run...............");
28 | log.debug("[TRACE]CLASS::: {}", clazz.getName());
29 | log.debug("[TRACE]MESSAGE::: {}", message);
30 | //이곳에서 후속처리로 필요한 액션을 취할 수 있다.
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/EgovComponentChecker.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
4 |
5 | import org.springframework.beans.BeansException;
6 | import org.springframework.beans.factory.NoSuchBeanDefinitionException;
7 | import org.springframework.context.ApplicationContext;
8 | import org.springframework.context.ApplicationContextAware;
9 | import org.springframework.stereotype.Service;
10 | import org.springframework.util.ObjectUtils;
11 |
12 |
13 | /**
14 | * EgovComUtil 클래스
15 | *
16 | * @author 서준식
17 | * @since 2011.09.15
18 | * @version 1.0
19 | * @see
20 | *
21 | *
22 | * << 개정이력(Modification Information) >>
23 | *
24 | * 수정일 수정자 수정내용
25 | * ------- ------------- ----------------------
26 | * 2011.09.15 서준식 최초 생성
27 | *
28 | */
29 |
30 | @Service("egovUtil")
31 | public class EgovComponentChecker extends EgovAbstractServiceImpl implements ApplicationContextAware{
32 |
33 |
34 | public static ApplicationContext context;
35 |
36 | @Override
37 | @SuppressWarnings("static-access")
38 | public void setApplicationContext(ApplicationContext context)
39 | throws BeansException {
40 |
41 | this.context = context;
42 | }
43 |
44 | /**
45 | * Spring MVC에서 설정한 빈이 아닌 서비스 빈(컴포넌트)만을 검색할 수 있음
46 | *
47 | */
48 | public static boolean hasComponent(String componentName){
49 |
50 | try{
51 | Object component = context.getBean(componentName);
52 |
53 | // Fix: Null pointers should not be dereferenced 이슈 수정
54 | if(ObjectUtils.isEmpty(component)){
55 | return false;
56 | }else{
57 | return true;
58 | }
59 |
60 | }catch(NoSuchBeanDefinitionException ex){// 해당 컴포넌트를 찾을 수없을 경우 false반환
61 | return false;
62 | }
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/EgovMessageSource.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import java.util.Locale;
4 |
5 | import org.springframework.context.MessageSource;
6 | import org.springframework.context.support.ReloadableResourceBundleMessageSource;
7 |
8 | /**
9 | * 메시지 리소스 사용을 위한 MessageSource 인터페이스 및 ReloadableResourceBundleMessageSource 클래스의 구현체
10 | * @author 공통서비스 개발팀 이문준
11 | * @since 2009.06.01
12 | * @version 1.0
13 | * @see
14 | *
15 | *
16 | * << 개정이력(Modification Information) >>
17 | *
18 | * 수정일 수정자 수정내용
19 | * ------- -------- ---------------------------
20 | * 2009.03.11 이문준 최초 생성
21 | *
22 | *
23 | */
24 |
25 | public class EgovMessageSource extends ReloadableResourceBundleMessageSource implements MessageSource {
26 |
27 | private ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource;
28 |
29 | /**
30 | * getReloadableResourceBundleMessageSource()
31 | * @param reloadableResourceBundleMessageSource - resource MessageSource
32 | * @return ReloadableResourceBundleMessageSource
33 | */
34 | public void setReloadableResourceBundleMessageSource(ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource) {
35 | this.reloadableResourceBundleMessageSource = reloadableResourceBundleMessageSource;
36 | }
37 |
38 | /**
39 | * getReloadableResourceBundleMessageSource()
40 | * @return ReloadableResourceBundleMessageSource
41 | */
42 | public ReloadableResourceBundleMessageSource getReloadableResourceBundleMessageSource() {
43 | return reloadableResourceBundleMessageSource;
44 | }
45 |
46 | /**
47 | * Default Locale 정의된 메세지 조회
48 | * @param code - 메세지 코드
49 | * @return String
50 | */
51 | public String getMessage(String code) {
52 | return this.getMessage(code, Locale.getDefault());
53 | }
54 | /**
55 | * 정의된 메세지 조회
56 | * @param code - 메세지 코드
57 | * @param locale - locale 설정
58 | * @return String
59 | */
60 | public String getMessage(String code, Locale locale) {
61 | return getReloadableResourceBundleMessageSource().getMessage(code, null, locale);
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/ImagePaginationRenderer.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import org.egovframe.rte.ptl.mvc.tags.ui.pagination.AbstractPaginationRenderer;
4 |
5 | import javax.servlet.ServletContext;
6 |
7 | import org.springframework.web.context.ServletContextAware;
8 | /**
9 | * ImagePaginationRenderer.java 클래스
10 | *
11 | * @author 서준식
12 | * @since 2011. 9. 16.
13 | * @version 1.0
14 | * @see
15 | *
16 | *
17 | * << 개정이력(Modification Information) >>
18 | *
19 | * 수정일 수정자 수정내용
20 | * ------- ------------- ----------------------
21 | * 2011. 9. 16. 서준식 이미지 경로에 ContextPath추가
22 | *
23 | */
24 | public class ImagePaginationRenderer extends AbstractPaginationRenderer implements ServletContextAware{
25 |
26 | private ServletContext servletContext;
27 |
28 | public ImagePaginationRenderer() {
29 |
30 | }
31 |
32 | public void initVariables(){
33 | firstPageLabel = "
";
34 | previousPageLabel = "
";
35 | currentPageLabel = "{0}";
36 | otherPageLabel = "{2}";
37 | nextPageLabel = "
";
38 | lastPageLabel = "
";
39 | }
40 |
41 |
42 |
43 | public void setServletContext(ServletContext servletContext) {
44 | this.servletContext = servletContext;
45 | initVariables();
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/IncludedCompInfoVO.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | /**
7 | * IncludedInfo annotation을 바탕으로 화면에 표시할 정보를 구성하기 위한 VO 클래스
8 | * @author 공통컴포넌트 정진오
9 | * @since 2011.08.26
10 | * @version 2.0.0
11 | * @see
12 | *
13 | *
14 | * << 개정이력(Modification Information) >>
15 | *
16 | * 수정일 수정자 수정내용
17 | * ------- -------- ---------------------------
18 | * 2011.08.26 정진오 최초 생성
19 | *
20 | *
21 | */
22 | @Getter
23 | @Setter
24 | public class IncludedCompInfoVO {
25 |
26 | private String name;
27 | private String listUrl;
28 | private int order;
29 | private int gid;
30 |
31 |
32 | }
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/LoginVO.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import java.io.Serializable;
4 |
5 | import javax.validation.constraints.Email;
6 |
7 | import io.swagger.v3.oas.annotations.media.Schema;
8 | import lombok.Getter;
9 | import lombok.Setter;
10 |
11 | /**
12 | * @Class Name : LoginVO.java
13 | * @Description : Login VO class
14 | * @Modification Information
15 | * @
16 | * @ 수정일 수정자 수정내용
17 | * @ ------- -------- ---------------------------
18 | * @ 2009.03.03 박지욱 최초 생성
19 | *
20 | * @author 공통서비스 개발팀 박지욱
21 | * @since 2009.03.03
22 | * @version 1.0
23 | * @see
24 | *
25 | */
26 | @Schema(description = "사용자 정보 VO")
27 | @Getter
28 | @Setter
29 | public class LoginVO implements Serializable{
30 |
31 | /**
32 | *
33 | */
34 | private static final long serialVersionUID = -8274004534207618049L;
35 |
36 | @Schema(description = "아이디")
37 | private String id;
38 |
39 | @Schema(description = "이름")
40 | private String name;
41 |
42 | @Schema(description = "주민등록번호")
43 | private String ihidNum;
44 |
45 | @Email(regexp = "[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,3}")
46 | @Schema(description = "이메일주소")
47 | private String email;
48 |
49 | @Schema(description = "비밀번호")
50 | private String password;
51 |
52 | @Schema(description = "비밀번호 힌트")
53 | private String passwordHint;
54 |
55 | @Schema(description = "비밀번호 정답")
56 | private String passwordCnsr;
57 |
58 | @Schema(description = "사용자 구분", allowableValues = {"GNR", "ENT", "USR", "ADM"}, defaultValue = "USR")
59 | private String userSe; //사용자 구분에 ADM 추가
60 |
61 | @Schema(description = "조직(부서)ID")
62 | private String orgnztId;
63 |
64 | @Schema(description = "조직(부서)명")
65 | private String orgnztNm;
66 |
67 | @Schema(description = "고유아이디")
68 | private String uniqId;
69 |
70 | @Schema(description = "로그인 후 이동할 페이지")
71 | private String url;
72 |
73 | @Schema(description = "사용자 IP정보")
74 | private String ip;
75 |
76 | @Schema(description = "GPKI인증 DN")
77 | private String dn;
78 |
79 | @Schema(description = "그룹ID") //권한 그룹ID 추가
80 | private String groupId;
81 |
82 | @Schema(description = "그룹명") //권한 그룹명 추가
83 | private String groupNm;
84 |
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/ResponseCode.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | public enum ResponseCode {
4 |
5 | SUCCESS(200, "성공했습니다."),
6 | AUTH_ERROR(403, "인가된 사용자가 아닙니다."),
7 | DELETE_ERROR(700, "삭제 중 내부 오류가 발생했습니다."),
8 | SAVE_ERROR(800, "저장시 내부 오류가 발생했습니다."),
9 | INPUT_CHECK_ERROR(900, "입력값 무결성 오류 입니다.");
10 |
11 | private int code;
12 | private String message;
13 |
14 | private ResponseCode(int code, String message) {
15 | this.code = code;
16 | this.message = message;
17 | }
18 |
19 | public int getCode() {
20 | return code;
21 | }
22 |
23 | public String getMessage() {
24 | return message;
25 | }
26 |
27 |
28 |
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/SessionVO.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm;
2 |
3 | import java.io.Serializable;
4 |
5 | import lombok.Getter;
6 | import lombok.Setter;
7 |
8 | /**
9 | * 세션 VO 클래스
10 | * @author 공통서비스 개발팀 박지욱
11 | * @since 2009.03.06
12 | * @version 1.0
13 | * @see
14 | *
15 | *
16 | * << 개정이력(Modification Information) >>
17 | *
18 | * 수정일 수정자 수정내용
19 | * ------- -------- ---------------------------
20 | * 2009.03.06 박지욱 최초 생성
21 | *
22 | *
23 | */
24 | @Getter
25 | @Setter
26 | public class SessionVO implements Serializable {
27 |
28 | private static final long serialVersionUID = -2848741427493626376L;
29 | /** 아이디 */
30 | private String sUserId;
31 | /** 이름 */
32 | private String sUserNm;
33 | /** 이메일 */
34 | private String sEmail;
35 | /** 사용자구분 */
36 | private String sUserSe;
37 | /** 조직(부서)ID */
38 | private String orgnztId;
39 | /** 고유아이디 */
40 | private String uniqId;
41 |
42 | }
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/annotation/IncludedInfo.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.annotation;
2 |
3 | /**
4 | * 컴포넌트의 포함 정보 표현을 위한 annotation 클래스
5 | * 기본적으로 Controller 클래스에 annotation을 부여하되,
6 | * 하나의 Controller에 여러 개의 목록성 url mapping이 제공되는 경우에는
7 | * 메소드에 annotation을 부여한다.
8 | * @author 공통컴포넌트 정진오
9 | * @since 2011.08.26
10 | * @version 2.0.0
11 | * @see
12 | *
13 | *
14 | * << 개정이력(Modification Information) >>
15 | *
16 | * 수정일 수정자 수정내용
17 | * ------- -------- ---------------------------
18 | * 2011.08.26 정진오 최초 생성
19 | *
20 | *
21 | */
22 |
23 |
24 | import java.lang.annotation.Retention;
25 | import java.lang.annotation.RetentionPolicy;
26 |
27 | @Retention(RetentionPolicy.RUNTIME)
28 | public @interface IncludedInfo {
29 | String name() default ""; // 컴포넌트의 한글 이름
30 | String listUrl() default ""; // 컴포넌트의 목록정보조회를 위한 URL
31 | int order() default 0; // 자동 생성되는 메뉴 목록에 표시되는 순서
32 | int gid() default 0; // 컴포넌트의 Group ID(대분류 구분)
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/filter/HTMLTagFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008-2009 MOPAS(Ministry of Public Administration and Security).
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package egovframework.com.cmm.filter;
17 |
18 | import java.io.IOException;
19 |
20 | import javax.servlet.Filter;
21 | import javax.servlet.FilterChain;
22 | import javax.servlet.FilterConfig;
23 | import javax.servlet.ServletException;
24 | import javax.servlet.ServletRequest;
25 | import javax.servlet.ServletResponse;
26 | import javax.servlet.http.HttpServletRequest;
27 |
28 | public class HTMLTagFilter implements Filter{
29 |
30 | @SuppressWarnings("unused")
31 | private FilterConfig config;
32 |
33 | public void doFilter(ServletRequest request, ServletResponse response,
34 | FilterChain chain) throws IOException, ServletException {
35 |
36 | chain.doFilter(new HTMLTagFilterRequestWrapper((HttpServletRequest)request), response);
37 | }
38 |
39 | public void init(FilterConfig config) throws ServletException {
40 | this.config = config;
41 | }
42 |
43 | public void destroy() {
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/interceptor/AopExceptionTransfer.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.interceptor;
2 |
3 | import org.aspectj.lang.JoinPoint;
4 | import org.aspectj.lang.annotation.AfterThrowing;
5 | import org.aspectj.lang.annotation.Aspect;
6 | import org.aspectj.lang.annotation.Pointcut;
7 |
8 | import org.egovframe.rte.fdl.cmmn.aspect.ExceptionTransfer;
9 |
10 | @Aspect
11 | public class AopExceptionTransfer {
12 | private ExceptionTransfer exceptionTransfer;
13 |
14 | public void setExceptionTransfer(ExceptionTransfer exceptionTransfer) {
15 | this.exceptionTransfer = exceptionTransfer;
16 | }
17 |
18 | @Pointcut("execution(* egovframework.let..impl.*Impl.*(..)) or execution(* egovframework.com..impl.*Impl.*(..))")
19 | private void exceptionTransferService() {}
20 |
21 | @AfterThrowing(pointcut= "exceptionTransferService()", throwing="ex")
22 | public void doAfterThrowingExceptionTransferService(JoinPoint thisJoinPoint, Exception ex) throws Exception{
23 | exceptionTransfer.transfer(thisJoinPoint, ex);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/interceptor/AuthenticInterceptor.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.interceptor;
2 |
3 | import javax.servlet.ServletException;
4 | import javax.servlet.http.HttpServletRequest;
5 | import javax.servlet.http.HttpServletResponse;
6 |
7 | import org.springframework.web.servlet.ModelAndView;
8 | import org.springframework.web.servlet.ModelAndViewDefiningException;
9 | import org.springframework.web.servlet.mvc.WebContentInterceptor;
10 |
11 | import egovframework.com.cmm.LoginVO;
12 | import egovframework.com.cmm.util.EgovUserDetailsHelper;
13 | import lombok.extern.slf4j.Slf4j;
14 |
15 | /**
16 | * 인증여부 체크 인터셉터
17 | * @author 공통서비스 개발팀 서준식
18 | * @since 2011.07.01
19 | * @version 1.0
20 | * @see
21 | *
22 | *
23 | * << 개정이력(Modification Information) >>
24 | *
25 | * 수정일 수정자 수정내용
26 | * ------- -------- ---------------------------
27 | * 2011.07.01 서준식 최초 생성
28 | * 2011.09.07 서준식 인증이 필요없는 URL을 패스하는 로직 추가
29 | * 2014.06.11 이기하 인증이 필요없는 URL을 패스하는 로직 삭제(xml로 대체)
30 | *
31 | */
32 | @Slf4j
33 | public class AuthenticInterceptor extends WebContentInterceptor {
34 |
35 | /**
36 | * 세션에 계정정보(LoginVO)가 있는지 여부로 인증 여부를 체크한다.
37 | * 계정정보(LoginVO)가 없다면, 로그인 페이지로 이동한다.
38 | */
39 | @Override
40 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException {
41 |
42 | LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
43 |
44 | if (loginVO.getId() != null) {
45 |
46 | log.debug("AuthenticInterceptor sessionID "+loginVO.getId());
47 | log.debug("AuthenticInterceptor ================== ");
48 |
49 | return true;
50 | }
51 | log.debug("AuthenticInterceptor Fail!!!!!!!!!!!!================== ");
52 |
53 | ModelAndView modelAndView = new ModelAndView("redirect:http://localhost:3000/login");
54 | throw new ModelAndViewDefiningException(modelAndView);
55 | }
56 | }
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/interceptor/CustomAuthenticInterceptor.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.interceptor;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 | import javax.servlet.http.HttpSession;
6 |
7 | import org.springframework.web.servlet.HandlerInterceptor;
8 |
9 | import lombok.extern.slf4j.Slf4j;
10 |
11 | /**
12 | * 인증여부 체크 인터셉터
13 | * @author 공통서비스 개발팀 서준식
14 | * @since 2011.07.01
15 | * @version 1.0
16 | * @see
17 | *
18 | *
19 | * << 개정이력(Modification Information) >>
20 | *
21 | * 수정일 수정자 수정내용
22 | * ------- -------- ---------------------------
23 | * 2011.07.01 서준식 최초 생성
24 | * 2011.09.07 서준식 인증이 필요없는 URL을 패스하는 로직 추가
25 | *
26 | */
27 |
28 | @Slf4j
29 | public class CustomAuthenticInterceptor implements HandlerInterceptor {
30 |
31 | /**
32 | * 세션에 계정정보(LoginVO)가 있는지 여부로 인증 여부를 체크한다.
33 | * 계정정보(LoginVO)가 없다면, 로그인 페이지로 이동한다.
34 | */
35 | @Override
36 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
37 |
38 | HttpSession session = request.getSession();
39 | log.debug("CustomAuthenticInterceptor sessionID " + session.getId());
40 | log.debug("CustomAuthenticInterceptor ================== ");
41 |
42 | return true;
43 | }
44 |
45 | }
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/CmmnDetailCode.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service;
2 |
3 | import java.io.Serializable;
4 |
5 | import lombok.Getter;
6 | import lombok.Setter;
7 |
8 | /**
9 | * 공통상세코드 모델 클래스
10 | * @author 공통서비스 개발팀 이중호
11 | * @since 2009.04.01
12 | * @version 1.0
13 | * @see
14 | *
15 | *
16 | * << 개정이력(Modification Information) >>
17 | *
18 | * 수정일 수정자 수정내용
19 | * ------- -------- ---------------------------
20 | * 2009.04.01 이중호 최초 생성
21 | *
22 | *
23 | */
24 | @Getter
25 | @Setter
26 | public class CmmnDetailCode implements Serializable {
27 |
28 | private static final long serialVersionUID = -6508801327314181679L;
29 |
30 | /*
31 | * 코드ID
32 | */
33 | private String codeId = "";
34 |
35 | /*
36 | * 코드ID명
37 | */
38 | private String codeIdNm = "";
39 |
40 | /*
41 | * 코드
42 | */
43 | private String code = "";
44 |
45 | /*
46 | * 코드명
47 | */
48 | private String codeNm = "";
49 |
50 | /*
51 | * 코드설명
52 | */
53 | private String codeDc = "";
54 |
55 | /*
56 | * 사용여부
57 | */
58 | private String useAt = "";
59 |
60 | /*
61 | * 최초등록자ID
62 | */
63 | private String frstRegisterId = "";
64 |
65 | /*
66 | * 최종수정자ID
67 | */
68 | private String lastUpdusrId = "";
69 |
70 | }
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/EgovCmmUseService.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service;
2 |
3 | import java.util.List;
4 | import java.util.Map;
5 |
6 | import egovframework.com.cmm.ComDefaultCodeVO;
7 |
8 |
9 |
10 | /**
11 | *
12 | * 공통코드등 전체 업무에서 공용해서 사용해야 하는 서비스를 정의하기 위한 서비스 인터페이스
13 | * @author 공통서비스 개발팀 이삼섭
14 | * @since 2009.04.01
15 | * @version 1.0
16 | * @see
17 | *
18 | *
19 | * << 개정이력(Modification Information) >>
20 | *
21 | * 수정일 수정자 수정내용
22 | * ------- -------- ---------------------------
23 | * 2009.03.11 이삼섭 최초 생성
24 | *
25 | *
26 | */
27 | public interface EgovCmmUseService {
28 |
29 | /**
30 | * 공통코드를 조회한다.
31 | *
32 | * @param vo
33 | * @return List(코드)
34 | * @throws Exception
35 | */
36 | public List selectCmmCodeDetail(ComDefaultCodeVO vo) throws Exception;
37 |
38 | /**
39 | * ComDefaultCodeVO의 리스트를 받아서 여러개의 코드 리스트를 맵에 담아서 리턴한다.
40 | *
41 | * @param voList
42 | * @return Map(코드)
43 | * @throws Exception
44 | */
45 | public Map> selectCmmCodeDetails(List> voList) throws Exception;
46 |
47 | /**
48 | * 조직정보를 코드형태로 리턴한다.
49 | *
50 | * @param 조회조건정보 vo
51 | * @return 조직정보 List
52 | * @throws Exception
53 | */
54 | public List selectOgrnztIdDetail(ComDefaultCodeVO vo) throws Exception;
55 |
56 | /**
57 | * 그룹정보를 코드형태로 리턴한다.
58 | *
59 | * @param 조회조건정보 vo
60 | * @return 그룹정보 List
61 | * @throws Exception
62 | */
63 | public List selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception;
64 | }
65 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/EgovFileMngService.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service;
2 |
3 | import java.util.List;
4 | import java.util.Map;
5 |
6 | /**
7 | * @Class Name : EgovFileMngService.java
8 | * @Description : 파일정보의 관리를 위한 서비스 인터페이스
9 | * @Modification Information
10 | *
11 | * 수정일 수정자 수정내용
12 | * ------- ------- -------------------
13 | * 2009. 3. 25. 이삼섭 최초생성
14 | *
15 | * @author 공통 서비스 개발팀 이삼섭
16 | * @since 2009. 3. 25.
17 | * @version
18 | * @see
19 | *
20 | */
21 | public interface EgovFileMngService {
22 |
23 | /**
24 | * 파일에 대한 목록을 조회한다.
25 | *
26 | * @param fvo
27 | * @return
28 | * @throws Exception
29 | */
30 | public List selectFileInfs(FileVO fvo) throws Exception;
31 |
32 | /**
33 | * 하나의 파일에 대한 정보(속성 및 상세)를 등록한다.
34 | *
35 | * @param fvo
36 | * @throws Exception
37 | */
38 | public String insertFileInf(FileVO fvo) throws Exception;
39 |
40 | /**
41 | * 여러 개의 파일에 대한 정보(속성 및 상세)를 등록한다.
42 | *
43 | * @param fvoList
44 | * @throws Exception
45 | */
46 | public String insertFileInfs(List> fvoList) throws Exception;
47 |
48 | /**
49 | * 여러 개의 파일에 대한 정보(속성 및 상세)를 수정한다.
50 | *
51 | * @param fvoList
52 | * @throws Exception
53 | */
54 | public void updateFileInfs(List> fvoList) throws Exception;
55 |
56 | /**
57 | * 여러 개의 파일을 삭제한다.
58 | *
59 | * @param fvoList
60 | * @throws Exception
61 | */
62 | public void deleteFileInfs(List> fvoList) throws Exception;
63 |
64 | /**
65 | * 하나의 파일을 삭제한다.
66 | *
67 | * @param fvo
68 | * @throws Exception
69 | */
70 | public void deleteFileInf(FileVO fvo) throws Exception;
71 |
72 | /**
73 | * 파일에 대한 상세정보를 조회한다.
74 | *
75 | * @param fvo
76 | * @return
77 | * @throws Exception
78 | */
79 | public FileVO selectFileInf(FileVO fvo) throws Exception;
80 |
81 | /**
82 | * 파일 구분자에 대한 최대값을 구한다.
83 | *
84 | * @param fvo
85 | * @return
86 | * @throws Exception
87 | */
88 | public int getMaxFileSN(FileVO fvo) throws Exception;
89 |
90 | /**
91 | * 전체 파일을 삭제한다.
92 | *
93 | * @param fvo
94 | * @throws Exception
95 | */
96 | public void deleteAllFileInf(FileVO fvo) throws Exception;
97 |
98 | /**
99 | * 파일명 검색에 대한 목록을 조회한다.
100 | *
101 | * @param fvo
102 | * @return
103 | * @throws Exception
104 | */
105 | public Map selectFileListByFileNm(FileVO fvo) throws Exception;
106 |
107 | /**
108 | * 이미지 파일에 대한 목록을 조회한다.
109 | *
110 | * @param vo
111 | * @return
112 | * @throws Exception
113 | */
114 | public List selectImageFileList(FileVO vo) throws Exception;
115 | }
116 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/EgovUserDetailsService.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service;
2 |
3 | import java.util.List;
4 |
5 | public interface EgovUserDetailsService {
6 |
7 | /**
8 | * 인증된 사용자객체를 VO형식으로 가져온다.
9 | * @return Object - 사용자 ValueObject
10 | */
11 | public Object getAuthenticatedUser();
12 |
13 | /**
14 | * 인증된 사용자의 권한 정보를 가져온다.
15 | * 예) [ROLE_ADMIN, ROLE_USER, ROLE_A, ROLE_B, ROLE_RESTRICTED, IS_AUTHENTICATED_FULLY, IS_AUTHENTICATED_REMEMBERED, IS_AUTHENTICATED_ANONYMOUSLY]
16 | * @return List - 사용자 권한정보 목록
17 | */
18 | public List getAuthorities();
19 |
20 | /**
21 | * 인증된 사용자 여부를 체크한다.
22 | * @return Boolean - 인증된 사용자 여부(TRUE / FALSE)
23 | */
24 | public Boolean isAuthenticated();
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/FileVO.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service;
2 |
3 | import java.io.Serializable;
4 |
5 | import lombok.Getter;
6 | import lombok.Setter;
7 | import org.apache.commons.lang3.builder.ToStringBuilder;
8 |
9 | import io.swagger.v3.oas.annotations.media.Schema;
10 |
11 | /**
12 | * @Class Name : FileVO.java
13 | * @Description : 파일정보 처리를 위한 VO 클래스
14 | * @Modification Information
15 | *
16 | * 수정일 수정자 수정내용
17 | * ------- ------- -------------------
18 | * 2009. 3. 25. 이삼섭
19 | *
20 | * @author 공통 서비스 개발팀 이삼섭
21 | * @since 2009. 3. 25.
22 | * @version
23 | * @see
24 | *
25 | */
26 | @Schema(description = "파일 정보 VO")
27 | @Getter
28 | @Setter
29 | public class FileVO implements Serializable {
30 |
31 | /**
32 | * serialVersion UID
33 | */
34 | private static final long serialVersionUID = -287950405903719128L;
35 |
36 | @Schema(description = "첨부파일 아이디")
37 | public String atchFileId = "";
38 |
39 | @Schema(description = "생성일자")
40 | public String creatDt = "";
41 |
42 | @Schema(description = "파일내용")
43 | public String fileCn = "";
44 |
45 | @Schema(description = "파일확장자")
46 | public String fileExtsn = "";
47 |
48 | @Schema(description = "파일크기")
49 | public String fileMg = "";
50 |
51 | @Schema(description = "파일연번")
52 | public String fileSn = "";
53 |
54 | @Schema(description = "파일저장경로")
55 | public String fileStreCours = "";
56 |
57 | @Schema(description = "원파일명")
58 | public String orignlFileNm = "";
59 |
60 | @Schema(description = "저장파일명")
61 | public String streFileNm = "";
62 |
63 | /**
64 | * toString 메소드를 대치한다.
65 | */
66 | public String toString() {
67 | return ToStringBuilder.reflectionToString(this);
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/Globals.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service;
2 |
3 | /**
4 | * Class Name : Globals.java
5 | * Description : 시스템 구동 시 프로퍼티를 통해 사용될 전역변수를 정의한다.
6 | * Modification Information
7 | *
8 | * 수정일 수정자 수정내용
9 | * ------- -------- ---------------------------
10 | * 2009.01.19 박지욱 최초 생성
11 | *
12 | * @author 공통 서비스 개발팀 박지욱
13 | * @since 2009. 01. 19
14 | * @version 1.0
15 | * @see
16 | *
17 | */
18 |
19 | public class Globals {
20 | //파일 업로드 원 파일명
21 | public static final String ORIGIN_FILE_NM = "originalFileName";
22 | //파일 확장자
23 | public static final String FILE_EXT = "fileExtension";
24 | //파일크기
25 | public static final String FILE_SIZE = "fileSize";
26 | //업로드된 파일명
27 | public static final String UPLOAD_FILE_NM = "uploadFileName";
28 | //파일경로
29 | public static final String FILE_PATH = "filePath";
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/IntermediateResultVO.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service;
2 |
3 | import com.fasterxml.jackson.annotation.JsonInclude;
4 |
5 | import egovframework.com.cmm.ResponseCode;
6 | import io.swagger.v3.oas.annotations.media.Schema;
7 | import lombok.Getter;
8 | import lombok.Setter;
9 | /**
10 | * 제네릭으로 응답 객체를 받아 동적으로 처리하기 위한 VO 클래스 입니다.
11 | * 추후 응답 객체로 모두 변환이 완료되면 ResultVO를 대체하여 사용합니다.
12 | *
13 | * result 반환 문제로 인해 사용되는 임시 클래스 입니다.
14 | *
15 | * @author 김재섭(nirsa)
16 | * @since 2025.04.10
17 | * @version 1.0
18 | * @see
19 | *
20 | *
21 | * << 개정이력(Modification Information) >>
22 | *
23 | * 수정일 수정자 수정내용
24 | * ---------- ------------ -------------------
25 | * 2025.04.10 김재섭(nirsa) 최초 생성
26 | *
27 | *
28 | */
29 |
30 |
31 | @Schema(description = "응답 객체 VO (최종 구조로 가는 중간 단계 VO)")
32 | @Getter
33 | @Setter
34 | public class IntermediateResultVO {
35 |
36 | @Schema(description = "응답 코드", example = "0")
37 | private int resultCode;
38 |
39 | @Schema(description = "응답 메시지", example = "OK")
40 | private String resultMessage;
41 |
42 | @JsonInclude(JsonInclude.Include.NON_NULL)
43 | @Schema(description = "응답 객체")
44 | private T result;
45 |
46 | public static IntermediateResultVO success(T data) {
47 | IntermediateResultVO result = new IntermediateResultVO<>();
48 | result.setResultCode(ResponseCode.SUCCESS.getCode());
49 | result.setResultMessage(ResponseCode.SUCCESS.getMessage());
50 | result.setResult(data);
51 | return result;
52 | }
53 |
54 | public static IntermediateResultVO inputCheckError(T data) {
55 | IntermediateResultVO result = new IntermediateResultVO<>();
56 | result.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode());
57 | result.setResultMessage(ResponseCode.INPUT_CHECK_ERROR.getMessage());
58 | result.setResult(data);
59 | return result;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/ResultVO.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import io.swagger.v3.oas.annotations.media.Schema;
7 | import lombok.Getter;
8 | import lombok.Setter;
9 |
10 | @Schema(description = "응답 객체 VO")
11 | @Getter
12 | @Setter
13 | public class ResultVO {
14 |
15 | @Schema(description = "응답 코드")
16 | private int resultCode = 0;
17 |
18 | @Schema(description = "응답 메시지")
19 | private String resultMessage = "OK";
20 | private Map result = new HashMap();
21 |
22 | public void putResult(String key, Object value) {
23 | result.put(key, value);
24 | }
25 |
26 | public Object getResult(String key) {
27 | return this.result.get(key);
28 | }
29 |
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/impl/CmmUseDAO.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service.impl;
2 |
3 | import java.util.List;
4 |
5 | import org.egovframe.rte.psl.dataaccess.EgovAbstractMapper;
6 | import org.springframework.stereotype.Repository;
7 |
8 | import egovframework.com.cmm.ComDefaultCodeVO;
9 | import egovframework.com.cmm.service.CmmnDetailCode;
10 |
11 | /**
12 | * @Class Name : CmmUseDAO.java
13 | * @Description : 공통코드등 전체 업무에서 공용해서 사용해야 하는 서비스를 정의하기위한 데이터 접근 클래스
14 | * @Modification Information
15 | *
16 | * 수정일 수정자 수정내용
17 | * ------- ------- -------------------
18 | * 2009. 3. 11. 이삼섭
19 | *
20 | * @author 공통 서비스 개발팀 이삼섭
21 | * @since 2009. 3. 11.
22 | * @version
23 | * @see
24 | *
25 | */
26 | @Repository("cmmUseDAO")
27 | public class CmmUseDAO extends EgovAbstractMapper {
28 |
29 | /**
30 | * 주어진 조건에 따른 공통코드를 불러온다.
31 | *
32 | * @param vo
33 | * @return
34 | * @throws Exception
35 | */
36 | public List selectCmmCodeDetail(ComDefaultCodeVO vo) throws Exception {
37 | return selectList("CmmUseDAO.selectCmmCodeDetail", vo);
38 | }
39 |
40 | /**
41 | * 공통코드로 사용할 조직정보를 를 불러온다.
42 | *
43 | * @param vo
44 | * @return
45 | * @throws Exception
46 | */
47 | public List selectOgrnztIdDetail(ComDefaultCodeVO vo) throws Exception {
48 | return selectList("CmmUseDAO.selectOgrnztIdDetail", vo);
49 | }
50 |
51 | /**
52 | * 공통코드로 사용할그룹정보를 를 불러온다.
53 | *
54 | * @param vo
55 | * @return
56 | * @throws Exception
57 | */
58 | public List selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception {
59 | return selectList("CmmUseDAO.selectGroupIdDetail", vo);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/impl/EgovCmmUseServiceImpl.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service.impl;
2 |
3 | import java.util.HashMap;
4 | import java.util.Iterator;
5 | import java.util.List;
6 | import java.util.Map;
7 |
8 | import egovframework.com.cmm.ComDefaultCodeVO;
9 | import egovframework.com.cmm.service.CmmnDetailCode;
10 | import egovframework.com.cmm.service.EgovCmmUseService;
11 |
12 | import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
13 |
14 | import javax.annotation.Resource;
15 |
16 | import org.springframework.stereotype.Service;
17 |
18 | /**
19 | * @Class Name : EgovCmmUseServiceImpl.java
20 | * @Description : 공통코드등 전체 업무에서 공용해서 사용해야 하는 서비스를 정의하기위한 서비스 구현 클래스
21 | * @Modification Information
22 | *
23 | * 수정일 수정자 수정내용
24 | * ------- ------- -------------------
25 | * 2009. 3. 11. 이삼섭
26 | *
27 | * @author 공통 서비스 개발팀 이삼섭
28 | * @since 2009. 3. 11.
29 | * @version
30 | * @see
31 | *
32 | */
33 | @Service("EgovCmmUseService")
34 | public class EgovCmmUseServiceImpl extends EgovAbstractServiceImpl implements EgovCmmUseService {
35 |
36 | @Resource(name = "cmmUseDAO")
37 | private CmmUseDAO cmmUseDAO;
38 |
39 | /**
40 | * 공통코드를 조회한다.
41 | *
42 | * @param vo
43 | * @return
44 | * @throws Exception
45 | */
46 | @Override
47 | public List selectCmmCodeDetail(ComDefaultCodeVO vo) throws Exception {
48 | return cmmUseDAO.selectCmmCodeDetail(vo);
49 | }
50 |
51 | /**
52 | * ComDefaultCodeVO의 리스트를 받아서 여러개의 코드 리스트를 맵에 담아서 리턴한다.
53 | *
54 | * @param voList
55 | * @return
56 | * @throws Exception
57 | */
58 | @Override
59 | public Map> selectCmmCodeDetails(List> voList) throws Exception {
60 | ComDefaultCodeVO vo;
61 | Map> map = new HashMap>();
62 |
63 | Iterator> iter = voList.iterator();
64 | while (iter.hasNext()) {
65 | vo = (ComDefaultCodeVO) iter.next();
66 | map.put(vo.getCodeId(), cmmUseDAO.selectCmmCodeDetail(vo));
67 | }
68 |
69 | return map;
70 | }
71 |
72 | /**
73 | * 조직정보를 코드형태로 리턴한다.
74 | *
75 | * @param 조회조건정보 vo
76 | * @return 조직정보 List
77 | * @throws Exception
78 | */
79 | @Override
80 | public List selectOgrnztIdDetail(ComDefaultCodeVO vo) throws Exception {
81 | return cmmUseDAO.selectOgrnztIdDetail(vo);
82 | }
83 |
84 | /**
85 | * 그룹정보를 코드형태로 리턴한다.
86 | *
87 | * @param 조회조건정보 vo
88 | * @return 그룹정보 List
89 | * @throws Exception
90 | */
91 | @Override
92 | public List selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception {
93 | return cmmUseDAO.selectGroupIdDetail(vo);
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/impl/EgovTestUserDetailsServiceImpl.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service.impl;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import egovframework.com.cmm.LoginVO;
7 | import egovframework.com.cmm.service.EgovUserDetailsService;
8 |
9 | import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
10 |
11 | /**
12 | *
13 | * @author 공통서비스 개발팀 서준식
14 | * @since 2011. 8. 12.
15 | * @version 1.0
16 | * @see
17 | *
18 | *
19 | * 개정이력(Modification Information)
20 | *
21 | * 수정일 수정자 수정내용
22 | * ------- -------- ---------------------------
23 | * 2011. 8. 12. 서준식 최초생성
24 | *
25 | *
26 | */
27 |
28 | public class EgovTestUserDetailsServiceImpl extends EgovAbstractServiceImpl implements
29 | EgovUserDetailsService {
30 |
31 | @Override
32 | public Object getAuthenticatedUser() {
33 |
34 | LoginVO loginVO = new LoginVO();
35 | loginVO.setId("TEST1");
36 | loginVO.setPassword("raHLBnHFcunwNzcDcfad4PhD11hHgXSUr7fc1Jk9uoQ=");
37 | loginVO.setUserSe("USR");
38 | loginVO.setEmail("egovframe@nia.or.kr");
39 | loginVO.setIhidNum("");
40 | loginVO.setName("더미사용자");
41 | loginVO.setOrgnztId("ORGNZT_0000000000000");
42 | loginVO.setUniqId("USRCNFRM_00000000000");
43 | return loginVO;
44 |
45 | // return
46 | // RequestContextHolder.getRequestAttributes().getAttribute("loginVO",
47 | // RequestAttributes.SCOPE_SESSION);
48 |
49 | }
50 |
51 | @Override
52 | public List getAuthorities() {
53 |
54 | // 권한 설정을 리턴한다.
55 |
56 | List listAuth = new ArrayList();
57 | listAuth.add("IS_AUTHENTICATED_ANONYMOUSLY");
58 | listAuth.add("IS_AUTHENTICATED_FULLY");
59 | listAuth.add("IS_AUTHENTICATED_REMEMBERED");
60 | listAuth.add("ROLE_ADMIN");
61 | listAuth.add("ROLE_ANONYMOUS");
62 | listAuth.add("ROLE_RESTRICTED");
63 | listAuth.add("ROLE_USER");
64 |
65 | return listAuth;
66 | }
67 |
68 | @Override
69 | public Boolean isAuthenticated() {
70 | // 인증된 유저인지 확인한다.
71 |
72 | /*if (RequestContextHolder.getRequestAttributes() == null) {
73 | return false;
74 | } else {
75 |
76 | if (RequestContextHolder.getRequestAttributes().getAttribute(
77 | "loginVO", RequestAttributes.SCOPE_SESSION) == null) {
78 | return false;
79 | } else {
80 | return true;
81 | }
82 | }*/
83 |
84 | return true;
85 | }
86 |
87 | }
88 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/service/impl/EgovUserDetailsSessionServiceImpl.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.service.impl;
2 |
3 | import java.util.List;
4 |
5 | import egovframework.com.cmm.service.EgovUserDetailsService;
6 | import egovframework.com.cmm.util.EgovUserDetailsHelper;
7 |
8 | import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
9 |
10 | /**
11 | *
12 | * @author 공통서비스 개발팀 서준식
13 | * @since 2011. 6. 25.
14 | * @version 1.0
15 | * @see
16 | *
17 | *
18 | * 개정이력(Modification Information)
19 | *
20 | * 수정일 수정자 수정내용
21 | * ------- -------- ---------------------------
22 | * 2011. 8. 12. 서준식 최초생성
23 | *
24 | *
25 | */
26 |
27 | public class EgovUserDetailsSessionServiceImpl extends EgovAbstractServiceImpl implements
28 | EgovUserDetailsService {
29 |
30 | @Override
31 | public Object getAuthenticatedUser() {
32 | if (EgovUserDetailsHelper.isAuthenticated()) {
33 | return EgovUserDetailsHelper.getAuthenticatedUser();
34 | }
35 | return null;
36 | }
37 |
38 | @Override
39 | public List getAuthorities() {
40 | // return listAuth;
41 | return EgovUserDetailsHelper.getAuthorities();
42 | }
43 |
44 | @Override
45 | public Boolean isAuthenticated() {
46 | // 인증된 유저인지 확인한다.
47 | return EgovUserDetailsHelper.isAuthenticated();
48 |
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/util/EgovBasicLogger.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.util;
2 |
3 | import java.util.logging.Level;
4 | import java.util.logging.Logger;
5 |
6 | /**
7 | * Utility class to support to logging information
8 | * @author Vincent Han
9 | * @since 2014.09.18
10 | * @version 1.0
11 | * @see
12 | *
13 | *
14 | * << 개정이력(Modification Information) >>
15 | *
16 | * 수정일 수정자 수정내용
17 | * ------- -------- ---------------------------
18 | * 2014.09.18 표준프레임워크센터 최초 생성
19 | *
20 | *
21 | */
22 | public class EgovBasicLogger {
23 | private static final Level IGNORE_INFO_LEVEL = Level.OFF;
24 | private static final Level DEBUG_INFO_LEVEL = Level.FINEST;
25 | private static final Level INFO_INFO_LEVEL = Level.INFO;
26 |
27 | private static final Logger ignoreLogger = Logger.getLogger("ignore");
28 | private static final Logger debugLogger = Logger.getLogger("debug");
29 | private static final Logger infoLogger = Logger.getLogger("info");
30 |
31 | /**
32 | * 기록이나 처리가 불필요한 경우 사용.
33 | * @param message
34 | * @param exception
35 | */
36 | public static void ignore(String message, Exception exception) {
37 | if (exception == null) {
38 | ignoreLogger.log(IGNORE_INFO_LEVEL, message);
39 | } else {
40 | ignoreLogger.log(IGNORE_INFO_LEVEL, message, exception);
41 | }
42 | }
43 |
44 | /**
45 | * 기록이나 처리가 불필요한 경우 사용.
46 | * @param message
47 | * @param exception
48 | */
49 | public static void ignore(String message) {
50 | ignore(message, null);
51 | }
52 |
53 | /**
54 | * 디버그 정보를 기록하는 경우 사용.
55 | * @param message
56 | * @param exception
57 | */
58 | public static void debug(String message, Exception exception) {
59 | if (exception == null) {
60 | debugLogger.log(DEBUG_INFO_LEVEL, message);
61 | } else {
62 | debugLogger.log(DEBUG_INFO_LEVEL, message, exception);
63 | }
64 | }
65 |
66 | /**
67 | * 디버그 정보를 기록하는 경우 사용.
68 | * @param message
69 | * @param exception
70 | */
71 | public static void debug(String message) {
72 | debug(message, null);
73 | }
74 |
75 | /**
76 | * 일반적이 정보를 기록하는 경우 사용.
77 | * @param message
78 | * @param exception
79 | */
80 | public static void info(String message) {
81 | infoLogger.log(INFO_INFO_LEVEL, message);
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/util/EgovIdGnrBuilder.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.util;
2 |
3 | import javax.sql.DataSource;
4 |
5 | import org.egovframe.rte.fdl.idgnr.impl.EgovTableIdGnrServiceImpl;
6 | import org.egovframe.rte.fdl.idgnr.impl.strategy.EgovIdGnrStrategyImpl;
7 |
8 | /**
9 | * @ClassName : EgovIdGnrBuilder.java
10 | * @Description : IdGen 정보 builder
11 | *
12 | * @author : 윤주호
13 | * @since : 2021. 7. 20
14 | * @version : 1.0
15 | *
16 | *
17 | * << 개정이력(Modification Information) >>
18 | *
19 | * 수정일 수정자 수정내용
20 | * ------------- ------------ ---------------------
21 | * 2021. 7. 20 윤주호 최초 생성
22 | *
23 | *
24 | */
25 | public class EgovIdGnrBuilder {
26 |
27 | // TODO : 기본값 설정, 예외처리 필요
28 |
29 | private DataSource dataSource;
30 | private EgovIdGnrStrategyImpl egovIdGnrStrategyImpl;
31 |
32 | private String preFix;
33 | private int cipers;
34 | private char fillChar;
35 |
36 | private int blockSize;
37 | private String table;
38 | private String tableName;
39 |
40 | public EgovIdGnrBuilder setDataSource(DataSource dataSource) {
41 | this.dataSource = dataSource;
42 | return this;
43 | }
44 |
45 | public EgovIdGnrBuilder setEgovIdGnrStrategyImpl(EgovIdGnrStrategyImpl egovIdGnrStrategyImpl) {
46 | this.egovIdGnrStrategyImpl = egovIdGnrStrategyImpl;
47 | return this;
48 | }
49 |
50 | public EgovIdGnrBuilder setPreFix(String preFix) {
51 | this.preFix = preFix;
52 | return this;
53 | }
54 | public EgovIdGnrBuilder setCipers(int cipers) {
55 | this.cipers = cipers;
56 | return this;
57 | }
58 | public EgovIdGnrBuilder setFillChar(char fillChar) {
59 | this.fillChar = fillChar;
60 | return this;
61 | }
62 | public EgovIdGnrBuilder setBlockSize(int blockSize) {
63 | this.blockSize = blockSize;
64 | return this;
65 | }
66 | public EgovIdGnrBuilder setTable(String table) {
67 | this.table = table;
68 | return this;
69 | }
70 | public EgovIdGnrBuilder setTableName(String tableName) {
71 | this.tableName = tableName;
72 | return this;
73 | }
74 |
75 | public EgovTableIdGnrServiceImpl build() {
76 |
77 | EgovTableIdGnrServiceImpl egovTableIdGnrServiceImpl = new EgovTableIdGnrServiceImpl();
78 | egovTableIdGnrServiceImpl.setDataSource(dataSource);
79 | if(egovIdGnrStrategyImpl != null) {
80 | egovIdGnrStrategyImpl = new EgovIdGnrStrategyImpl();
81 | egovIdGnrStrategyImpl.setPrefix(preFix);
82 | egovIdGnrStrategyImpl.setCipers(cipers);
83 | egovIdGnrStrategyImpl.setFillChar(fillChar);
84 |
85 | egovTableIdGnrServiceImpl.setStrategy(egovIdGnrStrategyImpl);
86 | }
87 | egovTableIdGnrServiceImpl.setBlockSize(blockSize);
88 | egovTableIdGnrServiceImpl.setTable(table);
89 | egovTableIdGnrServiceImpl.setTableName(tableName);
90 |
91 | return egovTableIdGnrServiceImpl;
92 | }
93 |
94 |
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/util/EgovUserDetailsHelper.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.util;
2 |
3 | import java.util.List;
4 | import java.util.stream.Collectors;
5 |
6 | import org.springframework.security.core.Authentication;
7 | import org.springframework.security.core.GrantedAuthority;
8 | import org.springframework.security.core.context.SecurityContextHolder;
9 | import egovframework.com.cmm.LoginVO;
10 |
11 | /**
12 | * EgovUserDetails Helper 클래스
13 | *
14 | * @author sjyoon
15 | * @since 2009.06.01
16 | * @version 1.0
17 | * @see
18 | *
19 | *
20 | * << 개정이력(Modification Information) >>
21 | *
22 | * 수정일 수정자 수정내용
23 | * ------- ------------- ----------------------
24 | * 2009.03.10 sjyoon 최초 생성
25 | * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성
26 | *
27 | *
28 | */
29 |
30 | public class EgovUserDetailsHelper {
31 |
32 | /**
33 | * 인증된 사용자객체를 VO형식으로 가져온다.
34 | * @return Object - 사용자 ValueObject
35 | */
36 | public static Object getAuthenticatedUser() {
37 | Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
38 | return (LoginVO) authentication.getPrincipal();
39 |
40 | }
41 |
42 | /**
43 | * 인증된 사용자의 권한 정보를 가져온다.
44 | * 예) [ROLE_ADMIN, ROLE_USER, ROLE_A, ROLE_B, ROLE_RESTRICTED, IS_AUTHENTICATED_FULLY, IS_AUTHENTICATED_REMEMBERED, IS_AUTHENTICATED_ANONYMOUSLY]
45 | * @return List - 사용자 권한정보 목록
46 | */
47 | public static List getAuthorities() {
48 | Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
49 | return authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority).collect(Collectors.toList());
50 | }
51 |
52 | /**
53 | * 인증된 사용자 여부를 체크한다.
54 | * @return Boolean - 인증된 사용자 여부(TRUE / FALSE)
55 | */
56 | public static Boolean isAuthenticated() {
57 | return EgovUserDetailsHelper.getAuthenticatedUser()!=null? Boolean.TRUE : Boolean.FALSE ;
58 |
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/util/ResultVoHelper.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.util;
2 |
3 | import java.util.Map;
4 |
5 | import org.springframework.stereotype.Component;
6 |
7 | import egovframework.com.cmm.ResponseCode;
8 | import egovframework.com.cmm.service.ResultVO;
9 | /**
10 | * ResultVO 생성을 돕는 헬퍼 유틸리티 클래스
11 | * 공통 응답 객체(ResultVO)를 표준 구조로 생성할 수 있도록 사용하는 클래스 입니다.
12 | *
13 | * @author 김재섭(nirsa)
14 | * @since 2025.04.06
15 | * @version 1.0
16 | * @see
17 | *
18 | *
19 | * << 개정이력(Modification Information) >>
20 | *
21 | * 수정일 수정자 수정내용
22 | * ---------- ------------ -------------------
23 | * 2025.04.06 김재섭(nirsa) 최초 생성
24 | *
25 | *
26 | */
27 |
28 | @Component
29 | public class ResultVoHelper {
30 | /**
31 | * Map 기반 결과 데이터를 ResultVO로 생성한다.
32 | *
33 | * @param resultMap 결과 데이터 Map
34 | * @param code 응답 코드 (ResponseCode)
35 | * @return 생성된 ResultVO 객체
36 | */
37 | public ResultVO buildFromMap(Map resultMap, ResponseCode code) {
38 | ResultVO resultVO = new ResultVO();
39 | resultVO.setResult(resultMap);
40 | resultVO.setResultCode(code.getCode());
41 | resultVO.setResultMessage(code.getMessage());
42 | return resultVO;
43 | }
44 |
45 | /**
46 | * 이미 생성된 ResultVO 객체에 응답 코드 및 메시지를 설정한다.
47 | *
48 | * @param resultVO 결과 VO 객체
49 | * @param code 응답 코드 (ResponseCode)
50 | * @return 코드가 적용된 ResultVO 객체
51 | */
52 | public ResultVO buildFromResultVO(ResultVO resultVO, ResponseCode code) {
53 | resultVO.setResultCode(code.getCode());
54 | resultVO.setResultMessage(code.getMessage());
55 | return resultVO;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/cmm/web/EgovBindingInitializer.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.cmm.web;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Date;
5 |
6 | import org.springframework.beans.propertyeditors.CustomDateEditor;
7 | import org.springframework.beans.propertyeditors.StringTrimmerEditor;
8 | import org.springframework.web.bind.WebDataBinder;
9 | import org.springframework.web.bind.support.WebBindingInitializer;
10 |
11 | public class EgovBindingInitializer implements WebBindingInitializer {
12 |
13 | @Override
14 | public void initBinder(WebDataBinder binder) {
15 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
16 | dateFormat.setLenient(false);
17 | binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
18 | binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/config/EgovConfigApp.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.config;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.context.annotation.Import;
5 | import org.springframework.context.annotation.PropertySource;
6 | import org.springframework.context.annotation.PropertySources;
7 |
8 | @Configuration
9 | @Import({
10 | EgovConfigAppAspect.class,
11 | EgovConfigAppCommon.class,
12 | EgovConfigAppDatasource.class,
13 | EgovConfigAppIdGen.class,
14 | EgovConfigAppProperties.class,
15 | EgovConfigAppMapper.class,
16 | EgovConfigAppTransaction.class,
17 | EgovConfigAppValidator.class,
18 | EgovConfigAppWhitelist.class
19 | })
20 | @PropertySources({
21 | @PropertySource("classpath:/application.properties")
22 | }) //CAUTION: min JDK 8
23 | public class EgovConfigApp {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/config/EgovConfigAppMapper.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.config;
2 |
3 | import java.io.IOException;
4 |
5 | import javax.annotation.PostConstruct;
6 | import javax.sql.DataSource;
7 |
8 | import org.apache.ibatis.session.SqlSessionFactory;
9 | import org.mybatis.spring.SqlSessionFactoryBean;
10 | import org.mybatis.spring.SqlSessionTemplate;
11 | import org.springframework.beans.factory.annotation.Autowired;
12 | import org.springframework.beans.factory.annotation.Qualifier;
13 | import org.springframework.context.annotation.Bean;
14 | import org.springframework.context.annotation.Configuration;
15 | import org.springframework.context.annotation.Lazy;
16 | import org.springframework.context.annotation.PropertySource;
17 | import org.springframework.context.annotation.PropertySources;
18 | import org.springframework.core.env.Environment;
19 | import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
20 | import org.springframework.jdbc.support.lob.DefaultLobHandler;
21 |
22 | /**
23 | * @ClassName : EgovConfigAppMapper.java
24 | * @Description : Mapper 설정
25 | *
26 | * @author : 윤주호
27 | * @since : 2021. 7. 20
28 | * @version : 1.0
29 | *
30 | *
31 | * << 개정이력(Modification Information) >>
32 | *
33 | * 수정일 수정자 수정내용
34 | * ------------- ------------ ---------------------
35 | * 2021. 7. 20 윤주호 최초 생성
36 | *
37 | *
38 | */
39 | @Configuration
40 | @PropertySources({
41 | @PropertySource("classpath:/application.properties")
42 | })
43 | public class EgovConfigAppMapper {
44 | @Autowired
45 | DataSource dataSource;
46 |
47 | @Autowired
48 | Environment env;
49 |
50 | private String dbType;
51 |
52 | @PostConstruct
53 | void init() {
54 | dbType = env.getProperty("Globals.DbType");
55 | }
56 |
57 | @Bean
58 | @Lazy
59 | public DefaultLobHandler lobHandler() {
60 | return new DefaultLobHandler();
61 | }
62 |
63 | @Bean(name = {"sqlSession", "egov.sqlSession"})
64 | public SqlSessionFactoryBean sqlSession() {
65 | SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
66 | sqlSessionFactoryBean.setDataSource(dataSource);
67 |
68 | PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver = new PathMatchingResourcePatternResolver();
69 |
70 | sqlSessionFactoryBean.setConfigLocation(
71 | pathMatchingResourcePatternResolver
72 | .getResource("classpath:/egovframework/mapper/config/mapper-config.xml"));
73 |
74 | try {
75 | sqlSessionFactoryBean.setMapperLocations(
76 | pathMatchingResourcePatternResolver
77 | .getResources("classpath:/egovframework/mapper/let/**/*_" + dbType + ".xml"));
78 | } catch (IOException e) {
79 | // TODO Exception 처리 필요
80 | }
81 |
82 | return sqlSessionFactoryBean;
83 | }
84 |
85 | @Bean
86 | public SqlSessionTemplate egovSqlSessionTemplate(@Qualifier("sqlSession") SqlSessionFactory sqlSession) {
87 | SqlSessionTemplate sqlSessionTemplate = new SqlSessionTemplate(sqlSession);
88 | return sqlSessionTemplate;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/config/EgovConfigAppMsg.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.config;
2 |
3 | import egovframework.com.cmm.EgovMessageSource;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.context.support.ReloadableResourceBundleMessageSource;
7 |
8 | /**
9 | * fileName : EgovConfigAppMsg
10 | * author : crlee
11 | * date : 2023/05/05
12 | * description :
13 | * ===========================================================
14 | * DATE AUTHOR NOTE
15 | * -----------------------------------------------------------
16 | * 2023/05/05 crlee 최초 생성
17 | */
18 | @Configuration
19 | public class EgovConfigAppMsg {
20 |
21 | /**
22 | * @return [Resource 설정] 메세지 Properties 경로 설정
23 | */
24 | @Bean
25 | public ReloadableResourceBundleMessageSource messageSource() {
26 | ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource = new ReloadableResourceBundleMessageSource();
27 |
28 | reloadableResourceBundleMessageSource.setBasenames(
29 | "classpath:/egovframework/message/com/message-common",
30 | "classpath:/org/egovframe/rte/fdl/idgnr/messages/idgnr",
31 | "classpath:/org/egovframe/rte/fdl/property/messages/properties");
32 | reloadableResourceBundleMessageSource.setCacheSeconds(60);
33 | return reloadableResourceBundleMessageSource;
34 | }
35 |
36 | /**
37 | * @return [Resource 설정] 메세지 소스 등록
38 | */
39 | @Bean
40 | public EgovMessageSource egovMessageSource() {
41 | EgovMessageSource egovMessageSource = new EgovMessageSource();
42 | egovMessageSource.setReloadableResourceBundleMessageSource(messageSource());
43 | return egovMessageSource;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/config/EgovConfigAppProperties.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.config;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import org.springframework.beans.factory.annotation.Value;
7 | import org.springframework.context.annotation.Bean;
8 | import org.springframework.context.annotation.Configuration;
9 |
10 | import org.egovframe.rte.fdl.property.impl.EgovPropertyServiceImpl;
11 |
12 | /**
13 | * @ClassName : EgovConfigAppProperties.java
14 | * @Description : Properties 설정
15 | *
16 | * @author : 윤주호
17 | * @since : 2021. 7. 20
18 | * @version : 1.0
19 | *
20 | *
21 | * << 개정이력(Modification Information) >>
22 | *
23 | * 수정일 수정자 수정내용
24 | * ------------- ------------ ---------------------
25 | * 2021. 7. 20 윤주호 최초 생성
26 | *
27 | *
28 | */
29 |
30 | @Configuration
31 | public class EgovConfigAppProperties {
32 |
33 | @Value("${Globals.fileStorePath}")
34 | private String fileStorePath;
35 |
36 | @Value("${Globals.addedOptions}")
37 | private String addedOptions;
38 |
39 | @Value("${Globals.pageUnit}")
40 | private String pageUnit;
41 | @Value("${Globals.pageSize}")
42 | private String pageSize;
43 | @Value("${Globals.posblAtchFileSize}")
44 | private String posblAtchFileSize;
45 |
46 |
47 | @Bean(destroyMethod = "destroy")
48 | public EgovPropertyServiceImpl propertiesService() {
49 | EgovPropertyServiceImpl egovPropertyServiceImpl = new EgovPropertyServiceImpl();
50 |
51 | Map properties = new HashMap();
52 | properties.put("Globals.pageUnit", pageUnit);
53 | properties.put("Globals.pageSize", pageSize);
54 | properties.put("Globals.posblAtchFileSize", posblAtchFileSize);
55 | properties.put("Globals.fileStorePath", fileStorePath);
56 | properties.put("Globals.addedOptions", addedOptions);
57 |
58 | egovPropertyServiceImpl.setProperties(properties);
59 | return egovPropertyServiceImpl;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/config/EgovConfigAppValidator.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.config;
2 |
3 | import java.io.IOException;
4 | import java.util.ArrayList;
5 | import java.util.Arrays;
6 | import java.util.List;
7 |
8 | import org.springframework.context.annotation.Bean;
9 | import org.springframework.context.annotation.Configuration;
10 | import org.springframework.core.io.Resource;
11 | import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
12 | import org.springmodules.validation.commons.DefaultBeanValidator;
13 | import org.springmodules.validation.commons.DefaultValidatorFactory;
14 |
15 | /**
16 | * @ClassName : EgovConfigAppValidator.java
17 | * @Description : Validator 설정
18 | *
19 | * @author : 윤주호
20 | * @since : 2021. 7. 20
21 | * @version : 1.0
22 | *
23 | *
24 | * << 개정이력(Modification Information) >>
25 | *
26 | * 수정일 수정자 수정내용
27 | * ------------- ------------ ---------------------
28 | * 2021. 7. 20 윤주호 최초 생성
29 | *
30 | *
31 | */
32 | @Configuration
33 | public class EgovConfigAppValidator {
34 |
35 | @Bean
36 | public DefaultBeanValidator beanValidator() {
37 | DefaultBeanValidator defaultBeanValidator = new DefaultBeanValidator();
38 | defaultBeanValidator.setValidatorFactory(validatorFactory());
39 | return defaultBeanValidator;
40 |
41 | }
42 |
43 | /** validation config location 설정
44 | * @return
45 | */
46 | @Bean
47 | public DefaultValidatorFactory validatorFactory() {
48 | DefaultValidatorFactory defaultValidatorFactory = new DefaultValidatorFactory();
49 |
50 | defaultValidatorFactory.setValidationConfigLocations(getValidationConfigLocations());
51 |
52 | return defaultValidatorFactory;
53 | }
54 |
55 | private Resource[] getValidationConfigLocations() {
56 |
57 | PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver = new PathMatchingResourcePatternResolver();
58 |
59 | List validationConfigLocations = new ArrayList();
60 |
61 | Resource[] validationRulesConfigLocations = new Resource[] {
62 | pathMatchingResourcePatternResolver
63 | .getResource("classpath:/egovframework/validator/validator-rules-let.xml")
64 | };
65 |
66 | Resource[] validationFormSetLocations = new Resource[] {};
67 | try {
68 | validationFormSetLocations = pathMatchingResourcePatternResolver
69 | .getResources("classpath:/egovframework/validator/let/**/*.xml");
70 | } catch (IOException e) {
71 | // TODO Exception 처리 필요
72 | }
73 |
74 | validationConfigLocations.addAll(Arrays.asList(validationRulesConfigLocations));
75 | validationConfigLocations.addAll(Arrays.asList(validationFormSetLocations));
76 |
77 | return validationConfigLocations.toArray(new Resource[validationConfigLocations.size()]);
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/config/EgovConfigAppWhitelist.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.config;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 |
9 | /**
10 | * @ClassName : EgovConfigAppWhitelist.java
11 | * @Description : whiteList 설정
12 | *
13 | * @author : 윤주호
14 | * @since : 2021. 7. 20
15 | * @version : 1.0
16 | *
17 | *
18 | * << 개정이력(Modification Information) >>
19 | *
20 | * 수정일 수정자 수정내용
21 | * ------------- ------------ ---------------------
22 | * 2021. 7. 20 윤주호 최초 생성
23 | *
24 | *
25 | */
26 | @Configuration
27 | public class EgovConfigAppWhitelist {
28 |
29 | @Bean
30 | public List egovPageLinkWhitelist() {
31 | List whiteList = new ArrayList();
32 | whiteList.add("main/inc/EgovIncHeader");
33 | whiteList.add("main/inc/EgovIncTopnav");
34 | whiteList.add("main/inc/EgovIncLeftmenu");
35 | whiteList.add("main/inc/EgovIncFooter");
36 | whiteList.add("main/sample_menu/Intro");
37 | whiteList.add("main/sample_menu/EgovDownloadDetail");
38 | whiteList.add("main/sample_menu/EgovDownloadModify");
39 | whiteList.add("main/sample_menu/EgovQADetail");
40 | whiteList.add("main/sample_menu/EgovAboutSite");
41 | whiteList.add("main/sample_menu/EgovHistory");
42 | whiteList.add("main/sample_menu/EgovOrganization");
43 | whiteList.add("main/sample_menu/EgovLocation");
44 | whiteList.add("main/sample_menu/EgovProductInfo");
45 | whiteList.add("main/sample_menu/EgovServiceInfo");
46 | whiteList.add("main/sample_menu/EgovDownload");
47 | whiteList.add("main/sample_menu/EgovQA");
48 | whiteList.add("main/sample_menu/EgovService");
49 | return whiteList;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/config/EgovConfigWebDispatcherServlet.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.config;
2 |
3 | import org.springframework.context.annotation.ComponentScan;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.context.annotation.FilterType;
6 | import org.springframework.stereotype.Repository;
7 | import org.springframework.stereotype.Service;
8 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
9 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
10 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
11 |
12 | import egovframework.com.cmm.interceptor.AuthenticInterceptor;
13 | import egovframework.com.cmm.interceptor.CustomAuthenticInterceptor;
14 |
15 | /**
16 | * @ClassName : EgovConfigWebDispatcherServlet.java
17 | * @Description : DispatcherServlet 설정
18 | *
19 | * @author : 윤주호
20 | * @since : 2021. 7. 20
21 | * @version : 1.0
22 | *
23 | *
24 | * << 개정이력(Modification Information) >>
25 | *
26 | * 수정일 수정자 수정내용
27 | * ------------- ------------ ---------------------
28 | * 2021. 7. 20 윤주호 최초 생성
29 | *
30 | *
31 | */
32 | @Configuration
33 | @ComponentScan(basePackages = "egovframework", excludeFilters = {
34 | @ComponentScan.Filter(type = FilterType.ANNOTATION, value = Service.class),
35 | @ComponentScan.Filter(type = FilterType.ANNOTATION, value = Repository.class),
36 | @ComponentScan.Filter(type = FilterType.ANNOTATION, value = Configuration.class)
37 | })
38 | public class EgovConfigWebDispatcherServlet implements WebMvcConfigurer {
39 |
40 | // =====================================================================
41 | // RequestMappingHandlerMapping 설정
42 | // =====================================================================
43 | // -------------------------------------------------------------
44 | // RequestMappingHandlerMapping 설정 - Interceptor 추가
45 | // -------------------------------------------------------------
46 | @Override
47 | public void addInterceptors(InterceptorRegistry registry) {
48 | registry.addInterceptor(new AuthenticInterceptor())
49 | .addPathPatterns(
50 | "/auth/*")
51 | .excludePathPatterns(
52 | "/auth/login",
53 | "/auth/login-jwt",
54 | "/auth/logout"
55 | );
56 | registry.addInterceptor(new CustomAuthenticInterceptor())
57 | .addPathPatterns(
58 | "/**/*.do")
59 | .excludePathPatterns(
60 | "/auth/**");
61 | }
62 |
63 | // -------------------------------------------------------------
64 | // RequestMappingHandlerMapping 설정 View Controller 추가
65 | // -------------------------------------------------------------
66 | @Override
67 | public void addViewControllers(ViewControllerRegistry registry) {
68 | registry.addViewController("/cmmn/validator.do")
69 | .setViewName("cmmn/validator");
70 | registry.addViewController("/").setViewName("forward:/index.html");
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/config/EgovWebServletContextListener.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.config;
2 |
3 | import javax.servlet.ServletContextEvent;
4 | import javax.servlet.ServletContextListener;
5 |
6 | import egovframework.com.cmm.service.EgovProperties;
7 | import lombok.extern.slf4j.Slf4j;
8 |
9 | @Slf4j
10 | public class EgovWebServletContextListener implements ServletContextListener {
11 |
12 | public EgovWebServletContextListener() {
13 | setEgovProfileSetting();
14 | }
15 |
16 | @Override
17 | public void contextInitialized(ServletContextEvent event) {
18 | if (System.getProperty("spring.profiles.active") == null) {
19 | setEgovProfileSetting();
20 | }
21 | }
22 |
23 | @Override
24 | public void contextDestroyed(ServletContextEvent event) {
25 | if (System.getProperty("spring.profiles.active") != null) {
26 | System.clearProperty("spring.profiles.active");
27 | }
28 | }
29 |
30 | public void setEgovProfileSetting() {
31 | try {
32 | log.debug("===========================Start EgovServletContextLoad START ===========");
33 | System.setProperty("spring.profiles.active",
34 | EgovProperties.getProperty("Globals.DbType") + "," + EgovProperties.getProperty("Globals.Auth"));
35 | log.debug("Setting spring.profiles.active>" + System.getProperty("spring.profiles.active"));
36 | log.debug("===========================END EgovServletContextLoad END ===========");
37 | } catch (IllegalArgumentException e) {
38 | log.error("[IllegalArgumentException] Try/Catch...usingParameters Runing : " + e.getMessage());
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/config/HtmlCharacterEscapes.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.config;
2 |
3 | import org.apache.commons.text.StringEscapeUtils;
4 |
5 | import com.fasterxml.jackson.core.SerializableString;
6 | import com.fasterxml.jackson.core.io.CharacterEscapes;
7 | import com.fasterxml.jackson.core.io.SerializedString;
8 |
9 | public class HtmlCharacterEscapes extends CharacterEscapes {
10 |
11 | private static final long serialVersionUID = -6353236148390563705L;
12 |
13 | private final int[] asciiEscapes;
14 |
15 | public HtmlCharacterEscapes() {
16 | this.asciiEscapes = CharacterEscapes.standardAsciiEscapesForJSON();
17 | this.asciiEscapes['<'] = CharacterEscapes.ESCAPE_CUSTOM;
18 | this.asciiEscapes['>'] = CharacterEscapes.ESCAPE_CUSTOM;
19 | this.asciiEscapes['\"'] = CharacterEscapes.ESCAPE_CUSTOM;
20 | this.asciiEscapes['('] = CharacterEscapes.ESCAPE_CUSTOM;
21 | this.asciiEscapes[')'] = CharacterEscapes.ESCAPE_CUSTOM;
22 | this.asciiEscapes['#'] = CharacterEscapes.ESCAPE_CUSTOM;
23 | this.asciiEscapes['\''] = CharacterEscapes.ESCAPE_CUSTOM;
24 | }
25 |
26 | @Override
27 | public int[] getEscapeCodesForAscii() {
28 | return asciiEscapes;
29 | }
30 |
31 | @Override
32 | public SerializableString getEscapeSequence(int ch) {
33 | return new SerializedString(StringEscapeUtils.escapeHtml4(Character.toString((char) ch)));
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/egovframework/com/config/OpenApiConfig.java:
--------------------------------------------------------------------------------
1 | package egovframework.com.config;
2 |
3 | import java.util.Map;
4 |
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | import io.swagger.v3.oas.models.Components;
9 | import io.swagger.v3.oas.models.ExternalDocumentation;
10 | import io.swagger.v3.oas.models.OpenAPI;
11 | import io.swagger.v3.oas.models.info.Contact;
12 | import io.swagger.v3.oas.models.info.Info;
13 | import io.swagger.v3.oas.models.info.License;
14 | import io.swagger.v3.oas.models.media.Schema;
15 | import io.swagger.v3.oas.models.media.StringSchema;
16 | import io.swagger.v3.oas.models.security.SecurityScheme;
17 |
18 | @Configuration
19 | public class OpenApiConfig {
20 |
21 | private static final String API_NAME = "Simple Homepage Project API";
22 | private static final String API_VERSION = "4.3.0";
23 | private static final String API_DESCRIPTION = "심플홈페이지 프로젝트 명세서";
24 |
25 | @Bean
26 | public OpenAPI api() {
27 |
28 | Schema> fileMap = new Schema