|
|
@ -14,7 +14,9 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
import space.kklochko.spring_rest_example.db.factories.EntityManagerConnection;
|
|
|
|
import space.kklochko.spring_rest_example.db.factories.EntityManagerConnection;
|
|
|
|
import space.kklochko.spring_rest_example.db.repositories.IndicatorRepository;
|
|
|
|
import space.kklochko.spring_rest_example.db.repositories.IndicatorRepository;
|
|
|
|
import space.kklochko.spring_rest_example.models.Indicator;
|
|
|
|
import space.kklochko.spring_rest_example.models.factories.TokenFactory;
|
|
|
|
|
|
|
|
import space.kklochko.spring_rest_example.security.tokens.SimpleRandomToken;
|
|
|
|
|
|
|
|
import space.kklochko.spring_rest_example.security.tokens.StringTokenFactory;
|
|
|
|
|
|
|
|
|
|
|
|
@EnableWebMvc
|
|
|
|
@EnableWebMvc
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
@ -34,4 +36,10 @@ public class WebConfig implements WebMvcConfigurer {
|
|
|
|
public IndicatorRepository indicatorRepository(EntityManager manager) {
|
|
|
|
public IndicatorRepository indicatorRepository(EntityManager manager) {
|
|
|
|
return new IndicatorRepository(manager);
|
|
|
|
return new IndicatorRepository(manager);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
|
|
|
public TokenFactory tokenFactory() {
|
|
|
|
|
|
|
|
StringTokenFactory stringTokenFactory = new SimpleRandomToken();
|
|
|
|
|
|
|
|
return new TokenFactory(stringTokenFactory);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|