[BAEL-4955] Move code example (#11177)
This commit is contained in:
parent
41c9acc0b0
commit
6d5fcbc7ee
|
@ -1,5 +0,0 @@
|
|||
## Article related
|
||||
|
||||
- [The DTO Pattern (Data Transfer Object)]()
|
||||
|
||||
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern;
|
||||
package com.baeldung.dtopattern;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
@ -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;
|
|
@ -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;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.api;
|
||||
package com.baeldung.dtopattern.api;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.api;
|
||||
package com.baeldung.dtopattern.api;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.api;
|
||||
package com.baeldung.dtopattern.api;
|
||||
|
||||
public class UserIdDTO {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.domain;
|
||||
package com.baeldung.dtopattern.domain;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.domain;
|
||||
package com.baeldung.dtopattern.domain;
|
||||
|
||||
import java.util.Objects;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.domain;
|
||||
package com.baeldung.dtopattern.domain;
|
||||
|
||||
public interface RoleRepository {
|
||||
Role getRoleById(String id);
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.domain;
|
||||
package com.baeldung.dtopattern.domain;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.domain;
|
||||
package com.baeldung.dtopattern.domain;
|
||||
|
||||
import javax.crypto.*;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.domain;
|
||||
package com.baeldung.dtopattern.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.domain;
|
||||
package com.baeldung.dtopattern.domain;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -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;
|
|
@ -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;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.domain;
|
||||
package com.baeldung.dtopattern.domain;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.designpatterns.dtopattern.domain;
|
||||
package com.baeldung.dtopattern.domain;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
Loading…
Reference in New Issue