From f9f03e3716ac02623f279dcada77f51a9bc3fa7b Mon Sep 17 00:00:00 2001 From: leebj Date: Tue, 18 Feb 2025 13:30:21 +0900 Subject: [PATCH] no message --- pom.xml | 78 +++++++++++++++++ .../java/cokr/xit/main/MainApplication.java | 24 ++++++ .../java/cokr/xit/main/MmsDatabaseConfig.java | 15 ++++ .../cokr/xit/main/web/MainController.java | 40 +++++++++ src/main/resources/application.yml | 43 ++++++++++ src/main/resources/log4jdbc.log4j2.properties | 4 + src/main/resources/logback-spring.xml | 84 +++++++++++++++++++ src/main/resources/sql/mybatis-config.xml | 21 +++++ 8 files changed, 309 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/java/cokr/xit/main/MainApplication.java create mode 100644 src/main/java/cokr/xit/main/MmsDatabaseConfig.java create mode 100644 src/main/java/cokr/xit/main/web/MainController.java create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/log4jdbc.log4j2.properties create mode 100644 src/main/resources/logback-spring.xml create mode 100644 src/main/resources/sql/mybatis-config.xml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..183fa45 --- /dev/null +++ b/pom.xml @@ -0,0 +1,78 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.7.18 + + + + cokr.xit.interfaces + xit-mms-war + 1.0.0-SNAPSHOT + xit-mms-war + 모바일 메시지 발송 요청 처리 웹서버 + war + + + UTF-8 + 17 + + + + + maven-public + https://nas.xit.co.kr:8888/repository/maven-public/ + + + + + + maven-public + https://nas.xit.co.kr:8888/repository/maven-public/ + + true + + + false + + + + + + + + cokr.xit.interfaces + xit-mms + 1.0.0-SNAPSHOT + + + + cokr.xit.boot + xit-foundation-starter + 23.04.01-SNAPSHOT + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + \ No newline at end of file diff --git a/src/main/java/cokr/xit/main/MainApplication.java b/src/main/java/cokr/xit/main/MainApplication.java new file mode 100644 index 0000000..a184705 --- /dev/null +++ b/src/main/java/cokr/xit/main/MainApplication.java @@ -0,0 +1,24 @@ +package cokr.xit.main; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.FilterType; + +import cokr.xit.foundation.boot.DatasourceConfig; +import cokr.xit.foundation.boot.FoundationApplication; + + +@ImportAutoConfiguration({ + MmsDatabaseConfig.class +}) +@ComponentScan( +excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,classes = {DatasourceConfig.class}) +) +public class MainApplication extends FoundationApplication { + public static void main(String[] args) { + + SpringApplication.run(MainApplication.class, args); + + } +} diff --git a/src/main/java/cokr/xit/main/MmsDatabaseConfig.java b/src/main/java/cokr/xit/main/MmsDatabaseConfig.java new file mode 100644 index 0000000..4fbd742 --- /dev/null +++ b/src/main/java/cokr/xit/main/MmsDatabaseConfig.java @@ -0,0 +1,15 @@ +package cokr.xit.main; + +import cokr.xit.foundation.boot.DatasourceConfig; + +public class MmsDatabaseConfig extends DatasourceConfig { + + @Override + protected String[] mapperLocationPatterns() { + return new String[] { + "classpath*:sql/mapper-jar-applib/base/utility.xml", + "classpath*:sql/mapper/interfaces/message-mapper.xml" + }; + } + +} diff --git a/src/main/java/cokr/xit/main/web/MainController.java b/src/main/java/cokr/xit/main/web/MainController.java new file mode 100644 index 0000000..cf33baf --- /dev/null +++ b/src/main/java/cokr/xit/main/web/MainController.java @@ -0,0 +1,40 @@ +package cokr.xit.main.web; + +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +import cokr.xit.interfaces.message.MessageQuery; +import cokr.xit.interfaces.message.web.MessageController; + +@Controller +@RequestMapping(name="문자전송 관리", value="/messageapi") +public class MainController extends MessageController { + + @Override + @RequestMapping(name="문자전송 목록", value="/list.do") + public ModelAndView list(MessageQuery messageQuery) { + + if(isEmpty(messageQuery.getSchInputYmdTo())) { + if(isEmpty(messageQuery.getSchInputYmdFrom())) { + + SimpleDateFormat yyyyMMddFormat = new SimpleDateFormat("yyyyMMdd"); + Date curDate = new Date(); + String strCurrentDate = yyyyMMddFormat.format(curDate); + + messageQuery.setSchInputYmdFrom(strCurrentDate); + messageQuery.setSchInputYmdTo(strCurrentDate); + } else { + messageQuery.setSchInputYmdTo(messageQuery.getSchInputYmdFrom()); + } + } else if(isEmpty(messageQuery.getSchInputYmdFrom())) { + messageQuery.setSchInputYmdFrom(messageQuery.getSchInputYmdTo()); + } + + return super.list(messageQuery); + } + +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..18411c6 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,43 @@ +server: + shutdown: graceful + port: 9073 + servlet: + context-path: / + +spring: + application: + name: xitmmswar + main: + allow-bean-definition-overriding: true + sql: + init: + platform: mariadb + datasource: + hikari: + driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy + jdbc-url: jdbc:log4jdbc:mariadb://211.119.124.9:4407/efccsscs?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Seoul&useSSL=false&autocommit=false + username: rentcar + password: xit1! + auto-commit: false + maximumPoolSize: 3 + mvc: + static-path-pattern: /resources/**,/webjars/**,/files/** + web: + resources: + static-locations: /resources/,classpath*:/META-INF/resources/webjars/,file:files/ + +messageSource: + basenames: + - classpath:message/message-common + - classpath:message/authentication-message + - classpath:org/egovframe/rte/fdl/property/messages/properties + +propertyService: + properties: + - tempDir: C:\temp + - pageUnit: 10 + - pageSize: 10 + - permitAccess: /intf/**/* + extFileName: + - encoding: UTF-8 + filename: classpath*:intf-conf/xit-lvis.properties diff --git a/src/main/resources/log4jdbc.log4j2.properties b/src/main/resources/log4jdbc.log4j2.properties new file mode 100644 index 0000000..3b8ff2b --- /dev/null +++ b/src/main/resources/log4jdbc.log4j2.properties @@ -0,0 +1,4 @@ +log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator + +log4jdbc.dump.sql.maxlinelength=0 +log4jdbc.drivers=org.mariadb.jdbc.Driver diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..fd7a1c5 --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + ${LOG_PATTERN} + + + + + ${LOG_PATH}/${LOG_FILE_NAME}.log + + ${LOG_PATTERN} + + + + + ${LOG_PATH}/${LOG_FILE_NAME}.%d{yyyy-MM-dd}_%i.log + + 10MB + + + 30 + + + + + + + error + ACCEPT + DENY + + + ${LOG_PATH}/${ERR_LOG_FILE_NAME}.log + + ${LOG_PATTERN} + + + + + ${LOG_PATH}/${ERR_LOG_FILE_NAME}.%d{yyyy-MM-dd}_%i.log + + + 10MB + + + 60 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/sql/mybatis-config.xml b/src/main/resources/sql/mybatis-config.xml new file mode 100644 index 0000000..faa9415 --- /dev/null +++ b/src/main/resources/sql/mybatis-config.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file