add DTOs
This commit is contained in:
parent
f3902ffc16
commit
15a25f0ef3
37
cqrs/src/main/java/com/iluwatar/cqrs/dto/AuthorDTO.java
Normal file
37
cqrs/src/main/java/com/iluwatar/cqrs/dto/AuthorDTO.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package com.iluwatar.cqrs.dto;
|
||||||
|
|
||||||
|
public class AuthorDTO {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String email;
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
public AuthorDTO(String name, String email, String username) {
|
||||||
|
super();
|
||||||
|
this.name = name;
|
||||||
|
this.email = email;
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AuthorDTO() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AuthorDTO [name=" + name + ", email=" + email + ", username=" + username + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
26
cqrs/src/main/java/com/iluwatar/cqrs/dto/BookDTO.java
Normal file
26
cqrs/src/main/java/com/iluwatar/cqrs/dto/BookDTO.java
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package com.iluwatar.cqrs.dto;
|
||||||
|
|
||||||
|
public class BookDTO {
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
private double price;
|
||||||
|
|
||||||
|
public BookDTO(String title, double price) {
|
||||||
|
super();
|
||||||
|
this.title = title;
|
||||||
|
this.price = price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BookDTO() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getPrice() {
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user