package com.muyu.token;

import lombok.Data;

/**
 * @ClassName AccessToken
 * @Description 描述
 * @Author YiBo.Liu
 * @Date 2024/9/18 15:48
 */
@Data
public class AccessToken {

    private String access_token;

    private long expires_in;

    public void setExpiresTime(long expiresIn) {
        this.expires_in = System.currentTimeMillis()+expiresIn*1000;
    }

    /**
     * 判断是否超时
     * @return
     */
    public boolean isExpired() {
        return System.currentTimeMillis()>this.expires_in;
    }

}
