This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sma.rabbitmq.service; | |
import com.sma.rabbitmq.model.Category; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.amqp.rabbit.annotation.RabbitListener; | |
import org.springframework.stereotype.Component; | |
/** | |
* Author: Mak Sophea | |
* Date: 07/31/2020 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sma.rabbitmq.config; | |
import org.springframework.amqp.core.Binding; | |
import org.springframework.amqp.core.BindingBuilder; | |
import org.springframework.amqp.core.DirectExchange; | |
import org.springframework.amqp.core.Queue; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sma.backend.service; | |
/** | |
* @author Mak Sophea | |
* @date : 1/21/2020 | |
**/ | |
import lombok.extern.slf4j.Slf4j; | |
import org.apache.commons.io.FileUtils; | |
import org.apache.commons.io.IOUtils; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Mak Sophea | |
* @date : 1/15/2020 | |
**/ | |
@Configuration | |
public class TransactionManagerConfig { | |
@Bean(name = "chainedTransactionManager") | |
public ChainedTransactionManager transactionManager ( | |
@Qualifier("sqlServerTransactionManager") PlatformTransactionManager sqlTransactionManager, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@EnableTransactionManagement | |
@EnableJpaRepositories(entityManagerFactoryRef = "sqlServerEntityManagerFactory", transactionManagerRef = "sqlServerTransactionManager", basePackages = "com.sma.aml.repository") | |
public class SqlServerDatabaseConfiguration { | |
@Bean | |
@ConfigurationProperties(prefix = "sqlServer.datasource") | |
public DataSourceProperties sqlServerDataSourceProperties() { | |
return new DataSourceProperties(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@EnableTransactionManagement | |
@EnableJpaRepositories(entityManagerFactoryRef = "oracleEntityManagerFactory", transactionManagerRef = "oracleTransactionManager", basePackages = { "com.sma.oracle.repository" }) | |
public class OracleDatabaseConfiguration { | |
@Primary | |
@Bean | |
@ConfigurationProperties(prefix = "oracle.datasource") | |
public DataSourceProperties oracleDataSourceProperties(@Qualifier("oracleDataSourceProperties() { | |
return new DataSourceProperties(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sma.security.utils; | |
import lombok.extern.slf4j.Slf4j; | |
import javax.crypto.Cipher; | |
import javax.crypto.NoSuchPaddingException; | |
import javax.crypto.SecretKey; | |
import javax.crypto.SecretKeyFactory; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.spec.PBEParameterSpec; | |
import java.security.InvalidAlgorithmParameterException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sma.backend.multidb.controller; | |
import com.sma.backend.multidb.database.mysql.domain.CategoryEntity; | |
import com.sma.backend.multidb.database.mysql.repository.CategoryRepository; | |
import com.sma.backend.multidb.database.sqlserver.domain.CountryEntity; | |
import com.sma.backend.multidb.database.sqlserver.repository.CountryRepository; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.RequestBody; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sma.backend.multidb.config; | |
@Configuration | |
@EnableTransactionManagement | |
@EnableJpaRepositories(entityManagerFactoryRef = "mysqlEntityManagerFactory", transactionManagerRef = "mysqlTransactionManager", basePackages = {"com.sma.backend.multidb.database.mysql.repository"}) | |
public class MySqlConfig { | |
@Primary | |
@Bean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sma.backend.multidb.config; | |
import org.springframework.beans.factory.annotation.Qualifier; | |
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; | |
import org.springframework.boot.context.properties.ConfigurationProperties; | |
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | |
import org.springframework.orm.jpa.JpaTransactionManager; |