-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserResponse.java
More file actions
66 lines (51 loc) · 2.34 KB
/
Copy pathUserResponse.java
File metadata and controls
66 lines (51 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.ecommerce.user.dto;
import com.ecommerce.user.entity.User;
import java.time.LocalDateTime;
import java.util.List;
public class UserResponse {
private Long id;
private String username;
private String email;
private String firstName;
private String lastName;
private String phoneNumber;
private User.UserStatus status;
private List<User.UserRole> roles;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
// Constructors
public UserResponse() {}
public UserResponse(User user) {
this.id = user.getId();
this.username = user.getUsername();
this.email = user.getEmail();
this.firstName = user.getFirstName();
this.lastName = user.getLastName();
this.phoneNumber = user.getPhoneNumber();
this.status = user.getStatus();
this.roles = user.getRoles();
this.createdAt = user.getCreatedAt();
this.updatedAt = user.getUpdatedAt();
}
// Getters and Setters
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public String getUsername() { return username; }
public void setUsername(String username) { this.username = username; }
public String getEmail() { return email; }
public void setEmail(String email) { this.email = email; }
public String getFirstName() { return firstName; }
public void setFirstName(String firstName) { this.firstName = firstName; }
public String getLastName() { return lastName; }
public void setLastName(String lastName) { this.lastName = lastName; }
public String getPhoneNumber() { return phoneNumber; }
public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; }
public User.UserStatus getStatus() { return status; }
public void setStatus(User.UserStatus status) { this.status = status; }
public List<User.UserRole> getRoles() { return roles; }
public void setRoles(List<User.UserRole> roles) { this.roles = roles; }
public LocalDateTime getCreatedAt() { return createdAt; }
public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; }
public LocalDateTime getUpdatedAt() { return updatedAt; }
public void setUpdatedAt(LocalDateTime updatedAt) { this.updatedAt = updatedAt; }
}