package org.shunt.service.bean;


import java.io.Serializable;
import java.util.Date;

/**
 * 微信网页授权access_token信息
 */
public class WechatAccess implements Serializable {

    private static final long serialVersionUID = 6571363417369764704L;
    private String app;
    private String accessToken;
    private Long expiresIn;
    private Date createTime;

    public WechatAccess() {
    }

    public WechatAccess(String app, String accessToken, Long expiresIn, Date createTime) {
        this.app = app;
        this.accessToken = accessToken;
        this.expiresIn = expiresIn;
        this.createTime = createTime != null ? new Date(createTime.getTime()) : null;
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getAccessToken() {
        return accessToken;
    }

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

    public Long getExpiresIn() {
        return expiresIn;
    }

    public void setExpiresIn(Long expiresIn) {
        this.expiresIn = expiresIn;
    }

    public Date getCreateTime() {
        if(createTime == null){
            return null;
        }
        return new Date(createTime.getTime());
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime != null ? new Date(createTime.getTime()) : null;
    }
}
