Compare commits

2 Commits

Author SHA1 Message Date
Catalin Patrut
2e050072a7 removing model mapper 2021-08-08 21:56:24 +02:00
Catalin Patrut
d743055729 deleting model mapper 2021-08-08 19:48:13 +02:00
5 changed files with 4 additions and 28 deletions

View File

@@ -31,17 +31,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<!-- TODO: delete-->
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.3.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>

View File

@@ -1,6 +1,5 @@
package dev.enblng.api.config;
import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RestController;
@@ -12,26 +11,14 @@ import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
//TODO: delete
@Configuration
public class BeanConfig {
public class SwaggerConfig {
private static final String SNAPSHOT = "1.0";
private static final String HTTP_WWW_APACHE_ORG_LICENSES_LICENSE_2_0_HTML = "Usage of this code is forbidden without consent";
private static final String APACHE_2_0 = "Apache 2.0";
@Bean
public ModelMapper modelMapper() {
final ModelMapper modelMapper = new ModelMapper();
modelMapper.getConfiguration()
.setFieldMatchingEnabled(true)
.setFieldAccessLevel(org.modelmapper.config.Configuration.AccessLevel.PRIVATE);
return modelMapper;
}
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.useDefaultResponseMessages(false)
.select()

View File

@@ -38,5 +38,4 @@ public class PostEntity {
@Column(name = "creation_time", nullable = false)
@CreationTimestamp
private ZonedDateTime creationTime;
}

View File

@@ -5,7 +5,6 @@ import dev.enblng.api.entities.CommentEntity;
import dev.enblng.api.mappers.CommentMapper;
import dev.enblng.api.repositories.CommentRepository;
import dev.enblng.api.services.CommentService;
import org.modelmapper.ModelMapper;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@@ -22,7 +21,6 @@ public class CommentServiceImpl implements CommentService {
private final CommentMapper commentMapper;
public CommentServiceImpl(
final ModelMapper modelMapper,
final CommentRepository commentRepository,
final CommentMapper commentMapper
) {

View File

@@ -6,7 +6,6 @@ import dev.enblng.api.mappers.PostMapper;
import dev.enblng.api.repositories.PostRepository;
import dev.enblng.api.services.PostService;
import lombok.extern.slf4j.Slf4j;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@@ -25,9 +24,9 @@ public class PostServiceImpl implements PostService {
private final PostMapper postMapper;
@Autowired
public PostServiceImpl(final ModelMapper modelMapper,
final PostRepository postRepository,
final PostMapper postMapper) {
public PostServiceImpl(
final PostRepository postRepository,
final PostMapper postMapper) {
this.postRepository = postRepository;
this.postMapper = postMapper;
}