From 30bc09a6169b80e75ae9bcea04205dacd9a8269d Mon Sep 17 00:00:00 2001 From: markpernia Date: Wed, 17 Jan 2024 21:03:52 +0100 Subject: [PATCH] SMA-4-Added ModelMapper dependency --- backend/build.gradle | 2 ++ .../backend/configs/ModelMapperConfig.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 backend/src/main/java/com/sportsmatch/backend/configs/ModelMapperConfig.java diff --git a/backend/build.gradle b/backend/build.gradle index b0a09c19..101c7fd8 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -29,6 +29,8 @@ dependencies { annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' + implementation group: 'org.modelmapper', name: 'modelmapper', version: '3.1.1' + } tasks.named('bootBuildImage') { diff --git a/backend/src/main/java/com/sportsmatch/backend/configs/ModelMapperConfig.java b/backend/src/main/java/com/sportsmatch/backend/configs/ModelMapperConfig.java new file mode 100644 index 00000000..93e2529a --- /dev/null +++ b/backend/src/main/java/com/sportsmatch/backend/configs/ModelMapperConfig.java @@ -0,0 +1,14 @@ +package com.sportsmatch.backend.configs; + +import org.modelmapper.ModelMapper; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ModelMapperConfig { + + @Bean + public ModelMapper modelMapper() { + return new ModelMapper(); + } +}