package com.jeeplus.sys.factory;

import com.jeeplus.sys.domain.WorkAttachmentInfo;
import com.jeeplus.sys.feign.IWorkAttachmentApi;
import com.jeeplus.sys.service.dto.WorkAttachmentInfoDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

/**
 * 用户服务降级处理
 *
 * @author jeeplus
 */
@Slf4j
@Component
public class WorkAttachmentApiFallbackFactory implements FallbackFactory <IWorkAttachmentApi> {
    @Override
    public IWorkAttachmentApi create(Throwable throwable) {
        log.error ( "附件服务调用失败:{}", throwable.getMessage ( ) );
        throwable.printStackTrace ( );
        return new IWorkAttachmentApi( ) {

            @Override
            public List<WorkAttachmentInfo> selectWorkAttachmentByAttachmentId(String id) {
                return null;
            }

            @Override
            public void insertWorkAttachment(Map<String, String> map) {

            }

            @Override
            public void deleteById(String id) {

            }

            @Override
            public void deleteByAttachmentId(String attachmentId) {

            }

            @Override
            public void deleteByAttachmentIdNotInIds(String attachmentId, List<String> delIds) {

            }

            @Override
            public void saveOrUpdateFileListFlag(Map<String, String> map) {

            }

            @Override
            public void saveOrUpdateFileList(Map<String, String> map) {

            }

            @Override
            public List<WorkAttachmentInfo> selectListByAttachmentId(String attachmentId) {
                return null;
            }

            @Override
            public void deleteByIds(String ids) {

            }

            @Override
            public String saveFile(Map<String, String> map) {
                return null;
            }

            @Override
            public void downByStreamSaveLocal(String key, String fileName, String downFileStr) {

            }

            public byte[] downBytesByStream(String key, String fileName) {
                return null;
            }

            @Override
            public String genSerialNum(String companyId, String bizCode,String currentToken) {
                return null;
            }

            @Override
            public String genSerialNumNoSort(String companyId, String bizCode,String currentToken) throws Exception {
                return null;
            }

            @Override
            public String genSerialReviewNum(String companyId, String bizCode, String currentToken) throws Exception {
                return null;
            }

            @Override
            public List<WorkAttachmentInfo> getByAttachmentIdAndUrlAndAttachmentFlag(WorkAttachmentInfo workattachment) {
                return null;
            }

            @Override
            public void downQzByStreamSaveLocal(String key, String fileName, String downFileStr) {

            }

            @Override
            public String datePath() {
                return null;
            }

            @Override
            public String uploadFile2OSS(InputStream inStream, String fileDir, String fileName) {
                return null;
            }
            @Override
            public String uploadFileSignatureOSS(String filePath, String fileDir, String fileName) {
                return null;
            }

            @Override
            public void saveMsg2(Map<String, String> map) {

            }

            @Override
            public Map<String, String> disposeElectronicEngineeringInvoice(List<String> attachmentIdList, String type) {
                return null;
            }

            @Override
            public Map<String, String> disposeElectronicEngineeringInvoiceNumber(List<String> attachmentIdList, String type) {
                return null;
            }

        };
    }
}
