dev check violation for lawcase,complaint
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-05-19 13:08:55 +07:00
parent 82e84514e4
commit 20911982a6
@@ -176,10 +176,20 @@ public class ViolationHandler implements RequestHandler {
for (Violation violation : content) {
if (firstShowViolation != null && Objects.equals(firstShowViolation.getId(), violation.getId())) continue;
String country;
String countryCode;
ViolationResponse.ViolationDto violationDto = ViolationResponse.ViolationDto.fromEntity(violation);
violationDto.setCountry(geoCountryService.getCountryName(violation.getPageUrl()));
violationDto.setCountryCode(geoCountryService.getCountryCode(violation.getPageUrl()));
try {
country = geoCountryService.getCountryName(violation.getHost());
countryCode = geoCountryService.getCountryCode(violation.getHost());
} catch (Exception e) {
country = geoCountryService.getCountryName(violation.getUrl());
countryCode = geoCountryService.getCountryCode(violation.getUrl());
}
violationDto.setCountry(country);
violationDto.setCountryCode(countryCode);
violationDtos.add(violationDto);
}