8 changed files with 109 additions and 12 deletions
			
			
		| @ -0,0 +1,42 @@ | |||
| package com.elink.esua.epdc.feign; | |||
| 
 | |||
| import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; | |||
| import com.elink.esua.epdc.commons.tools.utils.Result; | |||
| import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; | |||
| import com.elink.esua.epdc.feign.fallback.AdminFeignClientFallback; | |||
| import org.springframework.cloud.openfeign.FeignClient; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.PathVariable; | |||
| 
 | |||
| import java.util.List; | |||
| 
 | |||
| /** | |||
|  * @author yujintao | |||
|  * @email yujintao@elink-cn.com | |||
|  * @date 2019/9/5 14:44 | |||
|  */ | |||
| @FeignClient(name = ServiceConstant.EPDC_ADMIN_SERVER, fallback = AdminFeignClientFallback.class) | |||
| public interface AdminFeignClient { | |||
| 
 | |||
|     /** | |||
|      * 根据部门ID,获取下属所有网格ID | |||
|      * | |||
|      * @param pid | |||
|      * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < java.lang.Long>> | |||
|      * @author yujintao | |||
|      * @date 2019/9/5 14:49 | |||
|      */ | |||
|     @GetMapping("/sys/dept/listGridId/{pid}") | |||
|     Result<List<Long>> listGridIdByDeptPid(@PathVariable("pid") Long pid); | |||
| 
 | |||
|     /** | |||
|      * 根据部门ID获取上级所有部门信息 | |||
|      * | |||
|      * @param deptId | |||
|      * @return com.elink.esua.epdc.commons.tools.utils.Result<ParentAndAllDeptDTO> | |||
|      * @author gp | |||
|      * @date 2019-11-29 | |||
|      */ | |||
|     @GetMapping("/sys/dept/getParentAndAllDept/{deptId}") | |||
|     Result<ParentAndAllDeptDTO> getParentAndAllDept(@PathVariable("deptId") String deptId); | |||
| } | |||
| @ -0,0 +1,29 @@ | |||
| package com.elink.esua.epdc.feign.fallback; | |||
| 
 | |||
| import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; | |||
| import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; | |||
| import com.elink.esua.epdc.commons.tools.utils.Result; | |||
| import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; | |||
| import com.elink.esua.epdc.feign.AdminFeignClient; | |||
| import org.springframework.stereotype.Component; | |||
| 
 | |||
| import java.util.List; | |||
| 
 | |||
| /** | |||
|  * @author yujintao | |||
|  * @email yujintao@elink-cn.com | |||
|  * @date 2019/9/5 14:44 | |||
|  */ | |||
| @Component | |||
| public class AdminFeignClientFallback implements AdminFeignClient { | |||
| 
 | |||
|     @Override | |||
|     public Result<List<Long>> listGridIdByDeptPid(Long pid) { | |||
|         return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "listGridIdByDeptPid", pid); | |||
|     } | |||
| 
 | |||
|     @Override | |||
|     public Result<ParentAndAllDeptDTO> getParentAndAllDept(String depId) { | |||
|         return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", depId); | |||
|     } | |||
| } | |||
					Loading…
					
					
				
		Reference in new issue