package com.tofly.feesapi.security.auth;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

public class ToflyUser extends User{

    @Getter
    private Long userid;

    @Getter
    private Long departmentId;

    @Getter
    private String userLevel;

    @Getter
    private String realName;

    @Getter
    private String departemntName;

    @Getter
    private String avatar;

    @Getter
    private Short pwderrtimes;


    public ToflyUser(Long useid,Long departmentId,String userLevel,String realName, String departemntName,String avatar,
                     String username, String password, boolean enabled, boolean accountNonExpired,
                     boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.userid=useid;
        this.departmentId=departmentId;
        this.userLevel=userLevel;
        this.realName=realName;
        this.departemntName=departemntName;
        this.avatar=avatar;
    }

    public ToflyUser(Short pwderrtimes,Long useid,Long departmentId,String userLevel,String realName, String departemntName,String avatar,
                     String username, String password, boolean enabled, boolean accountNonExpired,
                     boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.userid=useid;
        this.departmentId=departmentId;
        this.userLevel=userLevel;
        this.realName=realName;
        this.departemntName=departemntName;
        this.avatar=avatar;
        this.pwderrtimes=pwderrtimes;
    }
}
