-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
131 additions
and
1 deletion.
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
9 changes: 9 additions & 0 deletions
9
adapters/in-web/src/main/kotlin/com/pokit/category/dto/request/DuplicateCategoryRequest.kt
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,9 @@ | ||
package com.pokit.category.dto.request | ||
|
||
import jakarta.validation.constraints.Size | ||
|
||
data class DuplicateCategoryRequest ( | ||
val originCategoryId: Long, | ||
@field:Size(min = 1, max = 10, message = "최대 10자까지 입력 가능합니다.") | ||
val categoryName: String, | ||
) |
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
5 changes: 5 additions & 0 deletions
5
...stence/src/main/kotlin/com/pokit/out/persistence/content/persist/ContentJdbcRepository.kt
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,5 @@ | ||
package com.pokit.out.persistence.content.persist | ||
|
||
interface ContentJdbcRepository { | ||
fun bulkInsert(contentEntity: List<ContentEntity>) | ||
} |
33 changes: 33 additions & 0 deletions
33
...ce/src/main/kotlin/com/pokit/out/persistence/content/persist/ContentJdbcRepositoryImpl.kt
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,33 @@ | ||
package com.pokit.out.persistence.content.persist | ||
|
||
import org.springframework.jdbc.core.JdbcTemplate | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
class ContentJdbcRepositoryImpl( | ||
private val jdbcTemplate: JdbcTemplate | ||
) : ContentJdbcRepository { | ||
override fun bulkInsert(contentEntities: List<ContentEntity>) { | ||
val sql = """ | ||
INSERT INTO content ( | ||
category_id, type, data, title, memo, alert_yn, domain, is_deleted, thumb_nail, created_at, updated_at | ||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) | ||
""".trimIndent() | ||
|
||
val batchArgs = contentEntities.map { content -> | ||
arrayOf( | ||
content.categoryId, | ||
content.type.name, | ||
content.data, | ||
content.title, | ||
content.memo, | ||
content.alertYn, | ||
content.domain, | ||
content.deleted, | ||
content.thumbNail | ||
) | ||
} | ||
|
||
jdbcTemplate.batchUpdate(sql, batchArgs) | ||
} | ||
} |
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