mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
merge properties service into configuration
This commit is contained in:
@@ -4,6 +4,7 @@ import io.dropwizard.Configuration;
|
||||
import io.dropwizard.db.DataSourceFactory;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Min;
|
||||
@@ -23,6 +24,12 @@ public class CommaFeedConfiguration extends Configuration {
|
||||
NOOP, REDIS
|
||||
}
|
||||
|
||||
private ResourceBundle bundle;
|
||||
|
||||
public CommaFeedConfiguration() {
|
||||
bundle = ResourceBundle.getBundle("application");
|
||||
}
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@JsonProperty("database")
|
||||
@@ -33,6 +40,14 @@ public class CommaFeedConfiguration extends Configuration {
|
||||
@JsonProperty("app")
|
||||
private ApplicationSettings applicationSettings;
|
||||
|
||||
public String getVersion() {
|
||||
return bundle.getString("version");
|
||||
}
|
||||
|
||||
public String getGitCommit() {
|
||||
return bundle.getString("git.commit");
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class ApplicationSettings {
|
||||
@JsonProperty
|
||||
|
||||
Reference in New Issue
Block a user