保誠-保戶業務員媒合平台
wayne
2021-11-02 9b890d3e1b373bd3dfefd06199178134353dcb06
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
package com.pollex.pam.service.dto;
 
import com.pollex.pam.domain.User;
 
/**
 * A DTO representing a user, with only the public attributes.
 */
public class UserDTO {
 
    private Long id;
 
    private String login;
 
    public UserDTO() {
        // Empty constructor needed for Jackson.
    }
 
    public UserDTO(User user) {
        this.id = user.getId();
        // Customize it here if you need, or not, firstName/lastName/etc
        this.login = user.getLogin();
    }
 
    public Long getId() {
        return id;
    }
 
    public void setId(Long id) {
        this.id = id;
    }
 
    public String getLogin() {
        return login;
    }
 
    public void setLogin(String login) {
        this.login = login;
    }
 
    // prettier-ignore
    @Override
    public String toString() {
        return "UserDTO{" +
            "id='" + id + '\'' +
            ", login='" + login + '\'' +
            "}";
    }
}