package com.sooka.sponest.monitor.remoteapi.fallback.center.system;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysDept;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import com.sooka.sponest.monitor.remoteapi.service.center.system.RemoteService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @program: ruoyi
 * @description: yy
 * @author: yy
 * @create: 2022-06-16 11:05
 **/
@Component
public class RemoteSystemBaseServiceFallbackFactory implements FallbackFactory<RemoteService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class);

    @Override
    public RemoteService create(Throwable cause) {
        log.error("消息中心-服务调用失败:{}", cause.getMessage());

        return new RemoteService() {
            /**
             * 获取大华账号密码
             */
            @Override
            public R<SysUser> selectById(Long userId) {
                return null;
            }

            /**
             * 获取系统用户
             *
             * @param user
             * @return com.ruoyi.common.core.domain.R<java.util.List < com.ruoyi.system.api.domain.SysUser>>
             * @author pengyu
             * @date 2023/3/8 16:27
             **/
            @Override
            public R<List<SysUser>> userFeginlist(SysUser user) {
                return null;
            }

            /**
             * 获取系统参数配置
             *
             * @return com.ruoyi.common.core.domain.R<java.lang.String>
             * @author pengyu
             * @date 2023/3/8 16:27
             **/
            @Override
            public R<String> selectConfigKey_insectPestsUrl() {
                return null;
            }

            /**
             * 获取参数配置_文件地址
             */
            @Override
            public R<String> selectConfigKey_fileUrl() {
                return null;
            }

            /**
             * 获取参数配置
             */
            @Override
            public R<String> remotegetConfigKey(String configKey) {
                return null;
            }

            /**
             * 根据用户名查询dept_id, parent_id, ancestors, dept_name
             */
            @Override
            public R<SysDept> findDeptIdByUserName(String userName) {
                return null;
            }

            /**
             * 根据DEPT_ID查询下级的乡镇或区县部门列表，如果传入市级部门则查询区县，如果传入区县部门则查询乡镇街道（不带数据权限）
             *
             * @param dept 部门id
             * @return 部门信息集合
             */
            @Override
            public R<List<SysDept>> selectChildrenCountyOrVillagesDeptListByDeptId(Long dept) {
                return null;
            }


        };
    }
}
