From 1ced5f723e79dfb838210f6baa8b503acd6aa99e Mon Sep 17 00:00:00 2001 From: Constantin Simonis Date: Wed, 4 Sep 2024 12:05:55 +0200 Subject: [PATCH] refacto --- .../java/de/szut/webshop/article/ArticleController.java | 4 +--- src/main/java/de/szut/webshop/article/ArticleEntity.java | 4 ++-- .../java/de/szut/webshop/article/ArticleRepository.java | 3 +-- src/main/java/de/szut/webshop/article/ArticleService.java | 4 +--- .../szut/webshop/{article => supplier}/AddSupplierDto.java | 2 +- src/main/java/de/szut/webshop/supplier/ContactEntity.java | 2 +- .../java/de/szut/webshop/supplier/SupplierController.java | 6 +----- src/main/java/de/szut/webshop/supplier/SupplierEntity.java | 3 ++- .../java/de/szut/webshop/supplier/SupplierRepository.java | 3 +-- src/main/java/de/szut/webshop/supplier/SupplierService.java | 4 +--- 10 files changed, 12 insertions(+), 23 deletions(-) rename src/main/java/de/szut/webshop/{article => supplier}/AddSupplierDto.java (95%) diff --git a/src/main/java/de/szut/webshop/article/ArticleController.java b/src/main/java/de/szut/webshop/article/ArticleController.java index 5f33fc2..65b73fd 100644 --- a/src/main/java/de/szut/webshop/article/ArticleController.java +++ b/src/main/java/de/szut/webshop/article/ArticleController.java @@ -1,7 +1,5 @@ -package de.szut.webshop.controller; +package de.szut.webshop.article; -import de.szut.webshop.model.ArticleEntity; -import de.szut.webshop.service.ArticleService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/src/main/java/de/szut/webshop/article/ArticleEntity.java b/src/main/java/de/szut/webshop/article/ArticleEntity.java index 45fe9c7..4c59975 100644 --- a/src/main/java/de/szut/webshop/article/ArticleEntity.java +++ b/src/main/java/de/szut/webshop/article/ArticleEntity.java @@ -1,12 +1,12 @@ -package de.szut.webshop.model; +package de.szut.webshop.article; +import de.szut.webshop.supplier.SupplierEntity; import jakarta.persistence.*; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; - import java.time.LocalDateTime; @Getter diff --git a/src/main/java/de/szut/webshop/article/ArticleRepository.java b/src/main/java/de/szut/webshop/article/ArticleRepository.java index 13fde6d..fa4fcec 100644 --- a/src/main/java/de/szut/webshop/article/ArticleRepository.java +++ b/src/main/java/de/szut/webshop/article/ArticleRepository.java @@ -1,6 +1,5 @@ -package de.szut.webshop.repository; +package de.szut.webshop.article; -import de.szut.webshop.model.ArticleEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface ArticleRepository extends JpaRepository { diff --git a/src/main/java/de/szut/webshop/article/ArticleService.java b/src/main/java/de/szut/webshop/article/ArticleService.java index 816daa0..b54f99d 100644 --- a/src/main/java/de/szut/webshop/article/ArticleService.java +++ b/src/main/java/de/szut/webshop/article/ArticleService.java @@ -1,7 +1,5 @@ -package de.szut.webshop.service; +package de.szut.webshop.article; -import de.szut.webshop.model.ArticleEntity; -import de.szut.webshop.repository.ArticleRepository; import org.springframework.stereotype.Service; import java.util.Collection; diff --git a/src/main/java/de/szut/webshop/article/AddSupplierDto.java b/src/main/java/de/szut/webshop/supplier/AddSupplierDto.java similarity index 95% rename from src/main/java/de/szut/webshop/article/AddSupplierDto.java rename to src/main/java/de/szut/webshop/supplier/AddSupplierDto.java index 4f0a878..606057a 100644 --- a/src/main/java/de/szut/webshop/article/AddSupplierDto.java +++ b/src/main/java/de/szut/webshop/supplier/AddSupplierDto.java @@ -1,4 +1,4 @@ -package de.szut.webshop.dto; +package de.szut.webshop.supplier; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; diff --git a/src/main/java/de/szut/webshop/supplier/ContactEntity.java b/src/main/java/de/szut/webshop/supplier/ContactEntity.java index c36161c..6291e39 100644 --- a/src/main/java/de/szut/webshop/supplier/ContactEntity.java +++ b/src/main/java/de/szut/webshop/supplier/ContactEntity.java @@ -1,4 +1,4 @@ -package de.szut.webshop.model; +package de.szut.webshop.supplier; import jakarta.persistence.*; diff --git a/src/main/java/de/szut/webshop/supplier/SupplierController.java b/src/main/java/de/szut/webshop/supplier/SupplierController.java index 952019d..9396455 100644 --- a/src/main/java/de/szut/webshop/supplier/SupplierController.java +++ b/src/main/java/de/szut/webshop/supplier/SupplierController.java @@ -1,9 +1,5 @@ -package de.szut.webshop.controller; +package de.szut.webshop.supplier; -import de.szut.webshop.dto.AddSupplierDto; -import de.szut.webshop.model.ContactEntity; -import de.szut.webshop.model.SupplierEntity; -import de.szut.webshop.service.SupplierService; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/src/main/java/de/szut/webshop/supplier/SupplierEntity.java b/src/main/java/de/szut/webshop/supplier/SupplierEntity.java index 649d143..7df0f5e 100644 --- a/src/main/java/de/szut/webshop/supplier/SupplierEntity.java +++ b/src/main/java/de/szut/webshop/supplier/SupplierEntity.java @@ -1,5 +1,6 @@ -package de.szut.webshop.model; +package de.szut.webshop.supplier; +import de.szut.webshop.article.ArticleEntity; import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; diff --git a/src/main/java/de/szut/webshop/supplier/SupplierRepository.java b/src/main/java/de/szut/webshop/supplier/SupplierRepository.java index 2ec68e1..8d98c14 100644 --- a/src/main/java/de/szut/webshop/supplier/SupplierRepository.java +++ b/src/main/java/de/szut/webshop/supplier/SupplierRepository.java @@ -1,6 +1,5 @@ -package de.szut.webshop.repository; +package de.szut.webshop.supplier; -import de.szut.webshop.model.SupplierEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface SupplierRepository extends JpaRepository { diff --git a/src/main/java/de/szut/webshop/supplier/SupplierService.java b/src/main/java/de/szut/webshop/supplier/SupplierService.java index a719fa2..931511e 100644 --- a/src/main/java/de/szut/webshop/supplier/SupplierService.java +++ b/src/main/java/de/szut/webshop/supplier/SupplierService.java @@ -1,7 +1,5 @@ -package de.szut.webshop.service; +package de.szut.webshop.supplier; -import de.szut.webshop.model.SupplierEntity; -import de.szut.webshop.repository.SupplierRepository; import org.springframework.stereotype.Service; @Service