Skip to content

Commit

Permalink
Merge pull request #161 from SW13-Monstera/dev
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
kshired authored Dec 17, 2023
2 parents 8c7b3f2 + bbd741e commit 67bdb76
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
8 changes: 6 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ dependencies {
// mail
implementation("org.springframework.boot:spring-boot-starter-mail")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("aws.sdk.kotlin:ses:${property("awsSdkVersion")}")
implementation("aws.sdk.kotlin:s3:${property("awsSdkVersion")}")
implementation("aws.sdk.kotlin:ses:${property("awsSdkVersion")}") {
exclude("com.squareup.okhttp3:okhttp")
}
implementation("aws.sdk.kotlin:s3:${property("awsSdkVersion")}") {
exclude("com.squareup.okhttp3:okhttp")
}
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${property("kotlinCoroutinesVersion")}")

// rate-limiter
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ sonarQubeVersion=3.4.0.2513
mockkVersion=1.13.4
kotestVersion=5.5.5
kotestExtensionsVersion=1.1.2
awsSdkVersion=0.16.0
awsSdkVersion=1.0.13
sentryVersion=6.4.0
okHttpVersion=4.10.0
okHttpVersion=5.0.0-alpha.11
bucket4jVersion=0.2.0
kotlinCoroutinesVersion=1.6.4
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.csbroker.apiserver.repository.common

import aws.smithy.kotlin.runtime.util.push
import io.csbroker.apiserver.common.config.properties.AppProperties
import io.csbroker.apiserver.dto.common.RankListDto
import io.csbroker.apiserver.dto.user.RankResultDto
Expand Down Expand Up @@ -87,7 +86,7 @@ class RedisRepository(
val id = UUID.fromString(keys[0])
val username = keys[1]

result.push(
result.add(
RankListDto.RankDetail(
id,
username,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package io.csbroker.apiserver.service.common

import aws.sdk.kotlin.runtime.auth.credentials.StaticCredentialsProvider
import aws.sdk.kotlin.services.s3.S3Client
import aws.sdk.kotlin.services.s3.model.ObjectCannedAcl
import aws.sdk.kotlin.services.s3.model.PutObjectRequest
import aws.smithy.kotlin.runtime.content.ByteStream
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Service
Expand Down Expand Up @@ -29,11 +31,14 @@ class S3ServiceImpl(
secretAccessKey = secretKey
}
}.use {
it.putObject {
this.bucket = bucketName
this.key = s3FileName
this.body = ByteStream.fromBytes(multipartFile.bytes)
}
it.putObject(
PutObjectRequest.invoke {
bucket = bucketName
key = s3FileName
body = ByteStream.fromBytes(multipartFile.bytes)
acl = ObjectCannedAcl.PublicRead
},
)
}

return getFullPath(s3FileName)
Expand Down

0 comments on commit 67bdb76

Please sign in to comment.