4 changed files with 39 additions and 35 deletions
-
12chatto/src/main/java/org/ros/chatto/BeanConfigurations.java
-
29chatto/src/main/java/org/ros/chatto/config/DBInitializerConfig.java
-
1chatto/src/main/java/org/ros/chatto/service/ChatServiceImpl.java
-
32chatto/src/main/java/org/ros/chatto/service/DBInitializerService.java
@ -0,0 +1,29 @@ |
|||
package org.ros.chatto.config; |
|||
|
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.boot.context.properties.EnableConfigurationProperties; |
|||
import org.springframework.context.annotation.PropertySource; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import lombok.Getter; |
|||
|
|||
@Component |
|||
@EnableConfigurationProperties |
|||
@PropertySource(value = "classpath:queries.properties") |
|||
@Getter |
|||
public class DBInitializerConfig { |
|||
|
|||
private final String dbName; |
|||
|
|||
private final String numTablesQuery; |
|||
|
|||
private final String resetSessionsQuery; |
|||
|
|||
public DBInitializerConfig(@Value("${database-name}") String dbName, @Value("${num-tables}") String numTablesQuery, |
|||
@Value("${reset-sessions}") String resetSessionsQuery) { |
|||
this.dbName = dbName; |
|||
this.numTablesQuery = numTablesQuery; |
|||
this.resetSessionsQuery = resetSessionsQuery; |
|||
} |
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue