diff --git a/car/src/main/java/cz/muni/pa165/car/api/CarComponentDto.java b/car/src/main/java/cz/muni/pa165/car/api/CarComponentDto.java deleted file mode 100644 index f24bb966eb1c83c9384a5ebef8d1dbbc97aa91a0..0000000000000000000000000000000000000000 --- a/car/src/main/java/cz/muni/pa165/car/api/CarComponentDto.java +++ /dev/null @@ -1,29 +0,0 @@ -package cz.muni.pa165.car.api; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Data Transfer object for CarComponent class. - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class CarComponentDto { - - @NotNull - @Schema(description = "component id", - example = "1") - Long id; - - @NotNull - @Schema(description = "component name", - example = "Default engine") - String name; - -} diff --git a/car/src/main/java/cz/muni/pa165/car/rest/CarComponentPairController.java b/car/src/main/java/cz/muni/pa165/car/rest/CarComponentPairController.java index 1ef67e4bc66f882d50031118192c1cf075d28ddd..0caf08720e5457ea0f43f9f969cb164da09f59fc 100644 --- a/car/src/main/java/cz/muni/pa165/car/rest/CarComponentPairController.java +++ b/car/src/main/java/cz/muni/pa165/car/rest/CarComponentPairController.java @@ -1,7 +1,7 @@ package cz.muni.pa165.car.rest; -import cz.muni.pa165.car.api.CarComponentDto; -import cz.muni.pa165.car.api.CarDto; +import cz.muni.pa165.common_library.dtos.CarComponentDto; +import cz.muni.pa165.common_library.dtos.CarDto; import cz.muni.pa165.car.service.CarComponentPairService; import io.swagger.v3.oas.annotations.Operation; import java.util.List; diff --git a/car/src/main/java/cz/muni/pa165/car/rest/CarController.java b/car/src/main/java/cz/muni/pa165/car/rest/CarController.java index e3d2b3e7be2651b074ea11f081c8643c7a48ff66..b131db11fde301622050a0ea47ef19df90757c68 100644 --- a/car/src/main/java/cz/muni/pa165/car/rest/CarController.java +++ b/car/src/main/java/cz/muni/pa165/car/rest/CarController.java @@ -1,6 +1,6 @@ package cz.muni.pa165.car.rest; -import cz.muni.pa165.car.api.CarDto; +import cz.muni.pa165.common_library.dtos.CarDto; import cz.muni.pa165.car.service.CarService; import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; diff --git a/car/src/main/java/cz/muni/pa165/car/rest/CarDriverPairController.java b/car/src/main/java/cz/muni/pa165/car/rest/CarDriverPairController.java index 2c32e1bdc668362eda837ecd12452f0dc0fc0c1f..3d2cd3d8d6abac08b1192b766bf1e03c38884e03 100644 --- a/car/src/main/java/cz/muni/pa165/car/rest/CarDriverPairController.java +++ b/car/src/main/java/cz/muni/pa165/car/rest/CarDriverPairController.java @@ -1,7 +1,7 @@ package cz.muni.pa165.car.rest; -import cz.muni.pa165.car.api.CarDto; -import cz.muni.pa165.car.api.DriverDto; +import cz.muni.pa165.common_library.dtos.CarDto; +import cz.muni.pa165.common_library.dtos.DriverDto; import cz.muni.pa165.car.service.CarDriverPairService; import io.swagger.v3.oas.annotations.Operation; import java.util.List; diff --git a/car/src/main/java/cz/muni/pa165/car/service/CarComponentPairService.java b/car/src/main/java/cz/muni/pa165/car/service/CarComponentPairService.java index 28b96cc5638d5cd0037e9e755158d390a13570dc..5bd94c3db8f658b9be98321a7d7efb5f2a5a3750 100644 --- a/car/src/main/java/cz/muni/pa165/car/service/CarComponentPairService.java +++ b/car/src/main/java/cz/muni/pa165/car/service/CarComponentPairService.java @@ -1,7 +1,7 @@ package cz.muni.pa165.car.service; -import cz.muni.pa165.car.api.CarComponentDto; -import cz.muni.pa165.car.api.CarDto; +import cz.muni.pa165.common_library.dtos.CarComponentDto; +import cz.muni.pa165.common_library.dtos.CarDto; import java.util.List; /** diff --git a/car/src/main/java/cz/muni/pa165/car/service/CarComponentPairServiceImpl.java b/car/src/main/java/cz/muni/pa165/car/service/CarComponentPairServiceImpl.java index 5af15453c1e4c8fc3e18cb85c816b0387cc0f965..b82bae6e64147e3b18e2d28787869cef1c3c1613 100644 --- a/car/src/main/java/cz/muni/pa165/car/service/CarComponentPairServiceImpl.java +++ b/car/src/main/java/cz/muni/pa165/car/service/CarComponentPairServiceImpl.java @@ -1,7 +1,7 @@ package cz.muni.pa165.car.service; -import cz.muni.pa165.car.api.CarComponentDto; -import cz.muni.pa165.car.api.CarDto; +import cz.muni.pa165.common_library.dtos.CarComponentDto; +import cz.muni.pa165.common_library.dtos.CarDto; import cz.muni.pa165.car.data.repository.CarComponentPairRepository; import cz.muni.pa165.car.data.repository.CarComponentRepository; import cz.muni.pa165.car.data.repository.CarRepository; @@ -74,6 +74,9 @@ public class CarComponentPairServiceImpl implements CarComponentPairService { componentDtos.add( new CarComponentDto( c.getId(), + c.getWeight(), + c.getPrice(), + c.getManufacturer(), c.getName() ) ); diff --git a/car/src/main/java/cz/muni/pa165/car/service/CarDriverPairService.java b/car/src/main/java/cz/muni/pa165/car/service/CarDriverPairService.java index 6136d5730cb70d0ab8d81e0f8b36f146af684804..edc598223d253a83c62269fa2b3a04ead082ab46 100644 --- a/car/src/main/java/cz/muni/pa165/car/service/CarDriverPairService.java +++ b/car/src/main/java/cz/muni/pa165/car/service/CarDriverPairService.java @@ -1,7 +1,7 @@ package cz.muni.pa165.car.service; -import cz.muni.pa165.car.api.CarDto; -import cz.muni.pa165.car.api.DriverDto; +import cz.muni.pa165.common_library.dtos.CarDto; +import cz.muni.pa165.common_library.dtos.DriverDto; import java.util.List; /** diff --git a/car/src/main/java/cz/muni/pa165/car/service/CarDriverPairServiceImpl.java b/car/src/main/java/cz/muni/pa165/car/service/CarDriverPairServiceImpl.java index 2898d7ac3c0324d8a13a0aeea722abee582988dc..98af28eb1277942022c0cc6d301a12e3ffe6c78b 100644 --- a/car/src/main/java/cz/muni/pa165/car/service/CarDriverPairServiceImpl.java +++ b/car/src/main/java/cz/muni/pa165/car/service/CarDriverPairServiceImpl.java @@ -1,7 +1,7 @@ package cz.muni.pa165.car.service; -import cz.muni.pa165.car.api.CarDto; -import cz.muni.pa165.car.api.DriverDto; +import cz.muni.pa165.common_library.dtos.CarDto; +import cz.muni.pa165.common_library.dtos.DriverDto; import cz.muni.pa165.car.data.repository.CarDriverPairRepository; import cz.muni.pa165.car.data.repository.CarRepository; import cz.muni.pa165.car.data.repository.DriverRepository; diff --git a/car/src/main/java/cz/muni/pa165/car/service/CarService.java b/car/src/main/java/cz/muni/pa165/car/service/CarService.java index 688ba89ede0c51df6e7d1ad75ed08260fe457c28..7fe1dbf0aed56f0e32d8d667c36727b59721fc4f 100644 --- a/car/src/main/java/cz/muni/pa165/car/service/CarService.java +++ b/car/src/main/java/cz/muni/pa165/car/service/CarService.java @@ -1,6 +1,6 @@ package cz.muni.pa165.car.service; -import cz.muni.pa165.car.api.CarDto; +import cz.muni.pa165.common_library.dtos.CarDto; import java.util.List; /** diff --git a/car/src/main/java/cz/muni/pa165/car/service/CarServiceImpl.java b/car/src/main/java/cz/muni/pa165/car/service/CarServiceImpl.java index ac13999962403428d9e411ef6394530544773e02..0033fc9384c4c7a550f02aeab91c10a91c47d0b6 100644 --- a/car/src/main/java/cz/muni/pa165/car/service/CarServiceImpl.java +++ b/car/src/main/java/cz/muni/pa165/car/service/CarServiceImpl.java @@ -1,6 +1,6 @@ package cz.muni.pa165.car.service; -import cz.muni.pa165.car.api.CarDto; +import cz.muni.pa165.common_library.dtos.CarDto; import cz.muni.pa165.car.data.repository.CarComponentRepository; import cz.muni.pa165.car.data.repository.CarRepository; import cz.muni.pa165.car.data.repository.DriverRepository; diff --git a/component/src/main/java/cz/muni/pa165/component/api/CarComponentDto.java b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/CarComponentDto.java similarity index 93% rename from component/src/main/java/cz/muni/pa165/component/api/CarComponentDto.java rename to common_library/src/main/java/cz/muni/pa165/common_library/dtos/CarComponentDto.java index 692adccb24808250647110e2a72400a800ed79a7..f34f23030a25f4e365386384f09ceddaa031a978 100644 --- a/component/src/main/java/cz/muni/pa165/component/api/CarComponentDto.java +++ b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/CarComponentDto.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.component.api; +package cz.muni.pa165.common_library.dtos; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; @@ -19,7 +19,7 @@ public class CarComponentDto { @NotNull @Schema(description = "component id", example = "1") - long id; + Long id; @NotNull @Schema(description = "component weight", example = "50") diff --git a/car/src/main/java/cz/muni/pa165/car/api/CarDto.java b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/CarDto.java similarity index 95% rename from car/src/main/java/cz/muni/pa165/car/api/CarDto.java rename to common_library/src/main/java/cz/muni/pa165/common_library/dtos/CarDto.java index 309a567eb2b49e45c758f3d3e1926f9e21025bb2..1b9ce2fa9cefca649e1f5a0afd32558746565503 100644 --- a/car/src/main/java/cz/muni/pa165/car/api/CarDto.java +++ b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/CarDto.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.car.api; +package cz.muni.pa165.common_library.dtos; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; diff --git a/driver/src/main/java/cz/muni/pa165/driver/api/DriverCarDto.java b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverCarDto.java similarity index 74% rename from driver/src/main/java/cz/muni/pa165/driver/api/DriverCarDto.java rename to common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverCarDto.java index 869575aa85973d46e2242e38cf7c38d20780e1a6..316990e28552613591636bd0de08d6ef453afa80 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/api/DriverCarDto.java +++ b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverCarDto.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.driver.api; +package cz.muni.pa165.common_library.dtos; /** * Dto for DriverCar response. diff --git a/car/src/main/java/cz/muni/pa165/car/api/DriverDto.java b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverDto.java similarity index 93% rename from car/src/main/java/cz/muni/pa165/car/api/DriverDto.java rename to common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverDto.java index 3c2a87281f20cc707418075f48f8642eebd39c89..c7d0036714270df6e41f6899e3a5fb4d5310e655 100644 --- a/car/src/main/java/cz/muni/pa165/car/api/DriverDto.java +++ b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverDto.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.car.api; +package cz.muni.pa165.common_library.dtos; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; diff --git a/driver/src/main/java/cz/muni/pa165/driver/api/DriverInsightDto.java b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverInsightDto.java similarity index 89% rename from driver/src/main/java/cz/muni/pa165/driver/api/DriverInsightDto.java rename to common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverInsightDto.java index bc5325e3b30ff4f8e2f1dde8ea6bcb5a1d40367c..3525965abc5ac72276039fd5cfa34fcfc6ad2c4b 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/api/DriverInsightDto.java +++ b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverInsightDto.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.driver.api; +package cz.muni.pa165.common_library.dtos; import java.util.Map; diff --git a/driver/src/main/java/cz/muni/pa165/driver/api/DriverResponseDto.java b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverResponseDto.java similarity index 65% rename from driver/src/main/java/cz/muni/pa165/driver/api/DriverResponseDto.java rename to common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverResponseDto.java index e7f27ccd099dfd74aa5b93a819412d3bf68eac22..e05bb898be587b8b8bc3a779d0f6e181af5940e2 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/api/DriverResponseDto.java +++ b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverResponseDto.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.driver.api; +package cz.muni.pa165.common_library.dtos; /** * Dto for driver response. diff --git a/driver/src/main/java/cz/muni/pa165/driver/api/DriverUpdateDto.java b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverUpdateDto.java similarity index 86% rename from driver/src/main/java/cz/muni/pa165/driver/api/DriverUpdateDto.java rename to common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverUpdateDto.java index f9025444d2ae4ceab59743c2e959522891204340..4c574b86cf50c8e7b7dc110c9690de3c7e32a89a 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/api/DriverUpdateDto.java +++ b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/DriverUpdateDto.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.driver.api; +package cz.muni.pa165.common_library.dtos; import java.util.Map; diff --git a/race/src/main/java/cz/muni/pa165/race/api/RaceDto.java b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/RaceDto.java similarity index 95% rename from race/src/main/java/cz/muni/pa165/race/api/RaceDto.java rename to common_library/src/main/java/cz/muni/pa165/common_library/dtos/RaceDto.java index 71a72fcae59f4e081ae0141a68e5b5c5c602790f..0c26d22f1c58fe482b699a76774f55941f91fe34 100644 --- a/race/src/main/java/cz/muni/pa165/race/api/RaceDto.java +++ b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/RaceDto.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.race.api; +package cz.muni.pa165.common_library.dtos; import cz.muni.pa165.common_library.racecomponents.Location; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/race/src/main/java/cz/muni/pa165/race/api/RaceNameDto.java b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/RaceNameDto.java similarity index 93% rename from race/src/main/java/cz/muni/pa165/race/api/RaceNameDto.java rename to common_library/src/main/java/cz/muni/pa165/common_library/dtos/RaceNameDto.java index 71c6c9d390ced6db7e227062857cd498dde25b5f..31e71ad9f85ea242a71d485708e7eb640ff43bb8 100644 --- a/race/src/main/java/cz/muni/pa165/race/api/RaceNameDto.java +++ b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/RaceNameDto.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.race.api; +package cz.muni.pa165.common_library.dtos; import cz.muni.pa165.common_library.racecomponents.Location; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/race/src/main/java/cz/muni/pa165/race/api/SeasonDto.java b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/SeasonDto.java similarity index 94% rename from race/src/main/java/cz/muni/pa165/race/api/SeasonDto.java rename to common_library/src/main/java/cz/muni/pa165/common_library/dtos/SeasonDto.java index 8da65bb67a7a22abc1700a0ec698c462bc45c94d..f5ea5df1445b44fcf57d58797ed53e38933889d5 100644 --- a/race/src/main/java/cz/muni/pa165/race/api/SeasonDto.java +++ b/common_library/src/main/java/cz/muni/pa165/common_library/dtos/SeasonDto.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.race.api; +package cz.muni.pa165.common_library.dtos; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Max; diff --git a/common_library/src/main/resources.mv.db b/common_library/src/main/resources.mv.db index 9b1b72eccb39842839946971a1bea703e1e1f73b..2d0ad96b2093300a24f932e16ea0a59b9c26972f 100644 Binary files a/common_library/src/main/resources.mv.db and b/common_library/src/main/resources.mv.db differ diff --git a/component/src/main/java/cz/muni/pa165/component/rest/ComponentController.java b/component/src/main/java/cz/muni/pa165/component/rest/ComponentController.java index 593726943935456c47f4ca795f62e133a108f45c..d4d15522bb67540e27ac43cfbff78cffff2c34d6 100644 --- a/component/src/main/java/cz/muni/pa165/component/rest/ComponentController.java +++ b/component/src/main/java/cz/muni/pa165/component/rest/ComponentController.java @@ -1,6 +1,6 @@ package cz.muni.pa165.component.rest; -import cz.muni.pa165.component.api.CarComponentDto; +import cz.muni.pa165.common_library.dtos.CarComponentDto; import cz.muni.pa165.component.service.ComponentServiceInterface; import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; diff --git a/component/src/main/java/cz/muni/pa165/component/service/ComponentService.java b/component/src/main/java/cz/muni/pa165/component/service/ComponentService.java index e537ca6d242acb04c056d5ac638ddcf4b17cc581..e2ef17c8f97ed666dc358b95d9a8f2d277ba049e 100644 --- a/component/src/main/java/cz/muni/pa165/component/service/ComponentService.java +++ b/component/src/main/java/cz/muni/pa165/component/service/ComponentService.java @@ -2,7 +2,7 @@ package cz.muni.pa165.component.service; import cz.muni.pa165.common_library.exceptions.DatabaseException; import cz.muni.pa165.common_library.racecomponents.CarComponent; -import cz.muni.pa165.component.api.CarComponentDto; +import cz.muni.pa165.common_library.dtos.CarComponentDto; import cz.muni.pa165.component.data.repository.ComponentRepositoryInterface; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; @@ -67,6 +67,7 @@ public class ComponentService implements ComponentServiceInterface { .weight(carComponentDto.getWeight()) .price(carComponentDto.getPrice()) .manufacturer(carComponentDto.getManufacturer()) + .name(carComponentDto.getName()) .build(); } @@ -76,6 +77,7 @@ public class ComponentService implements ComponentServiceInterface { .weight(carComponent.getWeight()) .price(carComponent.getPrice()) .manufacturer(carComponent.getManufacturer()) + .name(carComponent.getName()) .build(); } } diff --git a/component/src/main/java/cz/muni/pa165/component/service/ComponentServiceInterface.java b/component/src/main/java/cz/muni/pa165/component/service/ComponentServiceInterface.java index 1eefb297bf3305fdb43be41213ac99c728707f5a..4ce60cfef740497e72bff9a7b9025491c74d45c5 100644 --- a/component/src/main/java/cz/muni/pa165/component/service/ComponentServiceInterface.java +++ b/component/src/main/java/cz/muni/pa165/component/service/ComponentServiceInterface.java @@ -1,6 +1,6 @@ package cz.muni.pa165.component.service; -import cz.muni.pa165.component.api.CarComponentDto; +import cz.muni.pa165.common_library.dtos.CarComponentDto; import java.util.List; diff --git a/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverCarMapper.java b/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverCarMapper.java index 2362d54974c2a05bd728c93d43c8e5c57a6fe69d..374ea886b6c796024a0fefcd386c0f24a4554d85 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverCarMapper.java +++ b/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverCarMapper.java @@ -2,7 +2,7 @@ package cz.muni.pa165.driver.mapper; import cz.muni.pa165.common_library.racecomponents.Car; import cz.muni.pa165.common_library.racecomponents.Driver; -import cz.muni.pa165.driver.api.DriverCarDto; +import cz.muni.pa165.common_library.dtos.DriverCarDto; /** * Interface of driver car mapper. diff --git a/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverCarMapperImpl.java b/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverCarMapperImpl.java index 0f9b3eb93df605f54aa21941745f326748d3d762..591144e36214bb29f6e2fcd64c4674a1e10541f3 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverCarMapperImpl.java +++ b/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverCarMapperImpl.java @@ -2,7 +2,7 @@ package cz.muni.pa165.driver.mapper; import cz.muni.pa165.common_library.racecomponents.Car; import cz.muni.pa165.common_library.racecomponents.Driver; -import cz.muni.pa165.driver.api.DriverCarDto; +import cz.muni.pa165.common_library.dtos.DriverCarDto; import org.springframework.stereotype.Component; /** diff --git a/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverMapper.java b/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverMapper.java index 67215558816b0c752a760af2937e653270e428c7..aaaa76aa0d9c91582accc8be1eee1add37776bee 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverMapper.java +++ b/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverMapper.java @@ -1,9 +1,9 @@ package cz.muni.pa165.driver.mapper; import cz.muni.pa165.common_library.racecomponents.Driver; -import cz.muni.pa165.driver.api.DriverInsightDto; -import cz.muni.pa165.driver.api.DriverResponseDto; -import cz.muni.pa165.driver.api.DriverUpdateDto; +import cz.muni.pa165.common_library.dtos.DriverInsightDto; +import cz.muni.pa165.common_library.dtos.DriverResponseDto; +import cz.muni.pa165.common_library.dtos.DriverUpdateDto; /** * Interface for driver mapper. diff --git a/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverMapperImpl.java b/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverMapperImpl.java index cb9b0430511b2b4d4e6c792fac1bd77724c27eeb..ae66d10a1c3e9b17d6dcb19b868dd05ff915c1f5 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverMapperImpl.java +++ b/driver/src/main/java/cz/muni/pa165/driver/mapper/DriverMapperImpl.java @@ -1,9 +1,9 @@ package cz.muni.pa165.driver.mapper; import cz.muni.pa165.common_library.racecomponents.Driver; -import cz.muni.pa165.driver.api.DriverInsightDto; -import cz.muni.pa165.driver.api.DriverResponseDto; -import cz.muni.pa165.driver.api.DriverUpdateDto; +import cz.muni.pa165.common_library.dtos.DriverInsightDto; +import cz.muni.pa165.common_library.dtos.DriverResponseDto; +import cz.muni.pa165.common_library.dtos.DriverUpdateDto; import org.springframework.stereotype.Component; /** diff --git a/driver/src/main/java/cz/muni/pa165/driver/rest/DriverController.java b/driver/src/main/java/cz/muni/pa165/driver/rest/DriverController.java index 56b842dd20cdd7c2cbbfec1249c2176d0139a6db..b9608e0285968ec6bf97fa9bd94dee9ffe3835ca 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/rest/DriverController.java +++ b/driver/src/main/java/cz/muni/pa165/driver/rest/DriverController.java @@ -1,9 +1,9 @@ package cz.muni.pa165.driver.rest; -import cz.muni.pa165.driver.api.DriverCarDto; -import cz.muni.pa165.driver.api.DriverInsightDto; -import cz.muni.pa165.driver.api.DriverResponseDto; -import cz.muni.pa165.driver.api.DriverUpdateDto; +import cz.muni.pa165.common_library.dtos.DriverCarDto; +import cz.muni.pa165.common_library.dtos.DriverInsightDto; +import cz.muni.pa165.common_library.dtos.DriverResponseDto; +import cz.muni.pa165.common_library.dtos.DriverUpdateDto; import cz.muni.pa165.driver.service.CarService; import cz.muni.pa165.driver.service.DriverService; import io.swagger.v3.oas.annotations.Operation; diff --git a/driver/src/main/java/cz/muni/pa165/driver/service/CarService.java b/driver/src/main/java/cz/muni/pa165/driver/service/CarService.java index 8c2260c28ba8f5ad8fd5d0df1967f2194e72d520..95698d97cb9cb8bec3cab840575bff4176e3cd70 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/service/CarService.java +++ b/driver/src/main/java/cz/muni/pa165/driver/service/CarService.java @@ -1,6 +1,6 @@ package cz.muni.pa165.driver.service; -import cz.muni.pa165.driver.api.DriverCarDto; +import cz.muni.pa165.common_library.dtos.DriverCarDto; /** * Car service interface. diff --git a/driver/src/main/java/cz/muni/pa165/driver/service/CarServiceImpl.java b/driver/src/main/java/cz/muni/pa165/driver/service/CarServiceImpl.java index a938d74023b414c46efb44e3f367a9dc11e1a722..9a1e10df8fd6844479cdf1c5a56a4e4529693a2d 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/service/CarServiceImpl.java +++ b/driver/src/main/java/cz/muni/pa165/driver/service/CarServiceImpl.java @@ -1,7 +1,7 @@ package cz.muni.pa165.driver.service; import cz.muni.pa165.common_library.exceptions.ResourceNotFoundException; -import cz.muni.pa165.driver.api.DriverCarDto; +import cz.muni.pa165.common_library.dtos.DriverCarDto; import cz.muni.pa165.driver.data.repository.CarRepository; import cz.muni.pa165.driver.data.repository.DriverRepository; import cz.muni.pa165.driver.mapper.DriverCarMapper; diff --git a/driver/src/main/java/cz/muni/pa165/driver/service/DriverService.java b/driver/src/main/java/cz/muni/pa165/driver/service/DriverService.java index 3f31ded7748ec533f54822326866d93b594358ba..90aea4b74da248a7c73fb6121bdc19ed1dd1f34b 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/service/DriverService.java +++ b/driver/src/main/java/cz/muni/pa165/driver/service/DriverService.java @@ -1,8 +1,8 @@ package cz.muni.pa165.driver.service; -import cz.muni.pa165.driver.api.DriverInsightDto; -import cz.muni.pa165.driver.api.DriverResponseDto; -import cz.muni.pa165.driver.api.DriverUpdateDto; +import cz.muni.pa165.common_library.dtos.DriverInsightDto; +import cz.muni.pa165.common_library.dtos.DriverResponseDto; +import cz.muni.pa165.common_library.dtos.DriverUpdateDto; import java.util.List; /** diff --git a/driver/src/main/java/cz/muni/pa165/driver/service/DriverServiceImpl.java b/driver/src/main/java/cz/muni/pa165/driver/service/DriverServiceImpl.java index 4f981b208449fae31eddf978100054cd33a647ec..4e884f004cbd54b0e8399c52f5f8e7e75193943a 100644 --- a/driver/src/main/java/cz/muni/pa165/driver/service/DriverServiceImpl.java +++ b/driver/src/main/java/cz/muni/pa165/driver/service/DriverServiceImpl.java @@ -1,9 +1,9 @@ package cz.muni.pa165.driver.service; import cz.muni.pa165.common_library.exceptions.ResourceNotFoundException; -import cz.muni.pa165.driver.api.DriverInsightDto; -import cz.muni.pa165.driver.api.DriverResponseDto; -import cz.muni.pa165.driver.api.DriverUpdateDto; +import cz.muni.pa165.common_library.dtos.DriverInsightDto; +import cz.muni.pa165.common_library.dtos.DriverResponseDto; +import cz.muni.pa165.common_library.dtos.DriverUpdateDto; import cz.muni.pa165.driver.data.repository.DriverRepository; import cz.muni.pa165.driver.mapper.DriverMapper; import java.util.List; diff --git a/race/src/main/java/cz/muni/pa165/race/api/DriverCarDto.java b/race/src/main/java/cz/muni/pa165/race/api/DriverCarDto.java deleted file mode 100644 index f61f9b3498d7dd2dc950ac3ce014398e0739ee75..0000000000000000000000000000000000000000 --- a/race/src/main/java/cz/muni/pa165/race/api/DriverCarDto.java +++ /dev/null @@ -1,25 +0,0 @@ -package cz.muni.pa165.race.api; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; -import lombok.Builder; -import lombok.Data; - -/** - * Dto fro DriverCar entity. - */ -@Data -@Builder -public class DriverCarDto { - - @NotNull - @Schema(description = "driver id", example = "1") - Long driverId; - - @NotNull - @Schema(description = "car id", example = "1") - Long carId; - - @Schema(description = "driver name", example = "1") - String driverName; -} diff --git a/race/src/main/java/cz/muni/pa165/race/rest/RaceController.java b/race/src/main/java/cz/muni/pa165/race/rest/RaceController.java index 05a9e34a024d4119a92cfd345919022df74af1a2..24ce9dd85f436d57519406d49c03ef366d6e422a 100644 --- a/race/src/main/java/cz/muni/pa165/race/rest/RaceController.java +++ b/race/src/main/java/cz/muni/pa165/race/rest/RaceController.java @@ -1,7 +1,7 @@ package cz.muni.pa165.race.rest; -import cz.muni.pa165.race.api.RaceDto; +import cz.muni.pa165.common_library.dtos.RaceDto; import cz.muni.pa165.race.service.RaceService; import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; diff --git a/race/src/main/java/cz/muni/pa165/race/rest/SeasonController.java b/race/src/main/java/cz/muni/pa165/race/rest/SeasonController.java index bdfd5e080e0175889053da83b29f54ba188c5348..b3ced6adf195628df009699e0e7459d7358c65ea 100644 --- a/race/src/main/java/cz/muni/pa165/race/rest/SeasonController.java +++ b/race/src/main/java/cz/muni/pa165/race/rest/SeasonController.java @@ -1,7 +1,6 @@ package cz.muni.pa165.race.rest; -import cz.muni.pa165.common_library.racecomponents.Season; -import cz.muni.pa165.race.api.SeasonDto; +import cz.muni.pa165.common_library.dtos.SeasonDto; import cz.muni.pa165.race.service.SeasonServiceInterface; import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; diff --git a/race/src/main/java/cz/muni/pa165/race/service/RaceService.java b/race/src/main/java/cz/muni/pa165/race/service/RaceService.java index ece7fd214916b7fab15e0d5ac090e347d0f67420..ebb149d2df6081050eddaa3a23f9f9eb22d7a709 100644 --- a/race/src/main/java/cz/muni/pa165/race/service/RaceService.java +++ b/race/src/main/java/cz/muni/pa165/race/service/RaceService.java @@ -5,7 +5,7 @@ import cz.muni.pa165.common_library.racecomponents.Car; import cz.muni.pa165.common_library.racecomponents.Driver; import cz.muni.pa165.common_library.racecomponents.Race; import cz.muni.pa165.race.api.DriverCarDto; -import cz.muni.pa165.race.api.RaceDto; +import cz.muni.pa165.common_library.dtos.RaceDto; import cz.muni.pa165.race.data.repository.CarRepository; import cz.muni.pa165.race.data.repository.DriverRepository; import cz.muni.pa165.race.data.repository.RaceRepository; diff --git a/race/src/main/java/cz/muni/pa165/race/service/SeasonService.java b/race/src/main/java/cz/muni/pa165/race/service/SeasonService.java index eea02cc55796540c3d89646289ee035ec474ada5..26f6637a843a3422656367ccd842ebaf2e8b605f 100644 --- a/race/src/main/java/cz/muni/pa165/race/service/SeasonService.java +++ b/race/src/main/java/cz/muni/pa165/race/service/SeasonService.java @@ -3,8 +3,8 @@ package cz.muni.pa165.race.service; import cz.muni.pa165.common_library.exceptions.DatabaseException; import cz.muni.pa165.common_library.racecomponents.Race; import cz.muni.pa165.common_library.racecomponents.Season; -import cz.muni.pa165.race.api.RaceNameDto; -import cz.muni.pa165.race.api.SeasonDto; +import cz.muni.pa165.common_library.dtos.RaceNameDto; +import cz.muni.pa165.common_library.dtos.SeasonDto; import cz.muni.pa165.race.data.repository.RaceRepository; import cz.muni.pa165.race.data.repository.SeasonRepository; import java.util.List; diff --git a/race/src/main/java/cz/muni/pa165/race/service/SeasonServiceInterface.java b/race/src/main/java/cz/muni/pa165/race/service/SeasonServiceInterface.java index 5fc6a35aac2d0aa9d9476aeb646ff2e947db1e7c..62cf0c3b94d265d693e533f254d188af5bcda1bc 100644 --- a/race/src/main/java/cz/muni/pa165/race/service/SeasonServiceInterface.java +++ b/race/src/main/java/cz/muni/pa165/race/service/SeasonServiceInterface.java @@ -1,6 +1,6 @@ package cz.muni.pa165.race.service; -import cz.muni.pa165.race.api.SeasonDto; +import cz.muni.pa165.common_library.dtos.SeasonDto; import java.util.List; /**