All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.net.wanmo.plugin.wechat.officialaccount.pojo.WechatBaseRes Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package cn.net.wanmo.plugin.wechat.officialaccount.pojo;

import cn.net.wanmo.common.send.BaseRes;
import cn.net.wanmo.common.send.BodyType;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;

public class WechatBaseRes extends BaseRes {

    @Override
    protected void initData() {

    }

    public WechatBaseRes() {
        super();
        this.bodyType = BodyType.obj;
    }

    @Override
    public BaseRes parseCodeMsg(String resBody) {
        JSONObject object = JSONObject.parseObject(resBody);
        this.errCode = object.getIntValue("errcode");
        this.errMsg = object.getString("errmsg");

        return this;
    }


    @Override
    public Integer successDataCode() {
        return 0;
    }

    @Override
    public boolean isSuccessData() {
        return successDataCode().intValue() == getErrCode().intValue();
    }


    @Override
    public String toJSONString() {
        return JSON.toJSONString(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy