From 681dd938ecf1a110e1063f99e8c563ef54d66c42 Mon Sep 17 00:00:00 2001 From: cfisher-scottlogic Date: Thu, 5 Oct 2023 20:46:12 +0100 Subject: [PATCH] VUU25: Reformatting --- .../layoutserver/controller/LayoutController.java | 6 +++--- .../finos/vuu/layoutserver/dto/MappingConfig.java | 13 ++++++++----- .../org/finos/vuu/layoutserver/model/Layout.java | 4 +--- .../org/finos/vuu/layoutserver/model/Metadata.java | 6 ++---- .../layoutserver/repository/LayoutRepository.java | 3 +-- .../layoutserver/repository/MetadataRepository.java | 3 +-- .../vuu/layoutserver/service/MetadataService.java | 5 ++--- 7 files changed, 18 insertions(+), 22 deletions(-) diff --git a/layout-server/src/main/java/org/finos/vuu/layoutserver/controller/LayoutController.java b/layout-server/src/main/java/org/finos/vuu/layoutserver/controller/LayoutController.java index c24bd8d71..90068d5fd 100644 --- a/layout-server/src/main/java/org/finos/vuu/layoutserver/controller/LayoutController.java +++ b/layout-server/src/main/java/org/finos/vuu/layoutserver/controller/LayoutController.java @@ -52,9 +52,9 @@ public GetLayoutResponseDTO getLayout(@PathVariable UUID id) { public List getMetadata() { return layoutService.getMetadata() - .stream() - .map(metadata -> mapper.map(metadata, MetadataResponseDTO.class)) - .toList(); + .stream() + .map(metadata -> mapper.map(metadata, MetadataResponseDTO.class)) + .toList(); } /** diff --git a/layout-server/src/main/java/org/finos/vuu/layoutserver/dto/MappingConfig.java b/layout-server/src/main/java/org/finos/vuu/layoutserver/dto/MappingConfig.java index 5d4f8ec34..ff69a08f8 100644 --- a/layout-server/src/main/java/org/finos/vuu/layoutserver/dto/MappingConfig.java +++ b/layout-server/src/main/java/org/finos/vuu/layoutserver/dto/MappingConfig.java @@ -18,19 +18,22 @@ public ModelMapper modelMapper() { ModelMapper mapper = new ModelMapper(); // LayoutRequestDTO to Layout - mapper.typeMap(LayoutRequestDTO.class, Layout.class).addMappings(m -> m.skip(Layout::setId)); + mapper.typeMap(LayoutRequestDTO.class, Layout.class) + .addMappings(m -> m.skip(Layout::setId)); // Layout to CreateLayoutResponseDTO mapper.typeMap(Layout.class, CreateLayoutResponseDTO.class) - .addMappings(m -> m.map(layout -> layout.getMetadata().getCreated(), - CreateLayoutResponseDTO::setCreated)); + .addMappings(m -> m.map(layout -> layout.getMetadata().getCreated(), + CreateLayoutResponseDTO::setCreated)); // Metadata to MetadataResponseDTO mapper.typeMap(Metadata.class, MetadataResponseDTO.class) - .addMappings(m -> m.map(metadata -> metadata.getLayout().getId(), MetadataResponseDTO::setLayoutId)); + .addMappings(m -> m.map(metadata -> metadata.getLayout().getId(), + MetadataResponseDTO::setLayoutId)); // MetadataRequestDTO to Metadata - mapper.typeMap(MetadataRequestDTO.class, Metadata.class).addMappings(m -> m.skip(Metadata::setId)); + mapper.typeMap(MetadataRequestDTO.class, Metadata.class) + .addMappings(m -> m.skip(Metadata::setId)); return mapper; } diff --git a/layout-server/src/main/java/org/finos/vuu/layoutserver/model/Layout.java b/layout-server/src/main/java/org/finos/vuu/layoutserver/model/Layout.java index 6d1f3aee6..3fc6a6dcc 100644 --- a/layout-server/src/main/java/org/finos/vuu/layoutserver/model/Layout.java +++ b/layout-server/src/main/java/org/finos/vuu/layoutserver/model/Layout.java @@ -7,10 +7,8 @@ import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.OneToOne; -import lombok.Data; -import lombok.NoArgsConstructor; - import java.util.UUID; +import lombok.Data; @Data @Entity diff --git a/layout-server/src/main/java/org/finos/vuu/layoutserver/model/Metadata.java b/layout-server/src/main/java/org/finos/vuu/layoutserver/model/Metadata.java index e9bf280c8..b5ae0bec2 100644 --- a/layout-server/src/main/java/org/finos/vuu/layoutserver/model/Metadata.java +++ b/layout-server/src/main/java/org/finos/vuu/layoutserver/model/Metadata.java @@ -5,12 +5,10 @@ import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.OneToOne; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.ToString; - import java.util.Date; import java.util.UUID; +import lombok.Data; +import lombok.ToString; @Data @Entity diff --git a/layout-server/src/main/java/org/finos/vuu/layoutserver/repository/LayoutRepository.java b/layout-server/src/main/java/org/finos/vuu/layoutserver/repository/LayoutRepository.java index d57af4897..6cbae4025 100644 --- a/layout-server/src/main/java/org/finos/vuu/layoutserver/repository/LayoutRepository.java +++ b/layout-server/src/main/java/org/finos/vuu/layoutserver/repository/LayoutRepository.java @@ -1,10 +1,9 @@ package org.finos.vuu.layoutserver.repository; +import java.util.UUID; import org.finos.vuu.layoutserver.model.Layout; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; -import java.util.UUID; - @Repository public interface LayoutRepository extends CrudRepository {} diff --git a/layout-server/src/main/java/org/finos/vuu/layoutserver/repository/MetadataRepository.java b/layout-server/src/main/java/org/finos/vuu/layoutserver/repository/MetadataRepository.java index 03f81b108..50cbe6288 100644 --- a/layout-server/src/main/java/org/finos/vuu/layoutserver/repository/MetadataRepository.java +++ b/layout-server/src/main/java/org/finos/vuu/layoutserver/repository/MetadataRepository.java @@ -1,10 +1,9 @@ package org.finos.vuu.layoutserver.repository; +import java.util.UUID; import org.finos.vuu.layoutserver.model.Metadata; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; -import java.util.UUID; - @Repository public interface MetadataRepository extends CrudRepository {} diff --git a/layout-server/src/main/java/org/finos/vuu/layoutserver/service/MetadataService.java b/layout-server/src/main/java/org/finos/vuu/layoutserver/service/MetadataService.java index 0103e3a4a..fb9696ac5 100644 --- a/layout-server/src/main/java/org/finos/vuu/layoutserver/service/MetadataService.java +++ b/layout-server/src/main/java/org/finos/vuu/layoutserver/service/MetadataService.java @@ -1,13 +1,12 @@ package org.finos.vuu.layoutserver.service; +import java.util.ArrayList; +import java.util.List; import lombok.RequiredArgsConstructor; import org.finos.vuu.layoutserver.model.Metadata; import org.finos.vuu.layoutserver.repository.MetadataRepository; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.List; - @RequiredArgsConstructor @Service public class MetadataService {