diff --git a/.gradle/8.5/executionHistory/executionHistory.bin b/.gradle/8.5/executionHistory/executionHistory.bin index 58e17c6..a7e6b59 100644 Binary files a/.gradle/8.5/executionHistory/executionHistory.bin and b/.gradle/8.5/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.5/executionHistory/executionHistory.lock b/.gradle/8.5/executionHistory/executionHistory.lock index 0efd42a..62ddec3 100644 Binary files a/.gradle/8.5/executionHistory/executionHistory.lock and b/.gradle/8.5/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.5/fileHashes/fileHashes.bin b/.gradle/8.5/fileHashes/fileHashes.bin index 2dea6d7..5f42473 100644 Binary files a/.gradle/8.5/fileHashes/fileHashes.bin and b/.gradle/8.5/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.5/fileHashes/fileHashes.lock b/.gradle/8.5/fileHashes/fileHashes.lock index 8926106..ba13b5a 100644 Binary files a/.gradle/8.5/fileHashes/fileHashes.lock and b/.gradle/8.5/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.5/fileHashes/resourceHashesCache.bin b/.gradle/8.5/fileHashes/resourceHashesCache.bin index f0d3d94..493ba22 100644 Binary files a/.gradle/8.5/fileHashes/resourceHashesCache.bin and b/.gradle/8.5/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 9eac842..8eadd44 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/build/classes/java/main/com/samsung/samsung/domain/apartment/controller/ApartmentController.class b/build/classes/java/main/com/samsung/samsung/domain/apartment/controller/ApartmentController.class index 628833d..1be52f2 100644 Binary files a/build/classes/java/main/com/samsung/samsung/domain/apartment/controller/ApartmentController.class and b/build/classes/java/main/com/samsung/samsung/domain/apartment/controller/ApartmentController.class differ diff --git a/build/classes/java/main/com/samsung/samsung/domain/apartment/service/ApartmentService.class b/build/classes/java/main/com/samsung/samsung/domain/apartment/service/ApartmentService.class index 73ad809..78c73ae 100644 Binary files a/build/classes/java/main/com/samsung/samsung/domain/apartment/service/ApartmentService.class and b/build/classes/java/main/com/samsung/samsung/domain/apartment/service/ApartmentService.class differ diff --git a/build/classes/java/main/com/samsung/samsung/domain/product/controller/ProductController.class b/build/classes/java/main/com/samsung/samsung/domain/product/controller/ProductController.class index 4ff807c..ffb923e 100644 Binary files a/build/classes/java/main/com/samsung/samsung/domain/product/controller/ProductController.class and b/build/classes/java/main/com/samsung/samsung/domain/product/controller/ProductController.class differ diff --git a/build/classes/java/main/com/samsung/samsung/domain/product/dto/ProductDto$Request.class b/build/classes/java/main/com/samsung/samsung/domain/product/dto/ProductDto$Request.class index 981a508..872ae11 100644 Binary files a/build/classes/java/main/com/samsung/samsung/domain/product/dto/ProductDto$Request.class and b/build/classes/java/main/com/samsung/samsung/domain/product/dto/ProductDto$Request.class differ diff --git a/build/classes/java/main/com/samsung/samsung/domain/product/dto/ProductDto$Response.class b/build/classes/java/main/com/samsung/samsung/domain/product/dto/ProductDto$Response.class index ec24dba..b562753 100644 Binary files a/build/classes/java/main/com/samsung/samsung/domain/product/dto/ProductDto$Response.class and b/build/classes/java/main/com/samsung/samsung/domain/product/dto/ProductDto$Response.class differ diff --git a/build/classes/java/main/com/samsung/samsung/domain/product/entity/Product$ProductBuilder.class b/build/classes/java/main/com/samsung/samsung/domain/product/entity/Product$ProductBuilder.class index 47fd838..8afd390 100644 Binary files a/build/classes/java/main/com/samsung/samsung/domain/product/entity/Product$ProductBuilder.class and b/build/classes/java/main/com/samsung/samsung/domain/product/entity/Product$ProductBuilder.class differ diff --git a/build/classes/java/main/com/samsung/samsung/domain/product/entity/Product.class b/build/classes/java/main/com/samsung/samsung/domain/product/entity/Product.class index 779218a..8931f53 100644 Binary files a/build/classes/java/main/com/samsung/samsung/domain/product/entity/Product.class and b/build/classes/java/main/com/samsung/samsung/domain/product/entity/Product.class differ diff --git a/build/classes/java/main/com/samsung/samsung/domain/product/repository/ProductRepository.class b/build/classes/java/main/com/samsung/samsung/domain/product/repository/ProductRepository.class index 41a9f98..f71e117 100644 Binary files a/build/classes/java/main/com/samsung/samsung/domain/product/repository/ProductRepository.class and b/build/classes/java/main/com/samsung/samsung/domain/product/repository/ProductRepository.class differ diff --git a/build/classes/java/main/com/samsung/samsung/domain/product/service/ProductService.class b/build/classes/java/main/com/samsung/samsung/domain/product/service/ProductService.class index a8e3b10..15ff549 100644 Binary files a/build/classes/java/main/com/samsung/samsung/domain/product/service/ProductService.class and b/build/classes/java/main/com/samsung/samsung/domain/product/service/ProductService.class differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/ApartmentController.class.uniqueId1 b/build/tmp/compileJava/compileTransaction/stash-dir/ApartmentController.class.uniqueId1 new file mode 100644 index 0000000..1be52f2 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/ApartmentController.class.uniqueId1 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/ApartmentService.class.uniqueId0 b/build/tmp/compileJava/compileTransaction/stash-dir/ApartmentService.class.uniqueId0 new file mode 100644 index 0000000..c54f0d9 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/ApartmentService.class.uniqueId0 differ diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin index c29f0f0..188f3bf 100644 Binary files a/build/tmp/compileJava/previous-compilation-data.bin and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/src/main/java/com/samsung/samsung/domain/apartment/controller/ApartmentController.java b/src/main/java/com/samsung/samsung/domain/apartment/controller/ApartmentController.java index bdaaade..7052ce5 100644 --- a/src/main/java/com/samsung/samsung/domain/apartment/controller/ApartmentController.java +++ b/src/main/java/com/samsung/samsung/domain/apartment/controller/ApartmentController.java @@ -24,7 +24,7 @@ public BaseResponse> getProductList(){ return BaseResponse.onSuccess(apartmentList); } @GetMapping("/{apartment-Id}/{goal-Year}") - public BaseResponse getMyHomeResult(@PathVariable("apartment-Id") Long id , @PathVariable("goal-Year") int goalYear){ + public BaseResponse getMyHomeResult(@PathVariable("apartment-Id") Long id , @PathVariable("goal-Year") int goalYear){ return BaseResponse.onSuccess(apartmentService.findByHome(id , goalYear)); } //TODO diff --git a/src/main/java/com/samsung/samsung/domain/apartment/service/ApartmentService.java b/src/main/java/com/samsung/samsung/domain/apartment/service/ApartmentService.java index 76afa34..3071215 100644 --- a/src/main/java/com/samsung/samsung/domain/apartment/service/ApartmentService.java +++ b/src/main/java/com/samsung/samsung/domain/apartment/service/ApartmentService.java @@ -22,11 +22,14 @@ public List findByAll() { .map(ApartmentDto.Response::new) .collect(Collectors.toList()); } - public Long findByHome(Long id, int goalYear){ + public static double calculateExpression(double a, double b, double n) { + return Math.pow(a / b, 1.0 / n) - 1; + } + public Double findByHome(Long id, int goalYear){ //(현재 집 시세 - 현재 자산) / (수익 - 필수 소비 금액) Apartment apartment = apartmentRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("해당 아파트가 존재하지 않습니다.")); long apartmentPrice = Long.parseLong(apartment.getPrice()); - long result = (apartmentPrice - 200000000) / (400 - 80); - return result/goalYear; + + return calculateExpression(apartmentPrice,15000000,goalYear) * 100; } }