package com.yida.data.user.fallback;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.user.EduUserFace;
import com.yida.data.user.dto.UpdateFaceGroupUserStatusDTO;
import com.yida.data.user.feign.RemoteUserFaceService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

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

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

        return new RemoteUserFaceService() {
            @Override
            public ResultBean<EduUserFace> getFaceByUser(Long userId, Integer type) {
                return null;
            }

            @Override
            public ResultBean delFaceByUser(Long userId, Integer type) {
                return null;
            }

            @Override
            public ResultBean updateFaceGroupUserStatus(UpdateFaceGroupUserStatusDTO dto) {
                return null;
            }
        };
    }
}
