Skip to content

Commit

Permalink
chore: ktlint 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
sejineer committed May 27, 2024
1 parent 6b397a5 commit 3643707
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package org.mediscan.core.api.controller.v1;
package org.mediscan.core.api.controller.v1

import org.mediscan.core.api.controller.v1.request.PillIdentificationRequestDto
import org.mediscan.core.api.controller.v1.request.PillSearchRequestDto
import org.mediscan.core.api.controller.v1.response.PillIdentificationResponseDto
import org.mediscan.core.api.controller.v1.response.PillSearchResponseDto
import org.mediscan.core.api.domain.PillService
import org.mediscan.core.api.support.response.ApiResponse
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestController

@RestController
class PillIController(
private var pillService: PillService
private var pillService: PillService,
) {
@PostMapping("/pill")
fun identifyPill(@RequestBody request: PillIdentificationRequestDto): ApiResponse<List<PillIdentificationResponseDto>> {
Expand All @@ -21,13 +19,13 @@ class PillIController(
request.backImage,
request.pillShape,
request.frontMarking,
request.backMarking
request.backMarking,
)

val responseDtos = results.map { result ->
PillIdentificationResponseDto(
drugCode = result.drugCode,
confidence = result.confidence
confidence = result.confidence,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ class PillSearchRequestDto(
val pillShape: String,
val frontMarking: String,
val backMarking: String,
val color: String
) {
}
val color: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ data class Pill(
val markCodeFront: String,
val markCodeBack: String,
val ediCode: String,
val bizrno: String
val bizrno: String,
)
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
package org.mediscan.core.api.domain;
package org.mediscan.core.api.domain

import org.mediscan.client.example.PillIdentificationService
import org.mediscan.core.api.controller.v1.request.PillDomainIdentificationRequestDto
import org.mediscan.core.api.controller.v1.response.PillDomainIdentificationResponseDto
import org.springframework.stereotype.Component


@Component
class PillManager(
private val pillIdentificationService: PillIdentificationService
private val pillIdentificationService: PillIdentificationService,
) {
fun identifyPill(request: PillDomainIdentificationRequestDto): List<PillDomainIdentificationResponseDto> {
val results = pillIdentificationService.identifyPill(
request.frontImage,
request.backImage,
request.pillShape,
request.frontMarking,
request.backMarking
request.backMarking,
)

return results.map { responseDto ->
PillDomainIdentificationResponseDto(
drugCode = responseDto.drugCode,
confidence = responseDto.confidence
confidence = responseDto.confidence,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ class PillReader {
// fun readPill(pillShape: String, frontMarking: String, backMarking: String, color: String): Pill {
//
// }
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package org.mediscan.core.api.domain

interface PillRepository {
}
interface PillRepository

0 comments on commit 3643707

Please sign in to comment.