forked from luyan/epmet-cloud-lingshan
				
			
				 3 changed files with 97 additions and 0 deletions
			
			
		| @ -0,0 +1,56 @@ | |||||
|  | package com.epmet.dto.result; | ||||
|  | 
 | ||||
|  | import lombok.Data; | ||||
|  | 
 | ||||
|  | import java.util.Set; | ||||
|  | 
 | ||||
|  | @Data | ||||
|  | public class LoginUserDetailsResultDTO { | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 政府端:gov、居民端:resi、运营端:oper | ||||
|  |      */ | ||||
|  |     private String app; | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * PC端:web、微信小程序:wxmp | ||||
|  |      */ | ||||
|  |     private String client; | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 用户ID | ||||
|  |      */ | ||||
|  |     private String userId; | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 角色列表 | ||||
|  |      */ | ||||
|  |     private Set<String> roleIdList; | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 部门id列表 | ||||
|  |      */ | ||||
|  |     private Set<String> deptIdList; | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 当前登录的组织id(顶级) | ||||
|  |      */ | ||||
|  |     private String agencyId; | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 组织ID | ||||
|  |      */ | ||||
|  |     private String orgIdPath; | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 网格ID列表 | ||||
|  |      */ | ||||
|  |     private Set<String> gridIdList; | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 当前工作人员进入的客户id | ||||
|  |      */ | ||||
|  |     private String customerId; | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | } | ||||
| @ -0,0 +1,23 @@ | |||||
|  | package com.epmet.feign; | ||||
|  | 
 | ||||
|  | import com.epmet.commons.tools.constant.ServiceConstant; | ||||
|  | import com.epmet.commons.tools.utils.Result; | ||||
|  | import com.epmet.dto.form.LoginUserDetailsFormDTO; | ||||
|  | import com.epmet.dto.result.LoginUserDetailsResultDTO; | ||||
|  | import com.epmet.feign.fallback.EpmetUserClientFeignClientFallback; | ||||
|  | import org.springframework.cloud.openfeign.FeignClient; | ||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||
|  | import org.springframework.web.bind.annotation.RequestBody; | ||||
|  | 
 | ||||
|  | @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserClientFeignClientFallback.class) | ||||
|  | //@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserClientFeignClientFallback.class, url = "localhost:8087")
 | ||||
|  | public interface EpmetUserClientFeignClient { | ||||
|  | 
 | ||||
|  |     /** | ||||
|  |      * 从缓存中查询已登录用户的基本信息以及角色等相关信息 | ||||
|  |      * @return | ||||
|  |      */ | ||||
|  |     @PostMapping("/epmetuser/user/loginuserdetails") | ||||
|  |     Result<LoginUserDetailsResultDTO> getLoginUserDetails(@RequestBody LoginUserDetailsFormDTO dto); | ||||
|  | 
 | ||||
|  | } | ||||
| @ -0,0 +1,18 @@ | |||||
|  | package com.epmet.feign.fallback; | ||||
|  | 
 | ||||
|  | import com.epmet.commons.tools.constant.ServiceConstant; | ||||
|  | import com.epmet.commons.tools.utils.ModuleUtils; | ||||
|  | import com.epmet.commons.tools.utils.Result; | ||||
|  | import com.epmet.dto.form.LoginUserDetailsFormDTO; | ||||
|  | import com.epmet.dto.result.LoginUserDetailsResultDTO; | ||||
|  | import com.epmet.feign.EpmetUserClientFeignClient; | ||||
|  | import org.springframework.stereotype.Component; | ||||
|  | 
 | ||||
|  | @Component | ||||
|  | public class EpmetUserClientFeignClientFallback implements EpmetUserClientFeignClient { | ||||
|  | 
 | ||||
|  |     @Override | ||||
|  |     public Result<LoginUserDetailsResultDTO> getLoginUserDetails(LoginUserDetailsFormDTO dto) { | ||||
|  |         return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLoginUserDetails", dto); | ||||
|  |     } | ||||
|  | } | ||||
					Loading…
					
					
				
		Reference in new issue