[BAEL-4955] Move code example (#11177)

This commit is contained in:
Thiago dos Santos Hora 2021-08-28 17:38:21 +02:00 committed by GitHub
parent 41c9acc0b0
commit 6d5fcbc7ee
22 changed files with 46 additions and 87 deletions

View File

@ -1,5 +0,0 @@
## Article related
- [The DTO Pattern (Data Transfer Object)]()

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>com.baeldung.designpatterns.dtopattern</groupId>
<modelVersion>4.0.0</modelVersion>
<artifactId>dto-pattern</artifactId>
<name>dto-pattern</name>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-boot-2</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<encoding>UTF-8</encoding>
</properties>
</project>

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung.designpatterns</groupId>
<artifactId>design-patterns</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>design-patterns</name>
<packaging>pom</packaging>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modules>
<module>dto-pattern</module>
</modules>
</project>

View File

@ -15,6 +15,21 @@
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>${rest-assured.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
@ -38,6 +53,9 @@
<assertj-core.version>3.9.1</assertj-core.version>
<hibernate-core.version>5.2.16.Final</hibernate-core.version>
<mysql-connector.version>6.0.6</mysql-connector.version>
<spring-boot.version>2.5.3</spring-boot.version>
<rest-assured.version>3.3.0</rest-assured.version>
</properties>
</project>

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern;
package com.baeldung.dtopattern;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -1,7 +1,7 @@
package com.baeldung.designpatterns.dtopattern.api;
package com.baeldung.dtopattern.api;
import com.baeldung.designpatterns.dtopattern.domain.Role;
import com.baeldung.designpatterns.dtopattern.domain.User;
import com.baeldung.dtopattern.domain.Role;
import com.baeldung.dtopattern.domain.User;
import org.springframework.stereotype.Component;
import java.util.ArrayList;

View File

@ -1,8 +1,8 @@
package com.baeldung.designpatterns.dtopattern.api;
package com.baeldung.dtopattern.api;
import com.baeldung.designpatterns.dtopattern.domain.RoleService;
import com.baeldung.designpatterns.dtopattern.domain.User;
import com.baeldung.designpatterns.dtopattern.domain.UserService;
import com.baeldung.dtopattern.domain.RoleService;
import com.baeldung.dtopattern.domain.User;
import com.baeldung.dtopattern.domain.UserService;
import org.springframework.web.bind.annotation.*;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.api;
package com.baeldung.dtopattern.api;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.api;
package com.baeldung.dtopattern.api;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.api;
package com.baeldung.dtopattern.api;
public class UserIdDTO {

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.domain;
package com.baeldung.dtopattern.domain;
import org.springframework.stereotype.Service;

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.domain;
package com.baeldung.dtopattern.domain;
import java.util.Objects;

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.domain;
package com.baeldung.dtopattern.domain;
public interface RoleRepository {
Role getRoleById(String id);

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.domain;
package com.baeldung.dtopattern.domain;
import org.springframework.stereotype.Service;

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.domain;
package com.baeldung.dtopattern.domain;
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.domain;
package com.baeldung.dtopattern.domain;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.domain;
package com.baeldung.dtopattern.domain;
import org.springframework.stereotype.Service;

View File

@ -1,7 +1,7 @@
package com.baeldung.designpatterns.dtopattern.api;
package com.baeldung.dtopattern.api;
import com.baeldung.designpatterns.dtopattern.domain.Role;
import com.baeldung.designpatterns.dtopattern.domain.User;
import com.baeldung.dtopattern.domain.Role;
import com.baeldung.dtopattern.domain.User;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;

View File

@ -1,9 +1,9 @@
package com.baeldung.designpatterns.dtopattern.api;
package com.baeldung.dtopattern.api;
import com.baeldung.designpatterns.dtopattern.domain.Role;
import com.baeldung.designpatterns.dtopattern.domain.RoleRepository;
import com.baeldung.designpatterns.dtopattern.domain.User;
import com.baeldung.designpatterns.dtopattern.domain.UserRepository;
import com.baeldung.dtopattern.domain.Role;
import com.baeldung.dtopattern.domain.RoleRepository;
import com.baeldung.dtopattern.domain.User;
import com.baeldung.dtopattern.domain.UserRepository;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.restassured.http.ContentType;
import org.junit.jupiter.api.Test;

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.domain;
package com.baeldung.dtopattern.domain;
import org.junit.jupiter.api.Test;

View File

@ -1,4 +1,4 @@
package com.baeldung.designpatterns.dtopattern.domain;
package com.baeldung.dtopattern.domain;
import org.junit.jupiter.api.Test;

View File

@ -387,7 +387,6 @@
<module>core-groovy-strings</module>
<module>core-java-modules</module>
<module>design-patterns</module>
<module>couchbase</module>
<module>custom-pmd</module>