package cn.axzo.msg.center.api.fallback;

import cn.axzo.msg.center.api.PendingMessageServiceApi;
import cn.axzo.msg.center.api.request.PendingMessagePageReq;
import cn.axzo.msg.center.api.request.PendingMessageTemporarilyStatisticReq;
import cn.axzo.msg.center.api.response.PendingMessageBriefRes;
import cn.axzo.msg.center.api.response.PendingMessageStatisticRes;
import cn.axzo.msg.center.api.response.PendingMessageTemporarilyStatisticRes;
import cn.axzo.msg.center.api.response.PendingMessageTemporarilyTypeRes;
import cn.azxo.framework.common.model.CommonResponse;
import cn.azxo.framework.common.model.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @description
 *   待办消息接口请求失败时的降级处理
 *
 * @author cold_blade
 * @date 2023/8/30
 * @version 1.0
 */

@Slf4j
@Component
public class PendingMessageServiceApiFallBack implements PendingMessageServiceApi {

    @Override
    public CommonResponse<List<PendingMessageTemporarilyStatisticRes>> temporarilyStatistic(
            PendingMessageTemporarilyStatisticReq request) {
        log.error("调用统计待办消息的接口时发送异常...... request={}", request);
        return CommonResponse.error("调用统计待办消息的接口时发送异常");
    }

    @Override
    public CommonResponse<PendingMessageStatisticRes> temporarilyPage(PendingMessagePageReq request) {
        log.error("调用分页查询待办消息的接口时发送异常...... request={}", request);
        return CommonResponse.error("调用分页查询待办消息的接口时发送异常");
    }

    @Override
    public CommonResponse<List<PendingMessageTemporarilyTypeRes>> listTemporarilyTypes() {
        log.error("调用列表查询待办消息临时分类的接口时发送异常......");
        return CommonResponse.error("调用列表查询待办消息临时分类的接口时发送异常");
    }

    @Override
    public CommonResponse<Page<PendingMessageBriefRes>> pageQuery(PendingMessagePageReq request) {
        log.error("调用分页查询待办消息接口时发送异常......");
        return CommonResponse.error("调用分页查询待办消息接口时发送异常");
    }
}
