diff --git a/buildSrc/src/main/kotlin/Modules.kt b/buildSrc/src/main/kotlin/Modules.kt index f5e3ec57..1b4f87fa 100644 --- a/buildSrc/src/main/kotlin/Modules.kt +++ b/buildSrc/src/main/kotlin/Modules.kt @@ -36,7 +36,7 @@ object Modules { InWebsocket(":service:blog:adapter:blog-in-websocket"), OutUser(":service:blog:adapter:blog-out-user"), OutMemo(":service:blog:adapter:blog-out-memo"), - OutPersistence(":service:blog:adapter:blog-out-persistence") + OutMySql(":service:blog:adapter:blog-out-mysql") } } @@ -48,7 +48,7 @@ object Modules { InAcl(":service:user-auth:adapter:user-auth-in-acl"), InHttp(":service:user-auth:adapter:user-auth-in-http"), OutGoogle(":service:user-auth:adapter:user-auth-out-google"), - OutH2(":service:user-auth:adapter:user-auth-out-h2"), + OutMySql(":service:user-auth:adapter:user-auth-out-mysql"), OutCache(":service:user-auth:adapter:user-auth-out-cache") } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 410d6857..cd1ea5fc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,6 +11,7 @@ spring-dependency-management = "1.1.5" # db h2 = "2.2.224" +mysql-connector-j = "8.3.0" # testcontainers testcontainers = "1.19.8" @@ -48,8 +49,10 @@ springdoc-openapi-ui = { module = "org.springdoc:springdoc-openapi-starter-webmv # spring spy spring-boot-starter-spy = { module = "com.github.gavlyukovskiy:p6spy-spring-boot-starter", version = "1.9.0" } -# h2 의존성 +# db 의존성 h2 = { module = "com.h2database:h2", version.ref = "h2" } +mysql-connector-j = { module = "com.mysql:mysql-connector-j", version.ref = "mysql-connector-j" } + # logback logback-classic = { module = "ch.qos.logback:logback-classic", version = "1.4.12" } @@ -63,6 +66,7 @@ mockk = { module = "io.mockk:mockk", version.ref = "mockk" } testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" } testcontainers-junit5 = { module = "org.testcontainers:junit-jupiter", version.ref = "testcontainers"} testcontainers-neo4j = { module = "org.testcontainers:neo4j", version.ref = "testcontainers" } +testcontainers-mysql = { module = "org.testcontainers:mysql", version.ref = "testcontainers" } restassured = {module = "io.rest-assured:spring-mock-mvc" , version = "5.4.0"} wiremock = {module = "org.springframework.cloud:spring-cloud-contract-wiremock", version = "4.1.0"} mockkbean = {module = "com.ninja-squad:springmockk", version = "4.0.2"} diff --git a/libs/rdb-kernel/build.gradle.kts b/libs/rdb-kernel/build.gradle.kts index 83f5deb6..d39e0aee 100644 --- a/libs/rdb-kernel/build.gradle.kts +++ b/libs/rdb-kernel/build.gradle.kts @@ -8,6 +8,7 @@ dependencies { api(project(Modules.Libs.CoreKernel.path)) api(libs.spring.boot.starter.data.jpa) implementation(libs.spring.boot.starter.spy) + implementation(libs.mysql.connector.j) implementation("com.querydsl:querydsl-jpa:5.1.0:jakarta") kapt("com.querydsl:querydsl-apt:5.1.0:jakarta") } diff --git a/mains/monolith-main/build.gradle.kts b/mains/monolith-main/build.gradle.kts index 96ebd8b1..6f4f2982 100644 --- a/mains/monolith-main/build.gradle.kts +++ b/mains/monolith-main/build.gradle.kts @@ -20,7 +20,7 @@ val blogService = mutableListOf( project(Modules.Service.Blog.Adaptors.InWebsocket.path), project(Modules.Service.Blog.Adaptors.OutUser.path), project(Modules.Service.Blog.Adaptors.OutMemo.path), - project(Modules.Service.Blog.Adaptors.OutPersistence.path), + project(Modules.Service.Blog.Adaptors.OutMySql.path), ) val memoService = mutableListOf( @@ -44,7 +44,7 @@ val authUserService = mutableListOf( project(Modules.Service.AuthUser.Adaptors.OutGoogle.path), project(Modules.Service.AuthUser.Adaptors.InHttp.path), project(Modules.Service.AuthUser.Adaptors.OutCache.path), - project(Modules.Service.AuthUser.Adaptors.OutH2.path), + project(Modules.Service.AuthUser.Adaptors.OutMySql.path), ) val admin = mutableListOf( @@ -67,13 +67,15 @@ val bootLib = mutableListOf( libs.spring.boot.starter.web, libs.spring.boot.starter.data.neo4j, libs.spring.boot.starter.actuator, - libs.h2, + libs.mysql.connector.j, + libs.h2 ) var integrationTestLib = mutableListOf( libs.testcontainers, libs.testcontainers.junit5, libs.testcontainers.neo4j, + libs.testcontainers.mysql, libs.restassured, libs.wiremock, libs.mockkbean, diff --git a/mains/monolith-main/src/test/kotlin/kr/co/jiniaslog/TestContainerAbstractSkeleton.kt b/mains/monolith-main/src/test/kotlin/kr/co/jiniaslog/TestContainerAbstractSkeleton.kt index 70b0f0a1..9a049852 100644 --- a/mains/monolith-main/src/test/kotlin/kr/co/jiniaslog/TestContainerAbstractSkeleton.kt +++ b/mains/monolith-main/src/test/kotlin/kr/co/jiniaslog/TestContainerAbstractSkeleton.kt @@ -3,7 +3,7 @@ package kr.co.jiniaslog import io.mockk.mockk import io.restassured.RestAssured import kr.co.jiniaslog.media.outbound.ImageUploader -import kr.co.jiniaslog.utils.H2RdbCleaner +import kr.co.jiniaslog.utils.MySqlRdbCleaner import kr.co.jiniaslog.utils.Neo4jDbCleaner import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach @@ -18,6 +18,7 @@ import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Primary import org.springframework.test.context.DynamicPropertyRegistry import org.springframework.test.context.DynamicPropertySource +import org.testcontainers.containers.MySQLContainer import org.testcontainers.containers.Neo4jContainer import org.testcontainers.junit.jupiter.Testcontainers @@ -55,7 +56,7 @@ abstract class TestContainerAbstractSkeleton { protected lateinit var neo4jDbCleaner: Neo4jDbCleaner @Autowired - protected lateinit var h2RdbCleaner: H2RdbCleaner + protected lateinit var mySqlRdbCleaner: MySqlRdbCleaner @BeforeEach fun setUp() { @@ -65,7 +66,7 @@ abstract class TestContainerAbstractSkeleton { @AfterEach fun tearDown() { neo4jDbCleaner.tearDownAll() - h2RdbCleaner.tearDownAll() + mySqlRdbCleaner.tearDownAll() } @Test @@ -73,11 +74,30 @@ abstract class TestContainerAbstractSkeleton { } companion object { + private const val RDB_CHARSET = "--character-set-server=utf8mb4" + private const val RDB_COLLATION = "--collation-server=utf8mb4_unicode_ci" + private const val RDB_INIT_SQL = "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci" + @JvmStatic val neo4j: Neo4jContainer<*> = CustomNeo4jContainer() + @JvmStatic + val userDb: MySQLContainer<*> = MySQLContainer("mysql:8.0") + .withCommand(RDB_CHARSET, RDB_COLLATION) + .withDatabaseName("jiniaslog_user") + .withReuse(true) + + @JvmStatic + val blogDb: MySQLContainer<*> = + MySQLContainer("mysql:8.0") + .withCommand(RDB_CHARSET, RDB_COLLATION) + .withDatabaseName("jiniaslog_blog") + .withReuse(true) + init { neo4j.start() + userDb.start() + blogDb.start() } @DynamicPropertySource @@ -87,6 +107,20 @@ abstract class TestContainerAbstractSkeleton { registry.add("spring.neo4j.uri") { neo4j.boltUrl } registry.add("spring.neo4j.authentication.username") { "neo4j" } registry.add("spring.neo4j.authentication.password") { "password" } + + // user db + registry.add("spring.datasource.user.jdbc-url") { userDb.jdbcUrl } + registry.add("spring.datasource.user.username") { userDb.username } + registry.add("spring.datasource.user.password") { userDb.password } + registry.add("spring.datasource.user.driver-class-name") { userDb.driverClassName } + registry.add("spring.datasource.user.connection-init-sql") { RDB_INIT_SQL } + + // blog db + registry.add("spring.datasource.blog.jdbc-url") { blogDb.jdbcUrl } + registry.add("spring.datasource.blog.username") { blogDb.username } + registry.add("spring.datasource.blog.password") { blogDb.password } + registry.add("spring.datasource.blog.driver-class-name") { blogDb.driverClassName } + registry.add("spring.datasource.blog.connection-init-sql") { RDB_INIT_SQL } } } } diff --git a/mains/monolith-main/src/test/kotlin/kr/co/jiniaslog/utils/H2RdbCleaner.kt b/mains/monolith-main/src/test/kotlin/kr/co/jiniaslog/utils/MySqlRdbCleaner.kt similarity index 69% rename from mains/monolith-main/src/test/kotlin/kr/co/jiniaslog/utils/H2RdbCleaner.kt rename to mains/monolith-main/src/test/kotlin/kr/co/jiniaslog/utils/MySqlRdbCleaner.kt index d8eb348c..37bfe2b3 100644 --- a/mains/monolith-main/src/test/kotlin/kr/co/jiniaslog/utils/H2RdbCleaner.kt +++ b/mains/monolith-main/src/test/kotlin/kr/co/jiniaslog/utils/MySqlRdbCleaner.kt @@ -7,7 +7,7 @@ import java.sql.Connection import javax.sql.DataSource @Component -class H2RdbCleaner(private val dataSources: List) : DbCleaner { +class MySqlRdbCleaner(private val dataSources: List) : DbCleaner { override fun tearDownAll() { dataSources.forEach { dataSource -> clean(dataSource) @@ -19,22 +19,22 @@ class H2RdbCleaner(private val dataSources: List) : DbCleaner { var connection: Connection? = null try { connection = DataSourceUtils.getConnection(jdbcTemplate.dataSource!!) - - jdbcTemplate.execute(NO_LOG + FOREIGN_KEY_FALSE) + val schema: String = connection.catalog val tableNames: List = jdbcTemplate.query( NO_LOG + QUERY_TABLE_NAMES, - arrayOf(H2_SCHEMA), + arrayOf(schema), ) { resultSet, _ -> resultSet.getString(TABLE_NAME) } + jdbcTemplate.execute(NO_LOG + "SET FOREIGN_KEY_CHECKS=0;") tableNames.forEach { tableName -> - jdbcTemplate.execute(String.format(NO_LOG + DELETE_ALL_TABLES, tableName)) + jdbcTemplate.execute(NO_LOG + "TRUNCATE TABLE $tableName") } + jdbcTemplate.execute(NO_LOG + "SET FOREIGN_KEY_CHECKS=1;") } finally { if (connection != null) { - jdbcTemplate.execute(NO_LOG + FOREIGN_KEY_TRUE) DataSourceUtils.releaseConnection(connection, jdbcTemplate.dataSource!!) } } @@ -42,11 +42,7 @@ class H2RdbCleaner(private val dataSources: List) : DbCleaner { companion object { private const val NO_LOG = "-- NO_LOG \n" - private const val FOREIGN_KEY_FALSE = "SET REFERENTIAL_INTEGRITY FALSE;" - private const val FOREIGN_KEY_TRUE = "SET REFERENTIAL_INTEGRITY TRUE;" private const val QUERY_TABLE_NAMES = "SELECT table_name FROM information_schema.tables WHERE table_schema = ?" - private const val H2_SCHEMA = "PUBLIC" private const val TABLE_NAME = "table_name" - private const val DELETE_ALL_TABLES = "DELETE FROM %s" } } diff --git a/service/blog/adapter/blog-out-persistence/build.gradle.kts b/service/blog/adapter/blog-out-mysql/build.gradle.kts similarity index 94% rename from service/blog/adapter/blog-out-persistence/build.gradle.kts rename to service/blog/adapter/blog-out-mysql/build.gradle.kts index 4a7dd3f1..c94c0213 100644 --- a/service/blog/adapter/blog-out-persistence/build.gradle.kts +++ b/service/blog/adapter/blog-out-mysql/build.gradle.kts @@ -9,7 +9,6 @@ dependencies { implementation(project(Modules.Libs.RdbKernel.path)) implementation(project(Modules.Service.Blog.Core.path)) implementation(libs.spring.boot.starter.data.jpa) - implementation(libs.h2) implementation(libs.spring.boot.starter.validation) implementation("com.querydsl:querydsl-jpa:5.1.0:jakarta") kapt("com.querydsl:querydsl-apt:5.1.0:jakarta") diff --git a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/ArticleRepositoryAdapter.kt b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/ArticleRepositoryAdapter.kt similarity index 93% rename from service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/ArticleRepositoryAdapter.kt rename to service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/ArticleRepositoryAdapter.kt index d3ff08fd..1d4039bf 100644 --- a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/ArticleRepositoryAdapter.kt +++ b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/ArticleRepositoryAdapter.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.blog.adapter.outbound.persistence +package kr.co.jiniaslog.blog.adapter.outbound.mysql import kr.co.jiniaslog.blog.domain.article.Article import kr.co.jiniaslog.blog.domain.article.ArticleId diff --git a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/BlogTransactionHandlerImpl.kt b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/BlogTransactionHandlerImpl.kt similarity index 89% rename from service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/BlogTransactionHandlerImpl.kt rename to service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/BlogTransactionHandlerImpl.kt index 786f7389..16709a15 100644 --- a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/BlogTransactionHandlerImpl.kt +++ b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/BlogTransactionHandlerImpl.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.blog.adapter.outbound.persistence +package kr.co.jiniaslog.blog.adapter.outbound.mysql import kr.co.jiniaslog.blog.outbound.BlogTransactionHandler import org.springframework.stereotype.Component diff --git a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/CategoryRepositoryAdapter.kt b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/CategoryRepositoryAdapter.kt similarity index 95% rename from service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/CategoryRepositoryAdapter.kt rename to service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/CategoryRepositoryAdapter.kt index 1876cdbd..36cb203d 100644 --- a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/CategoryRepositoryAdapter.kt +++ b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/CategoryRepositoryAdapter.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.blog.adapter.outbound.persistence +package kr.co.jiniaslog.blog.adapter.outbound.mysql import kr.co.jiniaslog.blog.domain.category.Category import kr.co.jiniaslog.blog.domain.category.CategoryId diff --git a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/TagJpaRepositoryAdapter.kt b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/TagJpaRepositoryAdapter.kt similarity index 96% rename from service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/TagJpaRepositoryAdapter.kt rename to service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/TagJpaRepositoryAdapter.kt index e18b1186..92c9e9b1 100644 --- a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/TagJpaRepositoryAdapter.kt +++ b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/TagJpaRepositoryAdapter.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.blog.adapter.outbound.persistence +package kr.co.jiniaslog.blog.adapter.outbound.mysql import com.querydsl.jpa.JPAExpressions import com.querydsl.jpa.impl.JPAQueryFactory diff --git a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/config/BlogDbConfig.kt b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/config/BlogDbConfig.kt similarity index 97% rename from service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/config/BlogDbConfig.kt rename to service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/config/BlogDbConfig.kt index b65eaf3c..293a555f 100644 --- a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/config/BlogDbConfig.kt +++ b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/config/BlogDbConfig.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.blog.adapter.outbound.persistence.config +package kr.co.jiniaslog.blog.adapter.outbound.mysql.config import jakarta.persistence.EntityManagerFactory import kr.co.jiniaslog.shared.adapter.out.rdb.JpaAutoDdlProperty diff --git a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/config/QdslConfig.kt b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/config/QdslConfig.kt similarity index 87% rename from service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/config/QdslConfig.kt rename to service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/config/QdslConfig.kt index f37462b7..101673a5 100644 --- a/service/blog/adapter/blog-out-persistence/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/persistence/config/QdslConfig.kt +++ b/service/blog/adapter/blog-out-mysql/src/main/kotlin/kr/co/jiniaslog/blog/adapter/outbound/mysql/config/QdslConfig.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.blog.adapter.outbound.persistence.config +package kr.co.jiniaslog.blog.adapter.outbound.mysql.config import com.querydsl.jpa.impl.JPAQueryFactory import jakarta.persistence.EntityManager diff --git a/service/blog/blog-core/build.gradle.kts b/service/blog/blog-core/build.gradle.kts index f5111158..8408efce 100644 --- a/service/blog/blog-core/build.gradle.kts +++ b/service/blog/blog-core/build.gradle.kts @@ -10,7 +10,6 @@ dependencies { implementation(project(Modules.Libs.RdbKernel.path)) implementation(libs.spring.boot.starter.data.jpa) implementation(libs.spring.boot.starter.core) - implementation(libs.h2) implementation(libs.spring.boot.starter.validation) implementation("com.querydsl:querydsl-jpa:5.1.0:jakarta") diff --git a/service/user-auth/adapter/user-auth-out-h2/build.gradle.kts b/service/user-auth/adapter/user-auth-out-mysql/build.gradle.kts similarity index 89% rename from service/user-auth/adapter/user-auth-out-h2/build.gradle.kts rename to service/user-auth/adapter/user-auth-out-mysql/build.gradle.kts index 2c93cbc3..a16a88a6 100644 --- a/service/user-auth/adapter/user-auth-out-h2/build.gradle.kts +++ b/service/user-auth/adapter/user-auth-out-mysql/build.gradle.kts @@ -9,7 +9,7 @@ dependencies { implementation(project(Modules.Service.AuthUser.Application.path)) implementation(project(Modules.Libs.CoreKernel.path)) implementation(project(Modules.Libs.RdbKernel.path)) - api(libs.spring.boot.starter.data.jpa) - implementation(libs.h2) implementation(libs.spring.boot.starter.spy) + implementation(libs.mysql.connector.j) + api(libs.spring.boot.starter.data.jpa) } diff --git a/service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/UserDbConfig.kt b/service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/UserDbConfig.kt similarity index 95% rename from service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/UserDbConfig.kt rename to service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/UserDbConfig.kt index 0cb8900a..1429dae3 100644 --- a/service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/UserDbConfig.kt +++ b/service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/UserDbConfig.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.user.adapter.out.h2 +package kr.co.jiniaslog.user.adapter.out.mysql import jakarta.persistence.EntityManagerFactory import kr.co.jiniaslog.shared.adapter.out.rdb.JpaAutoDdlProperty @@ -16,7 +16,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement import javax.sql.DataSource object UserDb { - const val BASE_PACKAGE = "kr.co.jiniaslog.user.adapter.out.h2" + const val BASE_PACKAGE = "kr.co.jiniaslog.user.adapter.out.mysql" const val DATASOURCE_PREFIX = "spring.datasource.user" const val ENTITY_MANAGER_FACTORY = "userEntityManagerFactory" const val DATASOURCE = "userDatasource" diff --git a/service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/UserTransactionHandlerImpl.kt b/service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/UserTransactionHandlerImpl.kt similarity index 91% rename from service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/UserTransactionHandlerImpl.kt rename to service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/UserTransactionHandlerImpl.kt index 5af69866..1ffae408 100644 --- a/service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/UserTransactionHandlerImpl.kt +++ b/service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/UserTransactionHandlerImpl.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.user.adapter.out.h2 +package kr.co.jiniaslog.user.adapter.out.mysql import kr.co.jiniaslog.user.application.infra.UserAuthTransactionHandler import org.springframework.stereotype.Component diff --git a/service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/user/UserJpaEntity.kt b/service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/user/UserJpaEntity.kt similarity index 96% rename from service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/user/UserJpaEntity.kt rename to service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/user/UserJpaEntity.kt index 854a31fd..6514dded 100644 --- a/service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/user/UserJpaEntity.kt +++ b/service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/user/UserJpaEntity.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.user.adapter.out.h2.user +package kr.co.jiniaslog.user.adapter.out.mysql.user import jakarta.persistence.Column import jakarta.persistence.Entity diff --git a/service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/user/UserJpaRepository.kt b/service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/user/UserJpaRepository.kt similarity index 77% rename from service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/user/UserJpaRepository.kt rename to service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/user/UserJpaRepository.kt index 35a78827..dc7f0e7a 100644 --- a/service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/user/UserJpaRepository.kt +++ b/service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/user/UserJpaRepository.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.user.adapter.out.h2.user +package kr.co.jiniaslog.user.adapter.out.mysql.user import org.springframework.data.jpa.repository.JpaRepository diff --git a/service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/user/UserRepositoryAdapter.kt b/service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/user/UserRepositoryAdapter.kt similarity index 96% rename from service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/user/UserRepositoryAdapter.kt rename to service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/user/UserRepositoryAdapter.kt index 62464dde..c5b7e64d 100644 --- a/service/user-auth/adapter/user-auth-out-h2/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/h2/user/UserRepositoryAdapter.kt +++ b/service/user-auth/adapter/user-auth-out-mysql/src/main/kotlin/kr/co/jiniaslog/user/adapter/out/mysql/user/UserRepositoryAdapter.kt @@ -1,4 +1,4 @@ -package kr.co.jiniaslog.user.adapter.out.h2.user +package kr.co.jiniaslog.user.adapter.out.mysql.user import kr.co.jiniaslog.shared.core.annotation.PersistenceAdapter import kr.co.jiniaslog.user.application.infra.UserRepository diff --git a/settings.gradle.kts b/settings.gradle.kts index 825c9162..5b883e6f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -28,7 +28,7 @@ include( "service:blog:adapter:blog-in-websocket", "service:blog:adapter:blog-out-user", "service:blog:adapter:blog-out-memo", - "service:blog:adapter:blog-out-persistence", + "service:blog:adapter:blog-out-mysql", // memo "service:memo:memo-domain", @@ -52,7 +52,7 @@ include( "service:user-auth:adapter:user-auth-in-http", "service:user-auth:adapter:user-auth-in-acl", "service:user-auth:adapter:user-auth-out-google", - "service:user-auth:adapter:user-auth-out-h2", + "service:user-auth:adapter:user-auth-out-mysql", "service:user-auth:adapter:user-auth-out-cache", // admin