/
spirzen
/
it-code-examples
Обзор
Документация
Войти
/
spirzen
/
it-code-examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/java/java-503-101-047/main.java
47 строк
1 KB
Spirzen
Code migration pack
09 июн 2026, 01:41
09 июн 2026, 01:41
cebc284
Код
Авторство
О чём код?
@ConfigurationProperties(prefix = "app.payment") @Component public class PaymentProperties { private final Gateway gateway = new Gateway(); private final Retry retry = new Retry(); public Gateway getGateway() { return gateway; } public Retry getRetry() { return retry; } public static class Gateway { private String url; private String apiKey; private int connectTimeout = 5000; private int readTimeout = 10000; // геттеры и сеттеры } public static class Retry { private int maxAttempts = 3; private long initialBackoff = 1000; private double backoffMultiplier = 2.0; // геттеры и сеттеры } } // Использование @Service public class PaymentService { private final PaymentProperties properties; public PaymentService(PaymentProperties properties) { this.properties = properties; } public void processPayment(Payment payment) { String gatewayUrl = properties.getGateway().getUrl(); int maxRetries = properties.getRetry().getMaxAttempts(); // ... } }