新增查询挡墙部门直属下级部门(没有下级部门返回当前部门)接口

This commit is contained in:
huangzj
2023-01-11 10:48:31 +08:00
parent 81bb7c6468
commit de08816b36
5 changed files with 75 additions and 5 deletions

View File

@@ -18,7 +18,9 @@ import java.util.List;
* @date 2022/1/11
* 部门相关业务对外接口
*/
@FeignClient(value = ServerInfo.USER, path = "/dept", fallbackFactory = DeptFeignClientFallbackFactory.class)
@FeignClient(value = ServerInfo.USER,
// url = "http://127.0.0.1:10201",
path = "/dept", fallbackFactory = DeptFeignClientFallbackFactory.class)
public interface DeptFeignClient {
/**
@@ -103,4 +105,14 @@ public interface DeptFeignClient {
*/
@GetMapping("/getRootDept")
HttpResult<Dept> getRootDept();
/**
* @Description: 获取当前部门的的下级子部门list如果没子部门就是返回当前部门
* @Param: [deptId]
* @return: com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.user.pojo.po.Dept>>
* @Author: clam
* @Date: 2023/1/10
*/
@GetMapping("/getDepSonDetailIdByDeptId")
HttpResult<List<DeptDTO>> getDepSonDetailByDeptId(@RequestParam("deptId")String deptId) ;
}

View File

@@ -111,6 +111,12 @@ public class DeptFeignClientFallbackFactory implements FallbackFactory<DeptFeign
log.error("{}异常,降级处理,异常为:{}","查询根部门异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<DeptDTO>> getDepSonDetailByDeptId(String deptId) {
log.error("{}异常,降级处理,异常为:{}","查询前部门的的下级子部门list(如果没子部门就是返回当前部门)",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}