-
Notifications
You must be signed in to change notification settings - Fork 0
[Phase 2] spring analysis apis #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
backend/src/main/java/com/ssafy/salmanhae/controller/price/PriceAnalysisController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package com.ssafy.salmanhae.controller.price; | ||
|
|
||
| import com.ssafy.salmanhae.common.response.ApiResponse; | ||
| import com.ssafy.salmanhae.model.dto.property.PriceAnalysisResponse; | ||
| import com.ssafy.salmanhae.model.dto.property.PropertyType; | ||
| import com.ssafy.salmanhae.model.dto.property.TransactionType; | ||
| import com.ssafy.salmanhae.service.property.PropertyService; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RequestParam; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/v1/price-analysis") | ||
| public class PriceAnalysisController { | ||
|
|
||
| private final PropertyService propertyService; | ||
|
|
||
| public PriceAnalysisController(PropertyService propertyService) { | ||
| this.propertyService = propertyService; | ||
| } | ||
|
|
||
| @GetMapping | ||
| public ApiResponse<PriceAnalysisResponse> getPriceAnalysis( | ||
| @RequestParam String legalDongCode, | ||
| @RequestParam PropertyType propertyType, | ||
| @RequestParam TransactionType transactionType | ||
| ) { | ||
| return ApiResponse.ok(propertyService.getPriceAnalysis(legalDongCode, propertyType, transactionType)); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
backend/src/main/java/com/ssafy/salmanhae/model/dto/property/BuildingPriceStatResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.ssafy.salmanhae.model.dto.property; | ||
|
|
||
| public record BuildingPriceStatResponse( | ||
| String buildingKey, | ||
| String buildingName, | ||
| String sido, | ||
| String sigungu, | ||
| String dong, | ||
| Long avgDeposit, | ||
| Long medianDeposit, | ||
| Long avgMonthlyRent, | ||
| Long medianMonthlyRent, | ||
| Long avgPrice, | ||
| Long medianPrice, | ||
| Integer transactionCount, | ||
| String sampleFromYm, | ||
| String sampleToYm | ||
| ) { | ||
| } |
16 changes: 16 additions & 0 deletions
16
backend/src/main/java/com/ssafy/salmanhae/model/dto/property/PriceAnalysisResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package com.ssafy.salmanhae.model.dto.property; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record PriceAnalysisResponse( | ||
| String legalDongCode, | ||
| PropertyType propertyType, | ||
| TransactionType transactionType, | ||
| List<RegionPriceStatResponse> regionStats, | ||
| List<BuildingPriceStatResponse> buildingStats | ||
| ) { | ||
| public PriceAnalysisResponse { | ||
| regionStats = regionStats == null ? List.of() : List.copyOf(regionStats); | ||
| buildingStats = buildingStats == null ? List.of() : List.copyOf(buildingStats); | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
...d/src/main/java/com/ssafy/salmanhae/model/dto/property/PropertySafetySummaryResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.ssafy.salmanhae.model.dto.property; | ||
|
|
||
| public record PropertySafetySummaryResponse( | ||
| Long propertyId, | ||
| Integer radius, | ||
| Integer safetyScore, | ||
| Integer priceScore, | ||
| Integer cctvCount300m, | ||
| Integer bellCount300m, | ||
| Integer lightCount300m, | ||
| Integer policeCount500m | ||
| ) { | ||
| } |
14 changes: 14 additions & 0 deletions
14
...end/src/main/java/com/ssafy/salmanhae/model/dto/property/PropertyTransactionResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package com.ssafy.salmanhae.model.dto.property; | ||
|
|
||
| import java.math.BigDecimal; | ||
|
|
||
| public record PropertyTransactionResponse( | ||
| TransactionType transactionType, | ||
| String contractYearMonth, | ||
| Long deposit, | ||
| Long monthlyRent, | ||
| Long price, | ||
| BigDecimal areaM2, | ||
| Integer floor | ||
| ) { | ||
| } |
19 changes: 19 additions & 0 deletions
19
backend/src/main/java/com/ssafy/salmanhae/model/dto/property/RegionPriceStatResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.ssafy.salmanhae.model.dto.property; | ||
|
|
||
| public record RegionPriceStatResponse( | ||
| String regionLevel, | ||
| String regionCode, | ||
| String sido, | ||
| String sigungu, | ||
| String dong, | ||
| Long avgDeposit, | ||
| Long medianDeposit, | ||
| Long avgMonthlyRent, | ||
| Long medianMonthlyRent, | ||
| Long avgPrice, | ||
| Long medianPrice, | ||
| Integer transactionCount, | ||
| String sampleFromYm, | ||
| String sampleToYm | ||
| ) { | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.