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

cn.woodwhales.common.webhook.executor.WeComWebhookExecutor Maven / Gradle / Ivy

There is a newer version: 3.8.3
Show newest version
package cn.woodwhales.common.webhook.executor;

import cn.woodwhales.common.webhook.enums.WebhookProductEnum;
import cn.woodwhales.common.webhook.model.request.BaseWebhookRequestBody;
import cn.woodwhales.common.webhook.model.request.WeComRequestBody;
import cn.woodwhales.common.webhook.model.response.WeComResponse;
import cn.woodwhales.common.webhook.model.response.ExecuteResponse;

import java.util.Objects;

/**
 * @author woodwhales on 2021-07-19 11:32
 */
public class WeComWebhookExecutor extends BaseWebhookExecutor {

    private static final int ERR_CODE_SUCCESS = 0;

    public static  WeComWebhookExecutor newInstance() {
        return new WeComWebhookExecutor();
    }

    @Override
    protected boolean checkResponseObjectHandler(ExecuteResponse executeResponse) {
        WeComResponse weComResponse = executeResponse.parsedResponseObject;
        return Objects.equals(ERR_CODE_SUCCESS, weComResponse.getErrcode());
    }

    @Override
    protected WebhookProductEnum webhookProductEnum() {
        return WebhookProductEnum.WE_COM;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy