package com.fs.his.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fs.his.domain.FsStore;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.Collection;

@Data
public class StoreUserVO implements UserDetails {
    private static final long serialVersionUID = 1L;
    FsStore fsStore;
    /**
     * 用户唯一标识
     */
    private  String token;

    private Long loginTime;

    /**
     * 过期时间
     */
    private Long expireTime;

    /**
     * 登录IP地址
     */
    private String ipaddr;

    /**
     * 登录地点
     */
    private String loginLocation;

    /**
     * 浏览器类型
     */
    private  String browser;

    /**
     * 操作系统
     */
    private  String os;


    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return fsStore.getPassword();
    }

    @Override
    public String getUsername() {
        return fsStore.getStoreName();
    }














    @JsonIgnore
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }
    @JsonIgnore
    @Override
    public boolean isAccountNonLocked() {
        return true;
    }
    @JsonIgnore
    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }
    @JsonIgnore
    @Override
    public boolean isEnabled() {
        return true;
    }
}
