Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix: 임시조치, 데일리 기록에 사진에 저장 가능하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
goldentrash committed Jan 25, 2024
1 parent 5930771 commit 2930b9a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/kotlin/gdsc/plantory/plant/service/PlantService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ class PlantService(
val findPlantInformation = plantInformationRepository.findByIdOrThrow(request.plantInformationId)
val imagePath: String = saveImageAndGetPath(image, findPlantInformation.getImageUrl)

val companionPlant = request.toEntity(imagePath, findMember.getId, findPlantInformation.getWaterCycle)
val companionPlant = request.toEntity(
imagePath,
findMember.getId,
findPlantInformation.getWaterCycle,
request.plantInformationId
)

companionPlantRepository.save(companionPlant)
}
Expand Down Expand Up @@ -86,7 +91,9 @@ class PlantService(
companionPlantRepository.findByIdAndMemberIdOrThrow(companionPlantId, findMember.getId)
val imagePath: String = saveImageAndGetPath(image, findCompanionPlant.getImageUrl)

findCompanionPlant.saveRecord(request.comment, imagePath)
// TODO : Cloud 환경으로 이전 후 제거, 로컬 사진 저장 테스트 용도
val baseUrl = "https://nongsaro.go.kr/"
findCompanionPlant.saveRecord(request.comment, baseUrl + imagePath)
findCompanionPlant.saveHistory(HistoryType.RECORDING)
}

Expand Down

0 comments on commit 2930b9a

Please sign in to comment.