package com.baoshi.swms.bean;

import com.baoshi.swms.util.GlobalStorage;
import com.google.gson.Gson;

import java.io.Serializable;

/**
 * 用户信息
 *
 * @author Zhendong Zhou
 * @date 2021/12/6 13:12
 */
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer id;
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    public static User getLocalUser(){
        Gson gson = new Gson();
        String user = GlobalStorage.getGlobalStorage().get("user");
        if (user==null)return null;
        return gson.fromJson(user,User.class);
    }
}
