-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* �chore: 유저관련 temp API 추가 (#359) * del(meeting): 모임 지원자 목록 csv 파일 다운로드 temp 삭제 * del(meeting): 모임 게시글 댓글 리스트 조회 temp 삭제 * chore(meeting): 유저 관련 API temp 버전 추가 * �chore: 모임 관련 API 스웨거에 보이는 응답값 수정 (#361) * chore(meeting): 모임 활동 시간 Dto 반환 수정 * docs(meeting): status 스웨거상 enum 으로 보이게 수정 * chore(meeting): dto내 NotNull 오류 수정 * docs(meeting): 1,2,3 -> 0,1,2 로 수정 * docs(meeting): number -> integer 로 수정 * feat: 모니터링 서버 구축 (#357) * add(setting): actuator 및 prometheus exporter 설정 * add(yml): 액츄에이터 관련하여 커스텀 포트 및 path 적용 * chore(config): 헬스체크 엔드포인트 화이트리스트에 추가 * chore(config): 화이트리스트 한 곳에서 관리할 수 있도록 코드 구조 변경 * chore(Advertisement): id, 게시 시작일 데이터 추가 (#365) * refactor: 시큐리티 config 코드 개선 및 헬스 체크 방식 변경 (#363) * refactor(config): 중복코드 제거 * del(config): 사용하지 않는 코드 제거 * fix(User): AppliedCount -> ApprovedCount 로 변경 (#374) * feat(application-local.yml): application-local.yml 세팅 (#375) * fix(Post): desc 데이터 추가 (#378) * �chore: 플그 db 연결 작업 (#376) * feat(MemberBlock): 플그의 MemberBlock 테이블 등록 * infra(Playground): 플그 db 연결 * add(Playground): 차단 관련 repository 추가 * feat(Playground): 기능 테스트를 위한 임시 API 개발 (삭제 필요) * fix(config): 테스트 db는 기존대로 유지 * chore(config): local db 설정을 위한 수정 * chore(yml): prod yml 수정 * chore(yml): 테스트를 위한 API 수정 * fix(config): validate 추가 * del(config): 사용하지 않는 어노테이션 삭제 * chore(local,config): local-yml 수정 * refactor(ci&cd): docker hub 푸시할 때 태그 추가 (#380) --------- Co-authored-by: DongHoon Lee <[email protected]>
- Loading branch information
Showing
36 changed files
with
740 additions
and
558 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
71 changes: 71 additions & 0 deletions
71
main/src/main/java/org/sopt/makers/crew/main/common/config/CrewDatabaseConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package org.sopt.makers.crew.main.common.config; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
import javax.sql.DataSource; | ||
|
||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.boot.jdbc.DataSourceBuilder; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Primary; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
import org.springframework.orm.jpa.JpaTransactionManager; | ||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; | ||
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; | ||
import org.springframework.transaction.PlatformTransactionManager; | ||
import org.springframework.transaction.annotation.EnableTransactionManagement; | ||
|
||
@Configuration | ||
@EnableTransactionManagement | ||
@EnableJpaRepositories( | ||
basePackages = "org.sopt.makers.crew.main.entity", // 첫번째 DB가 있는 패키지(폴더) 경로 | ||
entityManagerFactoryRef = "primaryEntityManagerFactory", // EntityManager의 이름 | ||
transactionManagerRef = "primaryTransactionManager" // 트랜잭션 매니저의 이름 | ||
) | ||
@Profile({"local", "dev", "prod"}) | ||
public class CrewDatabaseConfig { | ||
|
||
@Bean | ||
@Primary | ||
@ConfigurationProperties("spring.datasource") | ||
public DataSource primaryDatasourceProperties() { | ||
return DataSourceBuilder.create().build(); | ||
} | ||
|
||
@Bean(name = "primaryEntityManagerFactory") | ||
@Primary | ||
public LocalContainerEntityManagerFactoryBean primaryEntityManagerFactory() { | ||
DataSource dataSource = primaryDatasourceProperties(); | ||
|
||
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); | ||
em.setDataSource(dataSource); | ||
em.setPackagesToScan("org.sopt.makers.crew.main.entity"); | ||
|
||
HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); | ||
vendorAdapter.setShowSql(true); | ||
em.setJpaVendorAdapter(vendorAdapter); | ||
|
||
Map<String, Object> properties = new HashMap<>(); | ||
properties.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect"); | ||
properties.put("hibernate.hbm2ddl.auto", "validate"); | ||
properties.put("hibernate.format_sql", true); | ||
properties.put("hibernate.physical_naming_strategy", "org.sopt.makers.crew.main.common.config.CamelCaseNamingStrategy"); | ||
properties.put("hibernate.globally_quoted_identifiers", true); | ||
em.setJpaPropertyMap(properties); | ||
|
||
return em; | ||
} | ||
|
||
@Bean(name = "primaryTransactionManager") | ||
@Primary | ||
public PlatformTransactionManager primaryTransactionManager( | ||
final @Qualifier("primaryEntityManagerFactory") LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean | ||
) { | ||
return new JpaTransactionManager(Objects.requireNonNull(localContainerEntityManagerFactoryBean.getObject())); | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
main/src/main/java/org/sopt/makers/crew/main/common/config/PlaygroundDataSourceConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package org.sopt.makers.crew.main.common.config; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
import javax.sql.DataSource; | ||
|
||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.boot.jdbc.DataSourceBuilder; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
import org.springframework.orm.jpa.JpaTransactionManager; | ||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; | ||
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; | ||
import org.springframework.transaction.PlatformTransactionManager; | ||
import org.springframework.transaction.annotation.EnableTransactionManagement; | ||
|
||
@Configuration | ||
@EnableTransactionManagement | ||
@EnableJpaRepositories( | ||
basePackages = "org.sopt.makers.crew.main.external.playground.entity", | ||
entityManagerFactoryRef = "secondEntityManagerFactory", | ||
transactionManagerRef = "secondTransactionManager" | ||
) | ||
@Profile({"local", "dev", "prod"}) | ||
public class PlaygroundDataSourceConfig { | ||
@Bean | ||
@ConfigurationProperties("spring.playground-datasource") | ||
public DataSource secondDatasourceProperties() { | ||
return DataSourceBuilder.create().build(); | ||
} | ||
|
||
@Bean(name = "secondEntityManagerFactory") | ||
public LocalContainerEntityManagerFactoryBean secondEntityManagerFactory() { | ||
DataSource dataSource = secondDatasourceProperties(); | ||
|
||
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); | ||
em.setDataSource(dataSource); | ||
em.setPackagesToScan("org.sopt.makers.crew.main.external.playground.entity"); | ||
|
||
HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); | ||
vendorAdapter.setShowSql(true); | ||
em.setJpaVendorAdapter(vendorAdapter); | ||
|
||
Map<String, Object> properties = new HashMap<>(); | ||
properties.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect"); | ||
properties.put("hibernate.hbm2ddl.auto", "validate"); | ||
properties.put("hibernate.format_sql", true); | ||
properties.put("hibernate.physical_naming_strategy", "org.sopt.makers.crew.main.common.config.CamelCaseNamingStrategy"); | ||
properties.put("hibernate.globally_quoted_identifiers", true); | ||
em.setJpaPropertyMap(properties); | ||
|
||
return em; | ||
} | ||
|
||
@Bean(name = "secondTransactionManager") | ||
public PlatformTransactionManager secondTransactionManager( | ||
final @Qualifier("secondEntityManagerFactory") LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean | ||
) { | ||
return new JpaTransactionManager(Objects.requireNonNull(localContainerEntityManagerFactoryBean.getObject())); | ||
} | ||
} |
Oops, something went wrong.