removes unused Imports and fomattet

This commit is contained in:
Philipp Schweizer 2020-06-17 17:23:29 +02:00
parent 0ab185f143
commit ebb3c8c235
6 changed files with 8 additions and 15 deletions

View File

@ -1,7 +1,7 @@
package org.hso.ecommerce.api;
import org.hso.ecommerce.entities.shop.CustomerOrder;
import org.hso.ecommerce.uiModel.DeliveryData;
import org.hso.ecommerce.uimodel.DeliveryData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.http.*;

View File

@ -3,12 +3,9 @@ package org.hso.ecommerce.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import java.util.Arrays;
@SpringBootApplication
@ComponentScan(basePackages = {"org.hso.ecommerce"})
@EntityScan("org.hso.ecommerce")

View File

@ -6,7 +6,7 @@ import org.hso.ecommerce.entities.shop.CustomerOrder;
import org.hso.ecommerce.entities.user.User;
import org.hso.ecommerce.repos.shop.CustomerOrderRepository;
import org.hso.ecommerce.repos.user.UserRepository;
import org.hso.ecommerce.uiModel.DeliveryData;
import org.hso.ecommerce.uimodel.DeliveryData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@ -53,13 +53,12 @@ public class UserController {
@GetMapping("/orders/")
public String userOrders(HttpSession session,
Model model
Model model
) {
List<CustomerOrder> orders = customerOrderRepository.getAllOrders();
List<CustomerOrder> orders = customerOrderRepository.getAllOrders();
Map<CustomerOrder, DeliveryData> customerOrderDeliveryDataMap = orders.stream().collect
(Collectors.toMap
(Function.identity(), c -> DeliveryData.getDeliveryDataFromCustomerOrder(c,customerOrderRepository, restServiceForDelivery)));
Map<CustomerOrder, DeliveryData> customerOrderDeliveryDataMap = orders.stream().
collect(Collectors.toMap(Function.identity(), c -> DeliveryData.getDeliveryDataFromCustomerOrder(c, customerOrderRepository, restServiceForDelivery)));
model.addAttribute("orderDeliveryDataMap", customerOrderDeliveryDataMap);

View File

@ -3,7 +3,7 @@ package org.hso.ecommerce.controller.intern.customers;
import org.hso.ecommerce.api.RestServiceForDelivery;
import org.hso.ecommerce.entities.shop.CustomerOrder;
import org.hso.ecommerce.repos.shop.CustomerOrderRepository;
import org.hso.ecommerce.uiModel.DeliveryData;
import org.hso.ecommerce.uimodel.DeliveryData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

View File

@ -2,14 +2,11 @@ package org.hso.ecommerce.repos.user;
import org.hso.ecommerce.entities.user.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.Optional;
import static jdk.nashorn.internal.runtime.regexp.joni.Syntax.Java;
@Repository
public interface UserRepository extends JpaRepository<User, Long> {

View File

@ -1,4 +1,4 @@
package org.hso.ecommerce.uiModel;
package org.hso.ecommerce.uimodel;
import com.fasterxml.jackson.annotation.JsonCreator;
import org.hso.ecommerce.api.RestServiceForDelivery;