package com.yuchen.saas.parking.api.feign;

import com.yuchen.saas.parking.api.param.ReplacePlateNoRecordParam;
import com.yuchen.saas.parking.api.util.SaasParkingFeignFallbackUtils;
import com.yuchen.saas.parking.api.vo.ReplacePlateNoRecordPageVo;
import com.yuchen.saas.parking.api.vo.ReplacePlateNoRecordVo;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.mp.support.NestPage;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

/**
 * @Author yuanzhelin
 * @Date 2024/9/2 11:02
 * @Description TODO
 */
@Component
public class ReplacePlateNoRecordClientFallback implements FallbackFactory<ReplacePlateNoRecordClient>{
    @Override
    public ReplacePlateNoRecordClient create(Throwable throwable) {
        return new ReplacePlateNoRecordClient(){
            @Override
            public R<NestPage<ReplacePlateNoRecordPageVo>> getPage(Long parkId, Integer type, Long parkingId, Long ruleId, String personPhone, String isOwner, String plateNo, String personName, Integer reviewState, Boolean pending, Integer current, Integer size) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<ReplacePlateNoRecordVo> getReplacePlateNoDetail(Long id) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> auditReplace(ReplacePlateNoRecordParam param) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };
    }
}
