package com.muyu.domain;

import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;

/**
 * 连接微信服务器(微信公众号)
 */
@Data
@Tag(name = "连接微信服务器")
public class AccessToken {

    private String access_token;

    private Long expires_in;

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

    public boolean isExpired(Long expiresIn){
        long now = System.currentTimeMillis();
        return now>expiresIn;
    }
}
