package com.yida.data.attendance.fallback;

import com.yida.data.attendance.dto.AddLeaveRequestStrategyDTO;
import com.yida.data.attendance.feign.RemoteAttendanceStrategyService;
import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.user.EduFaceGroupStrategy;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

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

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

        return new RemoteAttendanceStrategyService() {

            /**
             * 保存策略并绑定人员信息
             *
             * @param eduFaceGroupStrategy 人脸组-策略信息
             * @return com.yida.data.common.core.common.ResultBean<java.lang.String>
             * @author ZYJ
             * @date 2022/12/13 10:51
             */
            @Override
            public ResultBean<String> saveStrategyAndUser(EduFaceGroupStrategy eduFaceGroupStrategy) {
                return null;
            }

            /**
             * 删除策略
             *
             * @param eduFaceGroupStrategy 人脸策略信息
             * @return com.yida.data.common.core.common.ResultBean<java.lang.String>
             * @author ZYJ
             * @date 2022/12/21 15:44
             */
            @Override
            public ResultBean<String> deleteStrategy(EduFaceGroupStrategy eduFaceGroupStrategy) {
                return null;
            }

            /**
             * 绑定对应的人员-策略信息
             *
             * @param eduFaceGroupStrategy 人脸策略信息
             * @return com.yida.data.common.core.common.ResultBean<java.lang.String>
             * @author ZYJ
             * @date 2022/12/22 16:25
             */
            @Override
            public ResultBean<String> bindUserStrategy(EduFaceGroupStrategy eduFaceGroupStrategy) {
                return null;
            }

            /**
             * 解绑对应的人员-策略信息
             *
             * @param eduFaceGroupStrategy 人脸策略信息
             * @return com.yida.data.common.core.common.ResultBean<java.lang.String>
             * @author ZYJ
             * @date 2022/12/26 10:16
             */
            @Override
            public ResultBean<String> unBindUserStrategy(EduFaceGroupStrategy eduFaceGroupStrategy) {
                return null;
            }

            /**
             * 删除并保存策略
             *
             * @param eduFaceGroupStrategy 人脸策略信息
             * @return com.yida.data.common.core.common.ResultBean<java.lang.String>
             * @author ZYJ
             * @date 2023/1/9 15:12
             */
            @Override
            public ResultBean<String> deleteAndSaveStrategy(EduFaceGroupStrategy eduFaceGroupStrategy) {
                return null;
            }

            /**
             * 添加请假类型短策略
             *
             * @param dto 添加请假类型短策略请求类
             * @return com.yida.data.common.core.common.ResultBean<java.lang.String>
             * @author ZYJ
             * @date 2023/2/2 16:00
             */
            @Override
            public ResultBean<String> addLeaveRequestStrategy(AddLeaveRequestStrategyDTO dto) {
                return null;
            }
        };
    }
}
