Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e050072a7 | ||
|
|
d743055729 |
7
pom.xml
7
pom.xml
@@ -31,17 +31,10 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.flywaydb</groupId>
|
<groupId>org.flywaydb</groupId>
|
||||||
<artifactId>flyway-core</artifactId>
|
<artifactId>flyway-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- TODO: delete-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.modelmapper</groupId>
|
|
||||||
<artifactId>modelmapper</artifactId>
|
|
||||||
<version>2.3.6</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-devtools</artifactId>
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package dev.enblng.api.config;
|
package dev.enblng.api.config;
|
||||||
|
|
||||||
import org.modelmapper.ModelMapper;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -12,26 +11,14 @@ import springfox.documentation.service.Contact;
|
|||||||
import springfox.documentation.spi.DocumentationType;
|
import springfox.documentation.spi.DocumentationType;
|
||||||
import springfox.documentation.spring.web.plugins.Docket;
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
|
|
||||||
//TODO: delete
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class BeanConfig {
|
public class SwaggerConfig {
|
||||||
private static final String SNAPSHOT = "1.0";
|
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 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";
|
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
|
@Bean
|
||||||
public Docket api() {
|
public Docket api() {
|
||||||
|
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
.useDefaultResponseMessages(false)
|
.useDefaultResponseMessages(false)
|
||||||
.select()
|
.select()
|
||||||
@@ -38,5 +38,4 @@ public class PostEntity {
|
|||||||
@Column(name = "creation_time", nullable = false)
|
@Column(name = "creation_time", nullable = false)
|
||||||
@CreationTimestamp
|
@CreationTimestamp
|
||||||
private ZonedDateTime creationTime;
|
private ZonedDateTime creationTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import dev.enblng.api.entities.CommentEntity;
|
|||||||
import dev.enblng.api.mappers.CommentMapper;
|
import dev.enblng.api.mappers.CommentMapper;
|
||||||
import dev.enblng.api.repositories.CommentRepository;
|
import dev.enblng.api.repositories.CommentRepository;
|
||||||
import dev.enblng.api.services.CommentService;
|
import dev.enblng.api.services.CommentService;
|
||||||
import org.modelmapper.ModelMapper;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -22,7 +21,6 @@ public class CommentServiceImpl implements CommentService {
|
|||||||
private final CommentMapper commentMapper;
|
private final CommentMapper commentMapper;
|
||||||
|
|
||||||
public CommentServiceImpl(
|
public CommentServiceImpl(
|
||||||
final ModelMapper modelMapper,
|
|
||||||
final CommentRepository commentRepository,
|
final CommentRepository commentRepository,
|
||||||
final CommentMapper commentMapper
|
final CommentMapper commentMapper
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import dev.enblng.api.mappers.PostMapper;
|
|||||||
import dev.enblng.api.repositories.PostRepository;
|
import dev.enblng.api.repositories.PostRepository;
|
||||||
import dev.enblng.api.services.PostService;
|
import dev.enblng.api.services.PostService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.modelmapper.ModelMapper;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -25,9 +24,9 @@ public class PostServiceImpl implements PostService {
|
|||||||
private final PostMapper postMapper;
|
private final PostMapper postMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public PostServiceImpl(final ModelMapper modelMapper,
|
public PostServiceImpl(
|
||||||
final PostRepository postRepository,
|
final PostRepository postRepository,
|
||||||
final PostMapper postMapper) {
|
final PostMapper postMapper) {
|
||||||
this.postRepository = postRepository;
|
this.postRepository = postRepository;
|
||||||
this.postMapper = postMapper;
|
this.postMapper = postMapper;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
class ApiApplicationTests {
|
class ApiApplicationTests {
|
||||||
|
|
||||||
|
@Test
|
||||||
void contextLoads() {
|
void contextLoads() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user