From 5dd0171df603d31090a6a3b1315869714c355e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=95=88=EC=A0=95=ED=9B=84?= Date: Sat, 3 Feb 2024 21:17:28 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=88=AC=ED=91=9C=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../law/application/service/LawQueryUseCase.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/core-module/src/main/java/com/congress/coremodule/law/application/service/LawQueryUseCase.java b/core-module/src/main/java/com/congress/coremodule/law/application/service/LawQueryUseCase.java index 80bad04..04c278c 100644 --- a/core-module/src/main/java/com/congress/coremodule/law/application/service/LawQueryUseCase.java +++ b/core-module/src/main/java/com/congress/coremodule/law/application/service/LawQueryUseCase.java @@ -30,7 +30,8 @@ public class LawQueryUseCase { private final VoteQueryService voteQueryService; public LawVoteResult getVoteResult(LawVoteReq req) { - String apiUrl = "https://open.assembly.go.kr/portal/openapi/nwbpacrgavhjryiph?KEY=86f396b109764bb6bd688b181875d6ce&Type=json&pIndex=1&pSize=100&AGE=21"; + String apiUrl = "https://open.assembly.go.kr/portal/openapi/nwbpacrgavhjryiph?KEY=86f396b109764bb6bd688b181875d6ce&Type=json&pIndex=1&pSize=100&AGE=21" + + "&BILL_NM=" + req.getLawName(); LawVoteResult result = new LawVoteResult(); RestTemplate restTemplate = new RestTemplate(); @@ -44,16 +45,13 @@ public LawVoteResult getVoteResult(LawVoteReq req) { for (JsonNode dataNode : dataArray) { - if (req.getLawName().equals(dataNode.get("BILL_NM").asText())) { + String billName = dataNode.get("BILL_NM").asText(); + String yesCount = dataNode.get("YES_TCNT").asText(); - String billName = dataNode.get("BILL_NM").asText(); - String yesCount = dataNode.get("YES_TCNT").asText(); - - result.setBillNm(billName); - result.setYesCount(yesCount); + result.setBillNm(billName); + result.setYesCount(yesCount); - return result; - } + return result; } } catch (IOException e) {