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

import cn.axzo.msg.center.api.request.CmsMsgQueryReq;
import cn.axzo.msg.center.api.response.MessageNewRes;
import cn.axzo.msg.center.service.general.client.GeneralMessageClient;
import cn.axzo.msg.center.service.general.request.GeneralMessageOldDataStatisticRequest;
import cn.axzo.msg.center.service.general.request.GeneralMessageSendRequest;
import cn.axzo.msg.center.service.general.request.OldMsgStatWithMultiIdentifiesRequest;
import cn.axzo.msg.center.service.general.response.GeneralMessageOldDataStatisticResponse;
import cn.azxo.framework.common.model.CommonResponse;
import cn.azxo.framework.common.model.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author cold_blade
 * @date 2023/10/18
 * @version 1.0
 */
@Slf4j
@Component
public class GeneralMessageClientFallback implements GeneralMessageClient {

    @Override
    public CommonResponse<Void> batchSend(GeneralMessageSendRequest request) {
        log.error("fall back while batch sending im message. req:{}", request);
        return CommonResponse.error("fall back while batch sending im message");
    }

    @Override
    public CommonResponse<GeneralMessageOldDataStatisticResponse> statisticOldData(
            GeneralMessageOldDataStatisticRequest request) {
        log.error("fall back while statistic old message. req:{}", request);
        return CommonResponse.error("fall back while statistic old message");
    }

    @Override
    public CommonResponse<Integer> countOldMsgUnreadWithIdentities(OldMsgStatWithMultiIdentifiesRequest request) {
        log.error("fall back while counting unread old message with multi identifies. request:{}", request);
        return CommonResponse.error("fall back while counting unread old message with multi identifies");
    }

    @Override
    public CommonResponse<Page<MessageNewRes>> pageQueryOldMessage(CmsMsgQueryReq request) {
        log.error("fall back while statistic old message. request:{}", request);
        return CommonResponse.error("fall back while statistic old message");
    }

    @Override
    public CommonResponse<Integer> countUnreadFromOldMessage(GeneralMessageOldDataStatisticRequest request) {
        return CommonResponse.error("not supported!");
    }
}
