package com.yida.data.customForm.fallback;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.customForm.feign.RemoteFormService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * RemoteFormServiceFallback fallback处理类
 *
 * @author ZYJ
 * @date 2022/8/26
 */
@Slf4j
@Fallback
public class RemoteFormServiceFallback implements FallbackFactory<RemoteFormService> {

    @Override
    public RemoteFormService create(Throwable throwable) {
        log.error("RemoteFormServiceFallback fallback reason:{}", throwable.getMessage());

        return new RemoteFormService() {
            /**
             * 修改为发布
             *
             * @param id
             * @return
             */
            @Override
            public ResultBean updateById(Long id) {
                return null;
            }

            /**
             * 提醒填报
             *
             * @param id
             * @return
             */
            @Override
            public ResultBean remindLast(Long id) {
                return null;
            }
        };
    }
}
