package com.ruoyi.excel.wecom.model;

import org.springframework.context.annotation.Configuration;

/**
 * 企业微信配置类
 */
@Configuration
public class WecomConfig {
    private String corpId = "ww4f2fd849224439be";
    private String corpSecret = "gsRCPzJuKsmxQVQlOjZWgYVCQMvNvliuUSJSbK8AWzk";
    private String accessToken;
    private long accessTokenExpireTime;

    public String getCorpId() {
        return corpId;
    }

    public void setCorpId(String corpId) {
        this.corpId = corpId;
    }

    public String getCorpSecret() {
        return corpSecret;
    }

    public void setCorpSecret(String corpSecret) {
        this.corpSecret = corpSecret;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public long getAccessTokenExpireTime() {
        return accessTokenExpireTime;
    }

    public void setAccessTokenExpireTime(long accessTokenExpireTime) {
        this.accessTokenExpireTime = accessTokenExpireTime;
    }

    /**
     * 检查accessToken是否过期
     *
     * @return 是否过期
     */
    public boolean isAccessTokenExpired() {
        return System.currentTimeMillis() > accessTokenExpireTime;
    }
}