Skip to content

Commit

Permalink
refactor: ktlint trailing comma 허용 룰 적용(storage 모듈)
Browse files Browse the repository at this point in the history
  • Loading branch information
hun-ca committed Jul 14, 2024
1 parent ffbce78 commit 65b5efa
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ClientConfig(
@Value("\${storage.url}") val url: String,
@Value("\${storage.access-key}") val accessKey: String,
@Value("\${storage.secret-key}") val secretKey: String,
@Value("\${storage.region}") val region: String
@Value("\${storage.region}") val region: String,
) {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.slf4j.LoggerFactory

class S3DocumentStoreClient(
private val s3client: AmazonS3Client,
private val region: String
private val region: String,
) : DocumentStoreClient {

private val log = LoggerFactory.getLogger(S3DocumentStoreClient::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun DocumentPutObjectArgs.toS3Args(): PutObjectRequest {
data class DocumentGetPreSignedObjectUrlArgs(
val bucket: String,
val imagePath: String,
val method: String
val method: String,
)

data class DocumentPutObjectArgs(
Expand All @@ -45,10 +45,10 @@ data class DocumentPutObjectArgs(
val stream: InputStream,
val objectSize: Long,
val partSize: Long,
val contentType: ContentType = ContentType.IMAGE_JPEG
val contentType: ContentType = ContentType.IMAGE_JPEG,
)

data class DocumentRemoveObjectArgs(
val bucket: String,
val imagePath: String
val imagePath: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ data class DocumentWriteResponse(
val region: String,
val `object`: String,
val etag: String,
val versionId: String
val versionId: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.springframework.context.event.ContextRefreshedEvent
@Import(ClientConfig::class)
class S3DocumentStoreConfig(
@Value("\${document.store.bucket-name}") val bucket: String,
@Value("\${storage.region}") val region: String
@Value("\${storage.region}") val region: String,
) : ApplicationListener<ContextRefreshedEvent> {
var log: Logger = LoggerFactory.getLogger(S3DocumentStoreConfig::class.java)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.springframework.stereotype.Service
@Service
class S3GetPreSignedDocumentUrlService(
@Value("\${document.store.bucket-name}") val bucket: String,
private val documentStoreClient: DocumentStoreClient
private val documentStoreClient: DocumentStoreClient,
) : GetPreSignedDocumentUrlService {
override fun execute(image: String): String? {
DocumentArgsGenerator.preSignedUrl(bucket, image).let { args ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.io.File
@Service
class S3PutDocumentService(
@Value("\${document.store.bucket-name}") val bucket: String,
private val documentStoreClient: DocumentStoreClient
private val documentStoreClient: DocumentStoreClient,
) : PutDocumentService {
override fun execute(name: String, file: File): DocumentWriteResponse? {
DocumentArgsGenerator.putDocument(bucket, name, file).let { args ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.slf4j.LoggerFactory

class S3ImageStoreClient(
private val s3client: AmazonS3Client,
private val region: String
private val region: String,
) : ImageStoreClient {

val log: Logger = LoggerFactory.getLogger(S3ImageStoreClient::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fun ImagePutObjectArgs.toS3Args(): PutObjectRequest {
data class ImageGetPreSignedObjectUrlArgs(
val bucket: String,
val imagePath: String,
val method: String
val method: String,
)

data class ImagePutObjectArgs(
Expand All @@ -46,10 +46,10 @@ data class ImagePutObjectArgs(
val stream: InputStream,
val objectSize: Long,
val partSize: Long,
val contentType: ContentType = ContentType.IMAGE_JPEG
val contentType: ContentType = ContentType.IMAGE_JPEG,
)

data class ImageRemoveObjectArgs(
val bucket: String,
val imagePath: String
val imagePath: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ data class ImageWriteResponse(
val region: String,
val `object`: String,
val etag: String,
val versionId: String
val versionId: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.springframework.context.event.ContextRefreshedEvent
@Configuration
class S3ImageStoreConfig(
@Value("\${image.store.bucket-name}") val bucket: String,
@Value("\${storage.region}") val region: String
@Value("\${storage.region}") val region: String,
) : ApplicationListener<ContextRefreshedEvent> {

var log: Logger = LoggerFactory.getLogger(S3ImageStoreConfig::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.springframework.stereotype.Service
@Service
class S3GetPreSignedImageUrlService(
@Value("\${image.store.bucket-name}") val bucket: String,
private val imageStoreClient: ImageStoreClient
private val imageStoreClient: ImageStoreClient,
) : GetPreSignedImageUrlService {
override fun execute(image: String): String? {
ImageArgsGenerator.preSignedUrl(bucket, image).let { args ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.io.File
@Service
class S3PutImageService(
@Value("\${image.store.bucket-name}") val bucket: String,
private val imageStoreClient: ImageStoreClient
private val imageStoreClient: ImageStoreClient,
) : PutImageService {
override fun execute(name: String, file: File): ImageWriteResponse? {
ImageArgsGenerator.putImage(bucket, name, file).let { args ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.springframework.stereotype.Service
@Service
class S3RemoveImageService(
@Value("\${image.store.bucket-name}") val bucket: String,
private val imageStoreClient: ImageStoreClient
private val imageStoreClient: ImageStoreClient,
) : RemoveImageService {
override fun execute(image: String): Boolean {
ImageArgsGenerator.remove(bucket, image).let { args ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import org.springframework.stereotype.Component

@Component
data class CdnProperty(
@Value("\${cdn.url}") val url: String
@Value("\${cdn.url}") val url: String,
)

0 comments on commit 65b5efa

Please sign in to comment.