From f791b51efd22421dbc2cfc02b39b2c684529f9f6 Mon Sep 17 00:00:00 2001 From: Yevhen Vasyliev Date: Wed, 8 Nov 2023 20:55:42 +0200 Subject: [PATCH] renamed env variables --- src/main/java/com/github/yvasyliev/Application.java | 5 ----- .../yvasyliev/service/reddit/SubredditNewSupplier.java | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/github/yvasyliev/Application.java b/src/main/java/com/github/yvasyliev/Application.java index b22c4aa..25a5c23 100644 --- a/src/main/java/com/github/yvasyliev/Application.java +++ b/src/main/java/com/github/yvasyliev/Application.java @@ -70,11 +70,6 @@ public Module module(JsonDeserializer postJsonDeserializer) { return module; } - @Bean - public String userAgent(@Value("${REDDIT_USERNAME}") String redditUsername) { - return "java:reddit-telegram-repeater:2.0.0 (by /u/%s)".formatted(redditUsername); - } - @Bean public HttpClient httpClient() { return HttpClient.newHttpClient(); diff --git a/src/main/java/com/github/yvasyliev/service/reddit/SubredditNewSupplier.java b/src/main/java/com/github/yvasyliev/service/reddit/SubredditNewSupplier.java index c20f396..c2f4480 100644 --- a/src/main/java/com/github/yvasyliev/service/reddit/SubredditNewSupplier.java +++ b/src/main/java/com/github/yvasyliev/service/reddit/SubredditNewSupplier.java @@ -16,10 +16,10 @@ @Service public class SubredditNewSupplier implements ThrowingSupplier { - @Value("${SUBREDDIT}") + @Value("${reddit.subreddit}") private String subreddit; - @Autowired + @Value("java:${project.artifactId}:${project.version} (by /u/${reddit.username})") private String userAgent; @Autowired