Skip to content

Commit

Permalink
Merge pull request #13 from hanaTI-team-1/yebang-checklist
Browse files Browse the repository at this point in the history
Feat: Add address query
  • Loading branch information
Minjae-vincent authored Jul 16, 2024
2 parents 5a73794 + 996ea0b commit db44c22
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package kr.ac.kopo.jeonse.domain.jeonse.controller;

import kr.ac.kopo.jeonse.domain.jeonse.domain.Jeonse;
import kr.ac.kopo.jeonse.domain.jeonse.dto.InfraDTO;
import kr.ac.kopo.jeonse.domain.jeonse.dto.JeonseCheckList;
import kr.ac.kopo.jeonse.domain.jeonse.dto.RecommendRequest;
Expand Down Expand Up @@ -61,6 +62,11 @@ public ApiResponse<List<JeonseCheckList>> recommend(@RequestBody RecommendReques
return ApiResponse.onSuccess(jeonseService.recommendJeonse(recommendRequest));
}

@GetMapping("/address")
public ApiResponse<List<Jeonse>> getAddressList(@QueryParam("address") String address) {
return ApiResponse.onSuccess(jeonseService.getAddressList(address));
}




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ public interface JeonseMapper {
List<School> getSchools(@Param("gu") String gu);

float getPrimeRate(@Param("gu") String gu);

List<Jeonse> getJeonseList(String address);
}

Original file line number Diff line number Diff line change
Expand Up @@ -361,5 +361,9 @@ private String[] getRecommendationList(RecommendRequest recommendRequest) {

return response.getBody();
}

public List<Jeonse> getAddressList(String address) {
return jeonseMapper.getJeonseList(address);
}
}

5 changes: 5 additions & 0 deletions src/main/resources/mapper/JeonseMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
atclnm = #{aptName}
</select>

<select id="getJeonseList" resultType="kr.ac.kopo.jeonse.domain.jeonse.domain.Jeonse">
SELECT * FROM naver_real_estate
WHERE address like '%${address}%'
</select>

<select id="selectJeonseByAtclNo" resultType="kr.ac.kopo.jeonse.domain.jeonse.domain.Jeonse">
SELECT * FROM naver_real_estate
WHERE atclno = #{atclNo}
Expand Down

0 comments on commit db44c22

Please sign in to comment.