package com.njzscloud.common.wechat.result;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

@Getter
@Setter
@ToString
@Accessors(chain = true)
public class Code2SessionResult {
    private String session_key;
    private String unionid;
    private String openid;
    private String errmsg;
    private Integer errcode;

    public boolean isSucc() {
        return (errcode != null && errcode == 0) || StrUtil.isNotBlank(openid);
    }
}
