Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e050072a7 | ||
|
|
d743055729 |
7
pom.xml
7
pom.xml
@@ -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>
|
||||
|
||||
@@ -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()
|
||||
@@ -38,5 +38,4 @@ public class PostEntity {
|
||||
@Column(name = "creation_time", nullable = false)
|
||||
@CreationTimestamp
|
||||
private ZonedDateTime creationTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user