Skip to content

Commit

Permalink
cleaned up kotlin files
Browse files Browse the repository at this point in the history
  • Loading branch information
scmacdon authored and Laren-AWS committed Jun 18, 2024
1 parent e571365 commit 189af48
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class APIGatewayTest {

@Test
@Order(4)
fun DeleteRestApi() = runBlocking {
fun deleteRestApi() = runBlocking {
deleteAPI(newApiId)
println("Test 6 passed")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.springframework.stereotype.Component
@Component
class AnalyzePhotos {

suspend fun DetectLabels(bytesVal: ByteArray?, key: String?): MutableList<WorkItem>? {
suspend fun detectLabels(bytesVal: ByteArray?, key: String?): MutableList<WorkItem>? {
// Create an Image object for the source image.
val souImage = Image {
bytes = bytesVal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class MessageResource {
@RequestMapping(value = ["/getimages"], method = [RequestMethod.GET])
@ResponseBody
fun getImages(request: HttpServletRequest?, response: HttpServletResponse?): String? = runBlocking {
return@runBlocking s3Service?.ListAllObjects(bucketName)
return@runBlocking s3Service?.listAllObjects(bucketName)
}

// Generates a report that analyzes photos in a given bucket.
Expand All @@ -72,7 +72,7 @@ class MessageResource {
val keyData = s3Service?.getObjectBytes(bucketName, key)

// Analyze the photo.
val item = recService?.DetectLabels(keyData, key)
val item = recService?.detectLabels(keyData, key)
if (item != null) {
myList.add(item)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class S3Service {
}

// Returns the names of all images and data within an XML document.
suspend fun ListAllObjects(bucketName: String?): String? {
suspend fun listAllObjects(bucketName: String?): String? {
var sizeLg: Long
var dateIn: aws.smithy.kotlin.runtime.time.Instant?
val bucketItems = mutableListOf<BucketItem>()
Expand All @@ -59,7 +59,7 @@ class S3Service {
val myItem = BucketItem()
myItem.key = myObject.key
myItem.owner = myObject.owner?.displayName.toString()
sizeLg = (myObject.size / 1024)
sizeLg = (myObject.size?.div(1024)!!)
myItem.size = (sizeLg.toString())
dateIn = myObject.lastModified
myItem.date = dateIn.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ class QueuePayload {

// Getter and Setter methods for arguments
fun getArguments(): HashMap<String?, String?>? = arguments

}

0 comments on commit 189af48

Please sign in to comment.