Skip to content

Commit

Permalink
fix: 투표 기능 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongh00 committed Feb 3, 2024
1 parent faa820b commit 5dd0171
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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) {
Expand Down

0 comments on commit 5dd0171

Please sign in to comment.