package jnpf.cultivate.fallback;

import jnpf.cultivate.FtbCultivateTeachingApi;
import jnpf.model.cultivate.vo.teaching.MyPracticeSummaryVo;
import jnpf.model.cultivate.vo.teaching.SuperiorTeachingSummaryVo;
import jnpf.model.cultivate.vo.teaching.TeachingStoreCountVo;
import jnpf.model.cultivate.vo.teaching.TodaySummaryDataVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class FtbCultivateTeachingApiFallback implements FallbackFactory<FtbCultivateTeachingApi> {

    @Override
    public FtbCultivateTeachingApi create(Throwable cause) {
        cause.printStackTrace();
        return new FtbCultivateTeachingApi() {

            @Override
            public TeachingStoreCountVo storeTeachingCount(String storeId) {
                return null;
            }

            @Override
            public TodaySummaryDataVo getTodaySummary(String storeId) {
                return new TodaySummaryDataVo();
            }

            @Override
            public SuperiorTeachingSummaryVo getSuperiorTeachingSummary(String storeId) {
                return null;
            }

            @Override
            public MyPracticeSummaryVo getMyPracticeSummary(String storeId) {
                return null;
            }
        };
    }
}
