diff --git a/car_manager/pom.xml b/car_manager/pom.xml index f1020ab1d3d8bf29dc6eaa7e5b4aabea12a15dfa..e813e21ed68232509f11479ab3ed1d04547d5b83 100644 --- a/car_manager/pom.xml +++ b/car_manager/pom.xml @@ -17,25 +17,22 @@ <artifactId>jakarta.validation-api</artifactId> <version>3.0.2</version> </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>common</artifactId> - <version>${project.version}</version> - </dependency> <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.0.4</version> </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-data-jpa</artifactId> - </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.13.3</version> </dependency> + <dependency> + <groupId>fi.muni</groupId> + <artifactId>common</artifactId> + <version>0.0.1-SNAPSHOT</version> + <scope>compile</scope> + </dependency> </dependencies> <properties> <maven.compiler.source>17</maven.compiler.source> diff --git a/car_manager/src/main/java/cz/muni/pa165/carmanager/App.java b/car_manager/src/main/java/cz/muni/pa165/carmanager/App.java index 1d329ff97805af53d91c8f3b36093b0655eda17d..d9d79f57fbb1fc3b4d5a97313327d7e1cc26f4fe 100644 --- a/car_manager/src/main/java/cz/muni/pa165/carmanager/App.java +++ b/car_manager/src/main/java/cz/muni/pa165/carmanager/App.java @@ -2,12 +2,11 @@ package cz.muni.pa165.carmanager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; /** * Main app. */ -@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }) +@SpringBootApplication public class App { public static void main(String[] args) { diff --git a/car_manager/src/main/java/cz/muni/pa165/carmanager/Config.java b/car_manager/src/main/java/cz/muni/pa165/carmanager/AppConfig.java similarity index 92% rename from car_manager/src/main/java/cz/muni/pa165/carmanager/Config.java rename to car_manager/src/main/java/cz/muni/pa165/carmanager/AppConfig.java index 2fb051349249fa53117219053dff781558cd2c8d..53a79f296b4bc39874bbc4be04be1d63c8ea71b5 100644 --- a/car_manager/src/main/java/cz/muni/pa165/carmanager/Config.java +++ b/car_manager/src/main/java/cz/muni/pa165/carmanager/AppConfig.java @@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration; * App configuration. */ @Configuration -public class Config { +public class AppConfig { @Bean public ObjectMapper objectMapper() { diff --git a/car_manager/src/main/java/cz/muni/pa165/carmanager/data/repository/ConfigRepository.java b/car_manager/src/main/java/cz/muni/pa165/carmanager/data/repository/ConfigRepository.java index 2af4531bbaafe7fe65876d6ca228278767b0e455..df2c9ea1443035e695f3c9e001f88c79857e7d2b 100644 --- a/car_manager/src/main/java/cz/muni/pa165/carmanager/data/repository/ConfigRepository.java +++ b/car_manager/src/main/java/cz/muni/pa165/carmanager/data/repository/ConfigRepository.java @@ -2,7 +2,6 @@ package cz.muni.pa165.carmanager.data.repository; import cz.muni.pa165.common.racecomponents.Config; import java.util.Optional; -import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; /** @@ -12,12 +11,10 @@ import org.springframework.stereotype.Repository; public class ConfigRepository { // TODO doplnit v dalsom milestone - @Query("") public Optional<Config> updateConfig(Config config) { return Optional.of(config); } - @Query("") public Optional<Config> createConfig(Config config) { return Optional.of(config); } diff --git a/car_manager/src/main/java/cz/muni/pa165/carmanager/facade/CarManagerFacade.java b/car_manager/src/main/java/cz/muni/pa165/carmanager/facade/CarManagerFacade.java index 40f12eef899dcf9de7a2a0e41a9b516a89d9079e..e192eeb32bd92c6256306d18630ae694033cc0fe 100644 --- a/car_manager/src/main/java/cz/muni/pa165/carmanager/facade/CarManagerFacade.java +++ b/car_manager/src/main/java/cz/muni/pa165/carmanager/facade/CarManagerFacade.java @@ -3,13 +3,11 @@ package cz.muni.pa165.carmanager.facade; import cz.muni.pa165.carmanager.service.CarManagerService; import cz.muni.pa165.common.racecomponents.Config; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; /** * Facade for car managing. */ @Service -@Transactional public class CarManagerFacade { CarManagerService carManagerService; @@ -18,12 +16,10 @@ public class CarManagerFacade { this.carManagerService = carManagerService; } - @Transactional public Config createConfig(Config config) { return carManagerService.createConfig(config); } - @Transactional public Config updateConfig(Config config) { return carManagerService.updateConfig(config); } diff --git a/car_manager/src/main/java/cz/muni/pa165/carmanager/service/CarManagerService.java b/car_manager/src/main/java/cz/muni/pa165/carmanager/service/CarManagerService.java index 88820558de5a993a619e46dabf199bf74b9f5bb3..50e388bb023187a7a0678c9bf6c1da7c4f6f9cf6 100644 --- a/car_manager/src/main/java/cz/muni/pa165/carmanager/service/CarManagerService.java +++ b/car_manager/src/main/java/cz/muni/pa165/carmanager/service/CarManagerService.java @@ -3,7 +3,6 @@ package cz.muni.pa165.carmanager.service; import cz.muni.pa165.carmanager.data.repository.ConfigRepository; import cz.muni.pa165.common.racecomponents.Config; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; /** * Service for managing cars. @@ -23,7 +22,6 @@ public class CarManagerService { * @param config config to update. * @return Updated config. */ - @Transactional public Config updateConfig(Config config) { return configRepository.updateConfig(config) .orElseThrow(() -> new ResourceNotFoundException( diff --git a/pom.xml b/pom.xml index d0ce5744b6d3b27c3ddb5637656a2918fb86b7b2..1457cbecf0cd47fb7404991189738c93276dbb23 100644 --- a/pom.xml +++ b/pom.xml @@ -39,10 +39,6 @@ <build> <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> diff --git a/src/main/java/fi/muni/pa165formulaoneteam/Pa165FormulaOneTeamApplication.java b/src/main/java/fi/muni/pa165formulaoneteam/Pa165FormulaOneTeamApplication.java deleted file mode 100644 index 5d73a5854d83b4a13762daa213781bd651af42a5..0000000000000000000000000000000000000000 --- a/src/main/java/fi/muni/pa165formulaoneteam/Pa165FormulaOneTeamApplication.java +++ /dev/null @@ -1,16 +0,0 @@ -package fi.muni.pa165formulaoneteam; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Main application. - */ -@SpringBootApplication -public class Pa165FormulaOneTeamApplication { - - public static void main(String[] args) { - SpringApplication.run(Pa165FormulaOneTeamApplication.class, args); - } - -} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/test/java/fi/muni/pa165formulaoneteam/Pa165FormulaOneTeamApplicationTests.java b/src/test/java/fi/muni/pa165formulaoneteam/Pa165FormulaOneTeamApplicationTests.java deleted file mode 100644 index 114210dc95d20477a86eba1a7710866c6481d23b..0000000000000000000000000000000000000000 --- a/src/test/java/fi/muni/pa165formulaoneteam/Pa165FormulaOneTeamApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package fi.muni.pa165formulaoneteam; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class Pa165FormulaOneTeamApplicationTests { - - @Test - void contextLoads() { - } - -}