A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.0 KiB

4 years ago
  1. package org.ros.chatto.config;
  2. import org.springframework.beans.factory.annotation.Value;
  3. import org.springframework.boot.context.properties.EnableConfigurationProperties;
  4. import org.springframework.context.annotation.PropertySource;
  5. import org.springframework.stereotype.Component;
  6. import lombok.Getter;
  7. @Component
  8. @EnableConfigurationProperties
  9. @PropertySource(value = "classpath:queries.properties")
  10. @Getter
  11. public class DBInitializerConfig {
  12. private final String dbName;
  13. private final String numTablesQuery;
  14. private final String resetSessionsQuery;
  15. private final String clearTokensQuery;
  16. public DBInitializerConfig(@Value("${chatto.datasource.database-name}") String dbName,
  17. @Value("${num-tables}") String numTablesQuery, @Value("${reset-sessions}") String resetSessionsQuery,
  18. @Value("${clear-tokens}") String clearTokensQuery) {
  19. this.dbName = dbName;
  20. this.numTablesQuery = numTablesQuery;
  21. this.resetSessionsQuery = resetSessionsQuery;
  22. this.clearTokensQuery = clearTokensQuery;
  23. }
  24. }