package com.mosty.base.feign.fallback;

import com.alibaba.fastjson.JSONObject;
import com.mosty.base.model.dto.base.GetDeptListDTO;
import com.mosty.base.model.dto.base.GetSsbmDto;
import com.mosty.base.model.dto.base.SysDeptDTO;
import com.mosty.base.model.dto.base.SysMessageInfoInsertDto;
import com.mosty.base.feign.service.MostyBaseFeignService;
import com.mosty.base.model.query.base.GetSysDeptListQuery;
import com.mosty.base.model.query.base.SysDeptQuery;
import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.config.entity.vo.SysDictVO;
import com.mosty.common.core.business.entity.SysDept;
import com.mosty.common.core.business.entity.SysUser;
import com.mosty.common.core.business.entity.vo.SysUserDeptVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * 部门信息 rpc服务 降级处理
 *
 * @author kevin
 * @date 2022/7/6 10:30 上午
 * @since 1.0.0
 */
@Component
@Slf4j
public class SysDeptRemoteServiceFallback implements FallbackFactory<MostyBaseFeignService> {

    @Override
    public MostyBaseFeignService create(Throwable throwable) {
        return new MostyBaseFeignService() {
            @GetMapping("/sysDept/getChildDeptList")
            @Override
            public ResponseResult<SysDeptDTO> getDeptByOrgCode(String orgCode) {
                log.error("查询部门信息异常，{}", throwable.getMessage());

                return null;
            }

            @Override
            public ResponseResult<DeptInfoVo> getOrgByDeptId(String deptid) {
                log.error("查询部门信息异常，{}", throwable.getMessage());

                return null;
            }

            @Override
            public ResponseResult<DeptInfoVo> getOrgByOrgcode(String orgcode) {
                return null;
            }

            @Override
            public ResponseResult<List<SysUserDeptVO>> getUserAll(String deptId) {
                log.error("查询部门信息异常，{}", throwable.getMessage());
                return null;
            }

            @Override
            public ResponseResult<Integer> getUserCount(String deptid) {
                return null;
            }

            @Override
            public ResponseResult<List<DeptInfoVo>> getDeptAll() {
                log.error("查询所有的部门信息集合失败，{}", throwable.getMessage());
                return null;
            }

            @Override
            public ResponseResult<List<String>> getChildDept(String deptid) {
                log.error("查询部门下的所有子部门信息失败，{}", throwable.getMessage());
                return null;
            }

            @GetMapping("/mosty-base/sysDept/getChildDeptByOrgCode/{orgcode}")
            @Override
            public ResponseResult<List<String>> getChildDeptByOrgCode(String orgcode) {
                return null;
            }

            @Override
            public ResponseResult<List<DeptInfoVo>> getChildDept(GetDeptListDTO dto) {
                return null;
            }

            @Override
            public ResponseResult<Integer> sendMsg(SysMessageInfoInsertDto dto) {
                return null;
            }

            @Override
            public ResponseResult<List<SysUserDeptVO>> getUserList(String deptid) {
                return null;
            }

            @Override
            public ResponseResult<DeptInfoVo> getDeptInfoByUserId(String userId) {
                return null;
            }

            @Override
            public ResponseResult<SysUser> getUserInfo(String userId) {
                return null;
            }

            @Override
            public ResponseResult<String> getValue(String pzj) {
                return null;
            }

            @Override
            public ResponseResult<SysDictVO> getSysDictByCode(String dictCode) {
                return null;
            }

            @Override
            public ResponseResult<List<SysDeptDTO>> getPcsByFxjdm(String orgcode) {
                return null;
            }

            @Override
            public ResponseResult<SysUser> getUserInfoBySfzh(String sfzh) {
                return null;
            }

            @Override
            public ResponseResult<SysUser> getUserOrFjInfoBySfzh(String sfzh) {
                return null;
            }

            @GetMapping("/mosty-base/other/getAddress")
            @Override
            public ResponseResult<JSONObject> getAddress(String jd, String wd) {
                return null;
            }

            @Override
            public ResponseResult<JSONObject> getLzAddress(String jd, String wd) {
                return null;
            }

            @Override
            public ResponseResult<List<SysDept>> getOrg(SysDeptQuery deptQuery) {
                return null;
            }

            @GetMapping("/mosty-base/userDeptFeign/getDataPermission")
            @Override
            public ResponseResult<Boolean> getDataPermission(String sfz, String deptcode) {
                return null;
            }

            @Override
            public ResponseResult<String> getSsbm(GetSsbmDto dto) {
                return null;
            }

            @Override
            public ResponseResult<List<SysDept>> getOrganizationList(GetSysDeptListQuery query) {
                return null;
            }

            @Override
            public ResponseResult<SysDept> getSysDeptBySsbmdm(String ssbmdm) {
                return null;
            }

            @Override
            public ResponseResult<DeptInfoVo> getDeptInfoBySfzh(String sfzh) {
                return null;
            }

            @Override
            public ResponseResult<String> downloadBaes64(String id) {
                return null;
            }
        };
    }
}
