diff --git a/src/main/java/com/xit/biz/ctgy/v2/controller/CmmFileController.java b/src/main/java/com/xit/biz/ctgy/v2/controller/CmmFileController.java index 53e2017..cc93c04 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/controller/CmmFileController.java +++ b/src/main/java/com/xit/biz/ctgy/v2/controller/CmmFileController.java @@ -82,13 +82,19 @@ public class CmmFileController { e.printStackTrace(); } - String absFile = ""; +// String absFile = ""; +// +// if (Arrays.asList(env.getActiveProfiles()).contains("prod")) +// absFile = String.format("%s%s%s", "entity.getInFileurl()", File.separator, fileName); +// else +// absFile = String.format( +// "%s%s%s%s", +// rootPath, +// (CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(scDatagb)? judgeUploadPath[0] : judgeUploadPath[1]), +// File.separator, fileName); + - // TODO : 운영환경에 맞게 적용 필요 - if (Arrays.asList(env.getActiveProfiles()).contains("prod")) - absFile = String.format("%s%s%s", "entity.getInFileurl()", File.separator, fileName); - else - absFile = String.format( + String absFile = String.format( "%s%s%s%s", rootPath, (CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(scDatagb)? judgeUploadPath[0] : judgeUploadPath[1]), diff --git a/src/main/java/com/xit/core/config/aop/LoggerAspect.java b/src/main/java/com/xit/core/config/aop/LoggerAspect.java index b709843..5cf1abd 100644 --- a/src/main/java/com/xit/core/config/aop/LoggerAspect.java +++ b/src/main/java/com/xit/core/config/aop/LoggerAspect.java @@ -31,7 +31,7 @@ import java.util.Objects; @Slf4j public class LoggerAspect { // respons 출력 여부 - @Value("${api.reponse.logging}") + @Value("${api.response.logging}") private boolean isResLogging; @Pointcut("execution(* com.xit..*Controller.*(..))") // 이런 패턴이 실행될 경우 수행 diff --git a/src/main/java/com/xit/core/config/database/BaseMpowerDaoSupport.java b/src/main/java/com/xit/core/config/database/BaseMpowerDaoSupport.java index a8824fc..c20ecf9 100644 --- a/src/main/java/com/xit/core/config/database/BaseMpowerDaoSupport.java +++ b/src/main/java/com/xit/core/config/database/BaseMpowerDaoSupport.java @@ -36,15 +36,10 @@ public abstract class BaseMpowerDaoSupport { @Value("${mpower.file.serviceName}") private String fileServiceName; - // 단속사진 - @Value("${mpower.file.picadPath}") - private String picadPath; - // 진술서 - @Value("${mpower.file.frecadPath}") - private String frecadPath; - // 첨부자료 - @Value("${mpower.file.contadPath}") - private String contadPath; + // 주정차이미지경로 + @Value("${mpower.file.parkingImagePath}") + private String parkingImagePath; + @Value("${mpower.file.savedImgPath}") private String savedImgPath; @@ -478,7 +473,7 @@ public abstract class BaseMpowerDaoSupport { Client client = new Client(fileHostIp, fileHostPort); String filePath = getAbsImgPath(photocode); - String svrImgPath = picadPath + filePath; //터널링에 저장된 단속사진 경로 + String svrImgPath = parkingImagePath + filePath; //터널링에 저장된 단속사진 경로 String svrSavedPhotoPath = savedImgPath + "/" + filePath; log.info("Mpower 이미지경로:::::" + svrImgPath); log.info("서버 download file path :::::" + svrSavedPhotoPath); diff --git a/src/main/java/com/xit/core/util/YamlPropertySourceFactory.java b/src/main/java/com/xit/core/util/YamlPropertySourceFactory.java index 82b50ae..174c4f8 100644 --- a/src/main/java/com/xit/core/util/YamlPropertySourceFactory.java +++ b/src/main/java/com/xit/core/util/YamlPropertySourceFactory.java @@ -12,6 +12,9 @@ import java.io.IOException; import java.util.Objects; import java.util.Properties; +/** + * .yaml 파일은 @PeopertySource annotaion 으로 값 호출 불가(.property 사용해야) + */ public class YamlPropertySourceFactory implements PropertySourceFactory { @Override public PropertySource createPropertySource(@Nullable String name, EncodedResource resource) throws IOException { diff --git a/src/main/resources/config/application-dev.yml b/src/main/resources/config/application-dev.yml index 1ccd907..d068b20 100644 --- a/src/main/resources/config/application-dev.yml +++ b/src/main/resources/config/application-dev.yml @@ -13,8 +13,6 @@ spring: init: mode: always platform: oracle - #schema-locations: classpath:/data/h2/schema.sql - #data-locations: classpath:/data/h2/data.sql # ================================================================================================================== # logging lib setting @@ -37,3 +35,47 @@ logging: springdoc: api-docs: enabled: true + + +# ================================================================================================================== +# project config +# ================================================================================================================== +cors: + allowed-origins: https://fonts.gstatic.com,http://localhost,http://211.119.124.107 + +# api response logging 여부 +api: + response: + logging: false + +file: + cmm: + upload: + root: d:/data/file/upload + # root: /Users/minuk/data/file/upload + # 공지사항 + pboard: /simUpFile #/kangnamSIM/simUpFile + simsaPath: /simUpFile_sc1, /simUpFile_sc2 # 거주자 simUpFile_sc1, 장애인 simUpFile_sc2 + url: http://traffic.gangnam.go.kr + allow: + ext: + max: + size: 10000000 + +mpower: + master: + hostIp: 127.0.0.1 + port: 9999 + dbName: gn + slave: + hostIp: 127.0.0.1 + port: 9999 + dbName: gn_seconddb + file: + hostIp: 127.0.0.1 + port: 9999 + serviceName: XitFile.XitDownload + # 주정차이미지경로-mpower + parkingImagePath: C:/NewTraffic_Photo/JUCHA_PHOTO/ + # 주정차이미지 다운로드 저장 경로 + savedImgPath: D:/data/file/juchaPhoto \ No newline at end of file diff --git a/src/main/resources/config/application-local.yml b/src/main/resources/config/application-local.yml index 6b32c26..01c26ad 100644 --- a/src/main/resources/config/application-local.yml +++ b/src/main/resources/config/application-local.yml @@ -2,6 +2,9 @@ server: port: 8090 spring: + output: + ansi: + enabled: always # always / detect / never config: activate: on-profile: local @@ -35,3 +38,46 @@ logging: springdoc: api-docs: enabled: true + +# ================================================================================================================== +# project config +# ================================================================================================================== +cors: + allowed-origins: https://fonts.gstatic.com,http://localhost:3000 + +# api response logging 여부 +api: + response: + logging: true + +file: + cmm: + upload: + root: d:/data/file/upload + # root: /Users/minuk/data/file/upload + # 공지사항 + pboard: /simUpFile #/kangnamSIM/simUpFile + simsaPath: /simUpFile_sc1, /simUpFile_sc2 # 거주자 simUpFile_sc1, 장애인 simUpFile_sc2 + url: http://traffic.gangnam.go.kr + allow: + ext: + max: + size: 10000000 + +mpower: + master: + hostIp: 127.0.0.1 + port: 9999 + dbName: gn + slave: + hostIp: 127.0.0.1 + port: 9999 + dbName: gn_seconddb + file: + hostIp: 127.0.0.1 + port: 9999 + serviceName: XitFile.XitDownload + # 주정차이미지경로-mpower + parkingImagePath: C:/NewTraffic_Photo/JUCHA_PHOTO/ + # 주정차이미지 다운로드 저장 경로 + savedImgPath: D:/data/file/juchaPhoto \ No newline at end of file diff --git a/src/main/resources/config/application-oauth.yml b/src/main/resources/config/application-oauth.yml index 863d8c9..ff91c0a 100644 --- a/src/main/resources/config/application-oauth.yml +++ b/src/main/resources/config/application-oauth.yml @@ -66,14 +66,6 @@ spring: tokenUri: https://graph.facebook.com/v3.0/oauth/access_token userInfoUri: https://graph.facebook.com/v3.0/me?fields=id,first_name,middle_name,last_name,name,email,verified,is_verified,picture.width(250).height(250) -# Spring Security cors 설정 :: CorsConfiguration 설정 값 -cors: - allowed-origins: https://fonts.gstatic.com,http://localhost:3000,http://localhost,http://211.119.124.107,http://211.119.124.107:3000 - allowed-methods: GET,POST,PUT,DELETE,OPTIONS - allowed-headers: '*' - max-age: 3600 - - # HS512 알고리즘을 사용할 것이기 때문에 512bit, 즉 64byte 이상의 secret key를 사용해야 한다. # Base64.getEncoder().withoutPadding().encodeToString(orgString.getBytes()) # new String(Base64.getDecoder().decode(encodedString)) diff --git a/src/main/resources/config/application-prod.yml b/src/main/resources/config/application-prod.yml new file mode 100644 index 0000000..a4b0545 --- /dev/null +++ b/src/main/resources/config/application-prod.yml @@ -0,0 +1,77 @@ +server: + port: 8090 + +spring: + config: + activate: + on-profile: prod + + sql: + init: + mode: always + +# ================================================================================================================== +# logging lib setting +# ================================================================================================================== +logging: + level: + root: INFO + # spring.mvc.log-request-details=debug 활성화 + web: debug + org: + springframework: + transaction: + interceptor: TRACE + orm: + jpa: TRACE + +# ================================================================================================================== +# Spring-doc 활성 +# ================================================================================================================== +springdoc: + api-docs: + enabled: true + + +# ================================================================================================================== +# project config +# ================================================================================================================== +cors: + allowed-origins: https://fonts.gstatic.com,http://localhost:3000,http:211.35.57.20:3000 + +# api response logging 여부 +api: + response: + logging: false + +file: + cmm: + upload: + root: d:/data/file/upload + # root: /Users/minuk/data/file/upload + # 공지사항 + pboard: /simUpFile #/kangnamSIM/simUpFile + simsaPath: /simUpFile_sc1, /simUpFile_sc2 # 거주자 simUpFile_sc1, 장애인 simUpFile_sc2 + url: http://traffic.gangnam.go.kr + allow: + ext: + max: + size: 10000000 + +mpower: + master: + hostIp: 127.0.0.1 + port: 9999 + dbName: gn + slave: + hostIp: 127.0.0.1 + port: 9999 + dbName: gn_seconddb + file: + hostIp: 127.0.0.1 + port: 9999 + serviceName: XitFile.XitDownload + # 주정차이미지경로-mpower + parkingImagePath: C:/NewTraffic_Photo/JUCHA_PHOTO/ + # 주정차이미지 다운로드 저장 경로 + savedImgPath: D:/data/file/juchaPhoto \ No newline at end of file diff --git a/src/main/resources/config/application-test.yml b/src/main/resources/config/application-test.yml deleted file mode 100644 index b0cb906..0000000 --- a/src/main/resources/config/application-test.yml +++ /dev/null @@ -1,51 +0,0 @@ -server: - port: 18080 - -spring: - config: - activate: - on-profile: test - sql: - init: - mode: always - platform: h2 - - datasource: - driver-class-name: org.h2.Driver - url: jdbc:h2:mem:xitdb;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE - username: sa - password: '' - hikari: - driver-class-name: ${spring.datasource.driver-class-name} - jdbc-url: ${spring.datasource.url} - username: ${spring.datasource.username} - password: ${spring.datasource.password} - - jpa: - database-platform: org.hibernate.dialect.H2Dialect - show-sql: false - properties: - hibernate: - format_sql: true - use_sql_comments: false - hbm2ddl: - auto: create-drop - -decorator: - datasource: - p6spy: - enable-logging: true - -logging: - level: - root: info - org: - hibernate: - type: trace - springframework: - web: - filter: error - -springdoc: - api-docs: - enabled: false diff --git a/src/main/resources/config/application.yml b/src/main/resources/config/application.yml index 664db00..ef7ebfb 100644 --- a/src/main/resources/config/application.yml +++ b/src/main/resources/config/application.yml @@ -2,10 +2,8 @@ spring: application: name: xit-framework #description: XIT api for development - config: - import: classpath:config/conf.yml profiles: - active: dev + active: local include: oauth main: # bean name 중복 허용 - junit 사용시 true?? @@ -131,4 +129,25 @@ server: whitelabel: enabled: true tomcat: - basedir: . \ No newline at end of file + basedir: . + +# ================================================================================================================== +# project config +# ================================================================================================================== +# Spring Security cors 설정 :: CorsConfiguration 설정 값 +cors: + allowed-origins: https://fonts.gstatic.com,http://localhost:3000,http://localhost,http://211.119.124.107,http://211.119.124.107:3000 + allowed-methods: GET,POST,PUT,DELETE,OPTIONS + allowed-headers: '*' + max-age: 3600 + +xit: + api: + url: 'http://localhost:${server.port}' + version: '@project.version@' + # Authentification 저장 위치 : header / cookie / token + auth: + save: + type: header + # locale : ko / en + locale: ko \ No newline at end of file diff --git a/src/main/resources/config/conf.yml b/src/main/resources/config/conf.yml deleted file mode 100644 index 06f7889..0000000 --- a/src/main/resources/config/conf.yml +++ /dev/null @@ -1,51 +0,0 @@ -xit: - api: - url: 'http://localhost:${server.port}' - version: '@project.version@' - # Authentification 저장 위치 : header / cookie / token - auth: - save: - type: header - # locale : ko / en - locale: ko - -# api response logging 여부 -api: - reponse: - logging: false - -file: - cmm: - upload: - root: d:/data/file/upload -# root: /Users/minuk/data/file/upload - # 공지사항 - pboard: /simUpFile #/kangnamSIM/simUpFile - simsaPath: /simUpFile_sc1, /simUpFile_sc2 # 거주자 simUpFile_sc1, 장애인 simUpFile_sc2 - url: http://traffic.gangnam.go.kr - allow: - ext: - max: - size: 10000000 - -mpower: - master: - hostIp: 127.0.0.1 - port: 9999 - dbName: gn - slave: - hostIp: 127.0.0.1 - port: 9999 - dbName: gn_seconddb - file: - hostIp: 127.0.0.1 - port: 9999 - serviceName: XitFile.XitDownload - # 단속사진 - picadPath: C:/NewTraffic_Photo/JUCHA_PHOTO/ - # 진술서 - frecadPath: /picad - # 첨부자료 - contadPath: /picad - # 저장경로 - savedImgPath: d:/data/file/juchaPhoto diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 57c1949..93d75e3 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -7,9 +7,11 @@ - + + + + - diff --git a/src/main/resources/sql/parking-mapper.xml b/src/main/resources/sql/parking-mapper.xml index 08730e6..18d7839 100644 --- a/src/main/resources/sql/parking-mapper.xml +++ b/src/main/resources/sql/parking-mapper.xml @@ -376,6 +376,7 @@ , tf680_recall TR WHERE MS.ms_maincode = MSU.msu_maincode AND DECODE(MS.ms_result, '1', '1', '2', '2', '0') = '0' + AND MS.ms_cdate >= SYSDATE AND MS.ms_maincode = TR.rc_code AND MSU.msu_userid = #{msuUserid} ORDER BY MS.ms_sdate, MS.ms_edate, MS.ms_seq diff --git a/src/main/resources/sql/residentAndDisabled-mapper.xml b/src/main/resources/sql/residentAndDisabled-mapper.xml index 24a31ad..dc75ba8 100644 --- a/src/main/resources/sql/residentAndDisabled-mapper.xml +++ b/src/main/resources/sql/residentAndDisabled-mapper.xml @@ -618,6 +618,7 @@ , gn_recall_sc GR WHERE MS.ms_maincode = MSU.msu_maincode AND DECODE(MS.ms_result, '1', '1', '2', '2', '0') = '0' + AND MS.ms_cdate >= SYSDATE AND MSU.msu_userid = #{msuUserid} AND MS.ms_maincode = GR.sc_code diff --git a/src/test/java/com/xit/ApplicationTest.java b/src/test/java/com/xit/ApplicationTest.java index 5a50887..3918c1a 100644 --- a/src/test/java/com/xit/ApplicationTest.java +++ b/src/test/java/com/xit/ApplicationTest.java @@ -14,7 +14,7 @@ import org.springframework.test.context.junit4.SpringRunner; //@DataJpaTest @ContextConfiguration(classes = Application.class) @ExtendWith(SpringExtension.class) -@ActiveProfiles({"dev"}) +//@ActiveProfiles({"dev"}) public class ApplicationTest { @Test