dev add logs for search
Test Workflow / test (push) Successful in 3s

This commit is contained in:
vladp
2026-02-16 10:13:42 +07:00
parent 1e14fa3f23
commit 814d137937
2 changed files with 19 additions and 2 deletions
@@ -22,7 +22,7 @@ public class DaDataService {
private String apiKey ;
@Value("${dadata.url}")
private String url ;
private String dadataUrl;
private final OkHttpClient httpClient;
@@ -44,7 +44,7 @@ public class DaDataService {
String jsonBody = String.format("{\"query\": \"%s\"}", inn);
Request request = new Request.Builder()
.url("https://suggestions.dadata.ru/suggestions/api/4_1/rs/findById/party")
.url(dadataUrl)
.post(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), jsonBody))
.header("Accept", "application/json")
.header("Authorization", "Token " + apiKey)
@@ -52,6 +52,7 @@ public class DaDataService {
try (Response response = httpClient.newCall(request).execute()) {
ResponseBody body = response.body();
if (body == null) {
throw new IOException("Empty response body");
}