package easydo.technology.system.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import easydo.technology.base.CommonDto;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * @author jinjin
 * @date 2020-09-25
 */
@Getter
@Setter
public class UserDto extends CommonDto {
    private static final long serialVersionUID = 1L;

    private Long id;

    private Set<RoleSmallDto> roles;

    private Set<JobSmallDto> jobs;

    private DeptSmallDto dept;

    private Long deptId;

    private String username;

    private String nickName;

    private String gender;

    private String phone;

    private String email;

    private String avatarName;

    private String avatarPath;

    @JsonIgnore
    private String password;

    @JsonIgnore
    private Boolean isAdmin;

    private Boolean enabled;

    private Date pwdResetTime;

    // 项目id
    private Integer projectFpiId;
   //用户类型
    private String projectUserType;

    private String features;

    private List<String> deptIdList;

    // //项目表的id
    // private Integer fpiId;
    //
    // //项目表的项目名称
    // private String projectName;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UserDto dto = (UserDto) o;
        return Objects.equals(id, dto.id) &&
                Objects.equals(username, dto.username);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username);
    }

}
