package cn.axzo.msg.center.service.bizevent.client.fallback;

import cn.axzo.msg.center.service.bizevent.client.BizEventMappingClient;
import cn.axzo.msg.center.service.bizevent.request.BizEventMappingCreateRequest;
import cn.axzo.msg.center.service.bizevent.request.BizEventMappingPageRequest;
import cn.axzo.msg.center.service.bizevent.request.BizEventMappingPageResponse;
import cn.axzo.msg.center.service.bizevent.request.BizEventMappingRemoveRequest;
import cn.axzo.msg.center.service.bizevent.request.BizEventMappingUpdateRequest;
import cn.azxo.framework.common.model.CommonResponse;
import cn.azxo.framework.common.model.Page;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class BizEventMappingClientFallback implements BizEventMappingClient {
    @Override
    public CommonResponse<String> save(BizEventMappingCreateRequest param) {
        log.error("fall back while adding bizEvent. request:{}", JSONUtil.toJsonStr(param));
        return CommonResponse.error("fall back while adding bizEvent");
    }

    @Override
    public CommonResponse<Void> update(BizEventMappingUpdateRequest param) {
        log.error("fall back while update bizEvent. request:{}", JSONUtil.toJsonStr(param));
        return CommonResponse.error("fall back while update bizEvent");
    }

    @Override
    public CommonResponse<Page<BizEventMappingPageResponse>> page(
            BizEventMappingPageRequest param) {
        log.error("fall back while page bizEvent. request:{}", JSONUtil.toJsonStr(param));
        return CommonResponse.error("fall back while page bizEvent");
    }

    @Override
    public CommonResponse<Void> remove(BizEventMappingRemoveRequest param) {
        log.error("fall back while remove bizEvent. request:{}", JSONUtil.toJsonStr(param));
        return CommonResponse.error("fall back while remove bizEvent");
    }
}
