-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove folder from usecases and entities
- Loading branch information
1 parent
7986662
commit 4b53fb5
Showing
29 changed files
with
242 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.example.clean.entities; | ||
// https://github.com/microservices-demo/orders | ||
// package com.example.clean.entities.user; | ||
|
86 changes: 86 additions & 0 deletions
86
entities/src/main/java/com/example/clean/entities/User.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package com.example.clean.entities; | ||
|
||
public class User { | ||
|
||
private String id; | ||
private String email; | ||
private String password; | ||
private String lastName; | ||
private String firstName; | ||
|
||
// required for mvc servlet json deserialization | ||
User() { | ||
|
||
} | ||
|
||
private User(final String id, final String email, final String lastName, final String firstName) { | ||
this.id = id; | ||
this.email = email; | ||
this.lastName = lastName; | ||
this.firstName = firstName; | ||
} | ||
|
||
public static UserBuilder builder() { | ||
return new UserBuilder(); | ||
} | ||
|
||
public static class UserBuilder { | ||
private String id; | ||
private String email; | ||
private String lastName; | ||
private String firstName; | ||
|
||
UserBuilder() { | ||
} | ||
|
||
public UserBuilder id(final String id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
public UserBuilder email(final String email) { | ||
this.email = email; | ||
return this; | ||
} | ||
|
||
public UserBuilder lastName(final String lastName) { | ||
this.lastName = lastName; | ||
return this; | ||
} | ||
|
||
public UserBuilder firstName(final String firstName) { | ||
this.firstName = firstName; | ||
return this; | ||
} | ||
|
||
public User build() { | ||
return new User(id, email, lastName, firstName); | ||
} | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public String getLastName() { | ||
return lastName; | ||
} | ||
|
||
public String getFirstName() { | ||
return firstName; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "User{" + | ||
"id='" + id + '\'' + | ||
", email='" + email + '\'' + | ||
", lastName='" + lastName + '\'' + | ||
", firstName='" + firstName + '\'' + | ||
'}'; | ||
} | ||
} |
98 changes: 0 additions & 98 deletions
98
entities/user/src/main/java/com/example/clean/entities/user/User.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,12 @@ | |
|
||
[Generated from spring initializr](https://start.spring.io/#!type=gradle-project&language=java&platformVersion=3.1.5&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=rest-service&name=rest-service&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.rest-service&dependencies=web,devtools,security,actuator,jdbc,postgresql,modulith,batch,liquibase,prometheus) | ||
|
||
|
||
|
||
## Test | ||
|
||
Create a user | ||
```curl -X POST http://127.0.0.1:8080/users --header "Content-Type: application/json" --data '{"email":"[email protected]","password":"xyz", "lastName": "Doe", "firstName": "John"}'``` | ||
```curl -X POST http://127.0.0.1:8080/users --header "Content-Type: application/json" --data '{"email":"[email protected]","password":"xyz", "lastName": "Me", "firstName": "You"}'``` | ||
|
||
List Users | ||
````curl -X GET http://127.0.0.1:8080/users ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.