feat: db분리

dev
gitea-관리자 1 year ago
parent 8bc53deddd
commit 8b3821f6a3

@ -41,7 +41,7 @@ import javax.sql.DataSource;
public class DatasourceConfig {
@Bean(name = "primaryHikariConfig")
@Primary
@ConfigurationProperties(prefix = "spring.datasource.hikari.maria")
@ConfigurationProperties(prefix = "spring.datasource.hikari.primary")
public HikariConfig primaryHikariConfig() {
// HikariConfig hikariConfig = new HikariConfig("spring.datasource.hikari");
// hikariConfig.setAutoCommit(false);

@ -5,7 +5,7 @@ spring:
datasource:
hikari:
# 9 server
maria:
primary:
driver-class-name: org.mariadb.jdbc.Driver
jdbc-url: jdbc:mariadb://211.119.124.9:4407/mens?useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&autoReconnect=true
username: root

@ -1,6 +1,7 @@
package kr.xit.biz.ens.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import io.swagger.v3.oas.annotations.media.Schema;
@ -841,7 +842,8 @@ public class EnsDTO {
*
*/
@JsonDeserialize(using = LocalDateDeserializer.class)
@JsonFormat(pattern = "yyyy-MM-dd kk:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd kk:mm:ss.SSS")
@JsonIgnore
private LocalDateTime registDt;
/**
*

@ -20,5 +20,5 @@ import java.util.List;
* </pre>
*/
public interface ISmsMessageService {
<T> void sendSmsList(List<T> list);
void sendSmsList(final List<EnsDTO.SmsSndng> list);
}

@ -1,14 +1,13 @@
package kr.xit.biz.sms.service;
import java.util.List;
import kr.xit.biz.ens.model.EnsDTO;
import kr.xit.biz.sms.mapper.ISmsMessageMapper;
import lombok.RequiredArgsConstructor;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <pre>
* description : xit SMS - Oracle 11
@ -35,8 +34,8 @@ public class SmsMessageService extends EgovAbstractServiceImpl implements ISmsMe
* @param list List SMS
*/
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public <T> void sendSmsList(List<T> list) {
for(T t : list) mapper.insertScTran(t);
@Transactional//(propagation = Propagation.REQUIRES_NEW)
public void sendSmsList(List<EnsDTO.SmsSndng> list) {
for(EnsDTO.SmsSndng dto : list) mapper.insertScTran(dto);
}
}

@ -0,0 +1,55 @@
package kr.xit.biz.sms.web;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import kr.xit.biz.ens.model.EnsDTO.SmsSndng;
import kr.xit.biz.ens.model.EnsDTO.SndngMssageParam;
import kr.xit.biz.ens.service.EnsBatchRequireNewService;
import kr.xit.biz.sms.service.ISmsMessageService;
import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.model.IApiResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <pre>
* description :
*
* packageName : kr.xit.biz.sms.web
* fileName : SmsMessageController
* author : limju
* date : 2023-10-30
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-10-30 limju
*
* </pre>
*/
@Tag(name = " SmsMessageController", description = "SMS(xit) 연계 서비스")
@RequiredArgsConstructor
@RestController
@RequestMapping("/batch/ens/v1")
public class SmsMessageController {
private final ISmsMessageService service;
private final EnsBatchRequireNewService requireNewService;
@Operation(summary = "SMS 메세지 연계", description = "SMS 메세지 연계")
@PostMapping(value = "/sendMessages", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse sendMessages(@RequestBody final List<SmsSndng> lists) {
service.sendSmsList(lists);
return ApiResponseDTO.success();
}
@Operation(summary = "SMS 메세지 연계", description = "SMS 메세지 연계")
@PostMapping(value = "/sendMessages2", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse sendMessages2(@RequestBody final SndngMssageParam reqDTO) {
requireNewService.sendSms(reqDTO);
return ApiResponseDTO.success();
}
}

@ -0,0 +1,36 @@
//package kr.xit.core.spring.auto;
//
//import kr.xit.core.spring.config.db.PrimaryDatasourceConfig;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
//import org.springframework.context.annotation.Bean;
//
///**
// * <pre>
// * description :
// *
// * packageName : kr.xit.core.spring.config.auto
// * fileName : SecondaryDatabaseAutoConfiguration
// * author : limju
// * date : 2023-10-30
// * ======================================================================
// * 변경일 변경자 변경 내용
// * ----------------------------------------------------------------------
// * 2023-10-30 limju 최초 생성
// *
// * </pre>
// */
////@Configuration
////@ConditionalOnClass(PrimaryDatasourceConfig.class)
//@ConditionalOnProperty("spring.datasource.hikari.primary")
//public class PrimaryDatabaseAutoConfiguration {
// @Bean
// public PrimaryDatasourceConfig primaryDatasourceConfig() {
// return new PrimaryDatasourceConfig();
// }
//
// //@ConditionalOnMissingBean(SecondaryMybatisConfig.class)
//// @Bean
//// public TransactionConfig transactionConfig() {
//// return new TransactionConfig();
//// }
//}

@ -0,0 +1,38 @@
//package kr.xit.core.spring.auto;
//
//import kr.xit.core.spring.config.db.SecondaryMybatisConfig;
//import kr.xit.core.spring.config.db.TransactionConfig;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
//import org.springframework.context.annotation.Bean;
//
///**
// * <pre>
// * description :
// *
// * packageName : kr.xit.core.spring.config.auto
// * fileName : SecondaryDatabaseAutoConfiguration
// * author : limju
// * date : 2023-10-30
// * ======================================================================
// * 변경일 변경자 변경 내용
// * ----------------------------------------------------------------------
// * 2023-10-30 limju 최초 생성
// *
// * </pre>
// */
////@Configuration
//@ConditionalOnClass(SecondaryMybatisConfig.class)
//@ConditionalOnProperty("spring.datasource.hikari.secondary")
//public class SecondaryDatabaseAutoConfiguration {
// @Bean
// public SecondaryMybatisConfig secondaryMybatisConfig() {
// return new SecondaryMybatisConfig();
// }
//
// //@ConditionalOnMissingBean(SecondaryMybatisConfig.class)
// @Bean
// public TransactionConfig transactionConfig() {
// return new TransactionConfig();
// }
//}

@ -0,0 +1,32 @@
package kr.xit.core.spring.config.db;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
/**
* <pre>
* description :
*
* packageName : kr.xit.core.spring.config.db
* fileName : DataSourceProperties
* author : limju
* date : 2023-10-30
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-10-30 limju
*
* </pre>
*/
@Setter
@Getter
@AllArgsConstructor
public class DataSourceProperties {
private String driverClassName;
private String jdbcUrl;
private String username;
private String password;
private String readonly;
}

@ -0,0 +1,69 @@
//package kr.xit.core.spring.config.db;
//
//import com.zaxxer.hikari.HikariConfig;
//import com.zaxxer.hikari.HikariDataSource;
//import javax.sql.DataSource;
//import kr.xit.core.consts.Constants;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Primary;
//
////FIXME :: 재설정이 필요한 경우 해당 프로젝트에 동일한 파일로 재정의 하여 사용
///**
// * <pre>
// * description : Datasource 설정 - FIXME:: spring.datasource 설정이 있는 경우만 loading
// * - 조건 : spring.datasource
// * 실제 필요한 경우만 커넥션을 점유하도록
// * LazyConnectionDataSourceProxy 사용
// * 일반 Datasource 사용시
// * - Spring은 트랜잭션에 진입시 데이타 소스의 커넥션을 get
// * - ehcache, hibernate 영속성 컨택슽트 1차캐시 등에도 커넥션을 get
// * - multi-datasource 에서 트랜잭션 진입 이후 datasource 분기 불가
// * packageName : kr.xit.core.spring.config.support
// * fileName : DatasourceConfig
// * author : julim
// * date : 2023-04-28
// * ======================================================================
// * 변경일 변경자 변경 내용
// * ----------------------------------------------------------------------
// * 2023-04-28 julim 최초 생성
// *
// * </pre>
// * @see PrimaryMybatisConfig
// */
////@ConditionalOnProperty(value = "spring", havingValue = "datasource", matchIfMissing = false)
////@Configuration
//public class DatasourceConfig {
// @Bean(name = "primaryHikariConfig")
// @Primary
// @ConfigurationProperties(prefix = "spring.datasource.hikari.primary")
// public HikariConfig primaryHikariConfig() {
// // HikariConfig hikariConfig = new HikariConfig("spring.datasource.hikari");
// // hikariConfig.setAutoCommit(false);
// // return hikariConfig;
// return new HikariConfig();
// }
//
// @Bean(Constants.PRIMARY_DATA_SOURCE)
// @Primary
// public DataSource primaryDataSource() throws Exception{
// //return new LazyConnectionDataSourceProxy(new HikariDataSource(primaryHikariConfig()));
// return new HikariDataSource(primaryHikariConfig());
// }
//
// //@ConditionalOnProperty(value = "spring.datasource.hikari", havingValue = "oracle", matchIfMissing = false)
// @Bean(name = "secondaryHikariConfig")
// @ConfigurationProperties(prefix = "spring.datasource.hikari.secondary")
// public HikariConfig secondaryHikariConfig() {
// // HikariConfig hikariConfig = new HikariConfig("spring.datasource.hikari");
// // hikariConfig.setAutoCommit(false);
// // return hikariConfig;
// return new HikariConfig();
// }
//
// @Bean(name = Constants.SECONDARY_DATA_SOURCE)
// public DataSource secondaryDataSource() throws Exception{
// //return new LazyConnectionDataSourceProxy(new HikariDataSource(secondaryHikariConfig()));
// return new HikariDataSource(secondaryHikariConfig());
// }
//}

@ -0,0 +1,30 @@
//package kr.xit.core.spring.config.db;
//
//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//
///**
// * <pre>
// * description :
// *
// * packageName : kr.xit.core.spring.config.db
// * fileName : DataSourceProperties
// * author : limju
// * date : 2023-10-30
// * ======================================================================
// * 변경일 변경자 변경 내용
// * ----------------------------------------------------------------------
// * 2023-10-30 limju 최초 생성
// *
// * </pre>
// */
//@ConfigurationProperties(prefix = "spring.datasource.hikari.primary")
////@EnableAutoConfiguration(exclude = SecondaryDataSourceProperties.class)
//public class PrimaryDataSourceProperties extends DataSourceProperties{
// private String driverClassName;
// private String jdbcUrl;
// private String username;
// private String password;
// private String readonly;
//
//}

@ -1,15 +1,17 @@
package kr.xit.core.spring.config.support;
package kr.xit.core.spring.config.db;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import kr.xit.core.consts.Constants;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
//FIXME :: 재설정이 필요한 경우 해당 프로젝트에 동일한 파일로 재정의 하여 사용
/**
* <pre>
* description : Datasource - FIXME:: spring.datasource loading
@ -32,12 +34,13 @@ import org.springframework.context.annotation.Primary;
* </pre>
* @see PrimaryMybatisConfig
*/
//@ConditionalOnProperty(value = "spring", havingValue = "datasource", matchIfMissing = false)
@Configuration
public class DatasourceConfig {
@ConditionalOnProperty(value = "spring.datasource.hikari.primary.username")
//@ConditionalOnProperty(value = "spring.datasource.hikari.primary")
public class PrimaryDatasourceConfig {
@Bean(name = "primaryHikariConfig")
@Primary
@ConfigurationProperties(prefix = "spring.datasource.hikari.maria")
@ConfigurationProperties(prefix = "spring.datasource.hikari.primary")
public HikariConfig primaryHikariConfig() {
// HikariConfig hikariConfig = new HikariConfig("spring.datasource.hikari");
// hikariConfig.setAutoCommit(false);
@ -48,23 +51,10 @@ public class DatasourceConfig {
@Bean(Constants.PRIMARY_DATA_SOURCE)
@Primary
public DataSource primaryDataSource() throws Exception{
//return new LazyConnectionDataSourceProxy(new HikariDataSource(primaryHikariConfig()));
return new HikariDataSource(primaryHikariConfig());
}
//@ConditionalOnProperty(value = "spring.datasource.hikari", havingValue = "oracle", matchIfMissing = false)
@Bean(name = "secondaryHikariConfig")
@ConfigurationProperties(prefix = "spring.datasource.hikari.oracle")
public HikariConfig secondaryHikariConfig() {
// HikariConfig hikariConfig = new HikariConfig("spring.datasource.hikari");
// hikariConfig.setAutoCommit(false);
// return hikariConfig;
return new HikariConfig();
}
@Bean(name = Constants.SECONDARY_DATA_SOURCE)
public DataSource secondaryDataSource() throws Exception{
//return new LazyConnectionDataSourceProxy(new HikariDataSource(secondaryHikariConfig()));
return new HikariDataSource(secondaryHikariConfig());
//return new LazyConnectionDataSourceProxy(new HikariDataSource(primaryHikariConfig()));
return new HikariDataSource(primaryHikariConfig());
}
}

@ -1,21 +1,20 @@
package kr.xit.core.spring.config.support;
package kr.xit.core.spring.config.db;
import javax.sql.DataSource;
import kr.xit.core.consts.Constants;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.support.lob.DefaultLobHandler;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.sql.DataSource;
//FIXME :: 재설정이 필요한 경우 해당프로젝트에 동일한 파일로 재정의 하여 사용
/**
@ -34,8 +33,9 @@ import javax.sql.DataSource;
* </pre>
* @see DatasourceConfig
*/
@Slf4j
@Configuration
//@ConditionalOnProperty("spring.datasource.hikari.primary.username")
@ConditionalOnClass(PrimaryDatasourceConfig.class)
@MapperScan(
basePackages = {
"kr.xit.core.**.mapper",

@ -0,0 +1,27 @@
package kr.xit.core.spring.config.db;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* <pre>
* description :
*
* packageName : kr.xit.core.spring.config.db
* fileName : DataSourceProperties
* author : limju
* date : 2023-10-30
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-10-30 limju
*
* </pre>
*/
@ConfigurationProperties(prefix = "spring.datasource.hikari")
@Getter
@Setter
public class SecondaryDataSourceProperties {
private String secondary;
}

@ -0,0 +1,53 @@
package kr.xit.core.spring.config.db;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import kr.xit.core.consts.Constants;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//FIXME :: 재설정이 필요한 경우 해당 프로젝트에 동일한 파일로 재정의 하여 사용
/**
* <pre>
* description : Datasource - FIXME:: spring.datasource loading
* - : spring.datasource
*
* LazyConnectionDataSourceProxy
* Datasource
* - Spring get
* - ehcache, hibernate 1 get
* - multi-datasource datasource
* packageName : kr.xit.core.spring.config.support
* fileName : DatasourceConfig
* author : julim
* date : 2023-04-28
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-04-28 julim
*
* </pre>
* @see PrimaryMybatisConfig
*/
@Configuration
@ConditionalOnProperty(value = "spring.datasource.hikari.secondary.username")
public class SecondaryDatasourceConfig {
@Bean(name = "secondaryHikariConfig")
@ConfigurationProperties(prefix = "spring.datasource.hikari.secondary")
public HikariConfig secondaryHikariConfig() {
// HikariConfig hikariConfig = new HikariConfig("spring.datasource.hikari");
// hikariConfig.setAutoCommit(false);
// return hikariConfig;
return new HikariConfig();
}
@Bean(name = Constants.SECONDARY_DATA_SOURCE)
public DataSource secondaryDataSource() throws Exception{
//return new LazyConnectionDataSourceProxy(new HikariDataSource(secondaryHikariConfig()));
return new HikariDataSource(secondaryHikariConfig());
}
}

@ -1,5 +1,7 @@
package kr.xit.core.spring.config.support;
package kr.xit.core.spring.config.db;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import kr.xit.core.consts.Constants;
import org.apache.ibatis.session.SqlSessionFactory;
@ -7,25 +9,36 @@ import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
//FIXME :: 재설정이 필요한 경우 해당프로젝트에 동일한 파일로 재정의 하여 사용
@Configuration
//@Configuration
@MapperScan(
basePackages = {"kr.xit.biz.sms.mapper"},
sqlSessionFactoryRef = Constants.SECONDARY_SQL_SESSION
)
public class SecondaryMybatisConfig {
static final String MYBATIS_CONFIG_FILE = "classpath:/egovframework/mapper/mapper-config.xml";
@Bean(name = "secondaryHikariConfig")
public HikariConfig secondaryHikariConfig() {
// HikariConfig hikariConfig = new HikariConfig("spring.datasource.hikari");
// hikariConfig.setAutoCommit(false);
// return hikariConfig;
return new HikariConfig();
}
@Bean(name = Constants.SECONDARY_DATA_SOURCE)
public DataSource secondaryDataSource() throws Exception{
//return new LazyConnectionDataSourceProxy(new HikariDataSource(secondaryHikariConfig()));
return new HikariDataSource(secondaryHikariConfig());
}
@ConditionalOnProperty(value = "spring.datasource.hikari", havingValue = "oracle", matchIfMissing = false)
//@ConditionalOnProperty(value = "spring.datasource.hikari.secondary")
public SqlSessionFactory secondarySqlSession(@Qualifier(Constants.SECONDARY_DATA_SOURCE) DataSource dataSource) throws Exception {
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
@ -35,7 +48,7 @@ public class SecondaryMybatisConfig {
return sessionFactory.getObject();
}
@ConditionalOnProperty(value = "spring.datasource.hikari", havingValue = "oracle", matchIfMissing = false)
//@ConditionalOnProperty(value = "spring.datasource.hikari.secondary")
@Bean(name = "secondarySqlSessionTemplate")
public SqlSessionTemplate secondarySqlSessionTemplate(@Qualifier(Constants.SECONDARY_SQL_SESSION) SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);

@ -1,9 +1,9 @@
package kr.xit.core.spring.config.support;
package kr.xit.core.spring.config.db;
import javax.sql.DataSource;
import kr.xit.core.consts.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
@ -30,7 +30,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
* </pre>
* @see DatasourceConfig
*/
@Slf4j
@Configuration
@EnableTransactionManagement
public class TransactionConfig {
@ -41,6 +40,14 @@ public class TransactionConfig {
// DataSourceTransactionManager dstm = new DataSourceTransactionManager(dataSource);
// dstm.setGlobalRollbackOnParticipationFailure(false);
// return dstm;
// }
// @ConditionalOnMissingBean(SecondaryMybatisConfig.class)
// @Primary
// @Bean
// public PlatformTransactionManager primaryTransactionManager(@Qualifier(Constants.PRIMARY_DATA_SOURCE)DataSource dataSource) {
// DataSourceTransactionManager dstm = new DataSourceTransactionManager(dataSource);
// dstm.setGlobalRollbackOnParticipationFailure(false);
// return dstm;
// }
////////////////////////////////////////////////////////////////////////////////////////////
@ -54,6 +61,7 @@ public class TransactionConfig {
* @throws Exception Exception
*/
//@ConditionalOnProperty(value = "spring.datasource.hikari", havingValue = "oracle", matchIfMissing = false)
@ConditionalOnClass(SecondaryMybatisConfig.class)
@Primary
@Bean
public PlatformTransactionManager transactionManager(@Qualifier(Constants.PRIMARY_DATA_SOURCE)DataSource mariaDS,

@ -0,0 +1,3 @@
#org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
# kr.xit.core.spring.auto.PrimaryDatabaseAutoConfiguration, kr.xit.core.spring.auto.SecondaryDatabaseAutoConfiguration]
#

@ -9,7 +9,7 @@ spring:
# root / xit1807
hikari:
# 9 server
maria:
primary:
driver-class-name: org.mariadb.jdbc.Driver
jdbc-url: jdbc:mariadb://211.119.124.9:4407/mens?useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&autoReconnect=true
username: root
@ -19,7 +19,7 @@ spring:
# 115 server
# jdbc:oracle:thin:@211.119.124.115:1521:XITSMS
# xit_sms_lg / xit_sms_lg
oracle:
secondary:
driver-class-name: oracle.jdbc.OracleDriver
jdbc-url: jdbc:oracle:thin:@211.119.124.115:1521:XITSMS
username: xit_sms_lg

@ -651,7 +651,7 @@
AND tesm.ffnlg_code = #{ffnlgCode}
</select>
<select id="selectSmsSendTgts" resultType="kr.xit.biz.ens.model.EnsDTO$SmsSndng">
<select id="selectSmsSendTgts2" resultType="kr.xit.biz.ens.model.EnsDTO$SmsSndng">
/** ens-mysql-mapper|selectSmsSendTgts-SMS 발송 대상 목록 조회|julim */
SELECT tesm.unity_sndng_mastr_id
, tesm.sndng_mastr_id
@ -679,6 +679,25 @@
AND tesm.ffnlg_code = #{ffnlgCode}
</select>
<select id="selectSmsSendTgts" resultType="kr.xit.biz.ens.model.EnsDTO$SmsSndng">
/** ens-mysql-mapper|selectSmsSendTgts-SMS 발송 대상 목록 조회|julim */
SELECT tess.sndng_detail_id
, tess.unity_sndng_detail_id
, tess.sndng_mastr_id
, tess.signgu_code
, tess.ffnlg_code
, tess.vhcle_no
, tess.sms_sndng_dt /* 문자 발송 일시 */
, tess.sms_trnsmis_stle /* 문자 전송 형태 */
, tess.sms_trnsmit_tlphon_no /* 문자 송신 전화 번호 */
, tess.sms_recptn_tlphon_no /* 문자 수진 전화 번호 */
, tess.sms_mssage /* 문자 메세지 */
, tess.sms_sndng_sttus /* 문자 발송 상태 */
, tess.sms_sndng_process_sttus /* 문자 발송 처리 상태 */
FROM tb_ens_sms_sndng tess
WHERE tess.sndng_mastr_id = '20230728000000000005'
</select>
<select id="selectKtBcMstTgtInfo" resultType="kr.xit.biz.ens.model.EnsKtBcDTO$KtBcMst">
/** ens-mysql-mapper|selectKtBcMstTgtInfo-Kt 본문자 수신 대상 정보 조회|julim */
SELECT tesm.sndng_mastr_id /* 발송마스터 ID */

@ -91,21 +91,21 @@ public class AppInitHelper {
String db = BouncyDecUtils.decode(p+"private_key.pem", k, env.getProperty("app.license.data2"));
String[] arrDb = db.split(";");
props.put("spring.datasource.hikari.maria.driver-class-name", arrDb[0]);
props.put("spring.datasource.hikari.maria.read-only", arrDb[4]);
props.put("spring.datasource.hikari.maria.jdbc-url", arrDb[3]);
props.put("spring.datasource.hikari.maria.username", arrDb[1]);
props.put("spring.datasource.hikari.maria.password", arrDb[2]);
props.put("spring.datasource.hikari.primary.driver-class-name", arrDb[0]);
props.put("spring.datasource.hikari.primary.read-only", arrDb[4]);
props.put("spring.datasource.hikari.primary.jdbc-url", arrDb[3]);
props.put("spring.datasource.hikari.primary.username", arrDb[1]);
props.put("spring.datasource.hikari.primary.password", arrDb[2]);
db = null;
arrDb = null;
db = BouncyDecUtils.decode(p+"private_key.pem", k, env.getProperty("app.license.data3"));
arrDb = db.split(";");
props.put("spring.datasource.hikari.oracle.driver-class-name", arrDb[0]);
props.put("spring.datasource.hikari.oracle.read-only", arrDb[4]);
props.put("spring.datasource.hikari.oracle.jdbc-url", arrDb[3]);
props.put("spring.datasource.hikari.oracle.username", arrDb[1]);
props.put("spring.datasource.hikari.oracle.password", arrDb[2]);
props.put("spring.datasource.hikari.secondary.driver-class-name", arrDb[0]);
props.put("spring.datasource.hikari.secondary.read-only", arrDb[4]);
props.put("spring.datasource.hikari.secondary.jdbc-url", arrDb[3]);
props.put("spring.datasource.hikari.secondary.username", arrDb[1]);
props.put("spring.datasource.hikari.secondary.password", arrDb[2]);
env.getPropertySources().addFirst(new PropertiesPropertySource("decodeProps", props));
}

Loading…
Cancel
Save