forked from luyan/epmet-cloud-lingshan
				
			
				 21 changed files with 272 additions and 117 deletions
			
			
		| @ -0,0 +1,30 @@ | |||||
|  | package com.epmet.feign; | ||||
|  | 
 | ||||
|  | import com.epmet.commons.tools.constant.ServiceConstant; | ||||
|  | import com.epmet.commons.tools.utils.Result; | ||||
|  | import com.epmet.dto.CustomerStaffDTO; | ||||
|  | import com.epmet.feign.fallback.EpmetUserFeignClientFallback; | ||||
|  | import org.springframework.cloud.openfeign.FeignClient; | ||||
|  | import org.springframework.web.bind.annotation.GetMapping; | ||||
|  | import org.springframework.web.bind.annotation.PathVariable; | ||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||
|  | 
 | ||||
|  | /** | ||||
|  |  * @author zhaoqifeng | ||||
|  |  * @dscription | ||||
|  |  * @date 2020/3/19 9:32 | ||||
|  |  */ | ||||
|  | @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) | ||||
|  | public interface EpmetUserFeignClient { | ||||
|  | 	/** | ||||
|  | 	 * 根据用户ID获取工作人员基本信息 | ||||
|  | 	 * | ||||
|  | 	 * @param formDTO | ||||
|  | 	 * @return Result<CustomerStaffDTO> | ||||
|  | 	 * @author zhaoqifeng | ||||
|  | 	 * @date 2020/4/22 10:05 | ||||
|  | 	 **/ | ||||
|  | 	@PostMapping(value = "/epmetuser/customerstaff/getstaffinfobyuserid") | ||||
|  | 	Result<CustomerStaffDTO> getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO); | ||||
|  | 
 | ||||
|  | } | ||||
| @ -0,0 +1,25 @@ | |||||
|  | package com.epmet.feign; | ||||
|  | 
 | ||||
|  | import com.epmet.commons.tools.constant.ServiceConstant; | ||||
|  | import com.epmet.commons.tools.utils.Result; | ||||
|  | import com.epmet.dto.CustomerDTO; | ||||
|  | import com.epmet.feign.fallback.OperCrmFeignClientFallBack; | ||||
|  | import org.springframework.cloud.openfeign.FeignClient; | ||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||
|  | import org.springframework.web.bind.annotation.RequestBody; | ||||
|  | 
 | ||||
|  | /** | ||||
|  |  * @author zhaoqifeng | ||||
|  |  * @dscription | ||||
|  |  * @date 2020/4/22 10:41 | ||||
|  |  */ | ||||
|  | @FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmFeignClientFallBack.class) | ||||
|  | public interface OperCrmFeignClient { | ||||
|  | 	/** | ||||
|  | 	 * 获取客户信息 | ||||
|  | 	 * @param dto | ||||
|  | 	 * @return | ||||
|  | 	 */ | ||||
|  | 	@PostMapping("/oper/crm/customer/getcostomerInfo") | ||||
|  | 	Result<CustomerDTO> getCustomerInfo(@RequestBody CustomerDTO dto); | ||||
|  | } | ||||
| @ -0,0 +1,23 @@ | |||||
|  | 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.CustomerStaffDTO; | ||||
|  | import com.epmet.dto.OperUserDTO; | ||||
|  | import com.epmet.feign.EpmetUserFeignClient; | ||||
|  | import org.springframework.stereotype.Component; | ||||
|  | 
 | ||||
|  | /** | ||||
|  |  * 用户模块 | ||||
|  |  * @author zhaoqifeng | ||||
|  |  * @date 2020/3/19 9:34 | ||||
|  |  */ | ||||
|  | @Component | ||||
|  | public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { | ||||
|  | 
 | ||||
|  | 	@Override | ||||
|  | 	public Result<CustomerStaffDTO> getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { | ||||
|  | 		return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerStaffInfoByUserId", formDTO); | ||||
|  | 	} | ||||
|  | } | ||||
| @ -0,0 +1,21 @@ | |||||
|  | 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.CustomerDTO; | ||||
|  | import com.epmet.feign.OperCrmFeignClient; | ||||
|  | import org.springframework.stereotype.Component; | ||||
|  | 
 | ||||
|  | /** | ||||
|  |  * @author zhaoqifeng | ||||
|  |  * @dscription | ||||
|  |  * @date 2020/4/22 10:43 | ||||
|  |  */ | ||||
|  | @Component | ||||
|  | public class OperCrmFeignClientFallBack implements OperCrmFeignClient { | ||||
|  | 	@Override | ||||
|  | 	public Result<CustomerDTO> getCustomerInfo(CustomerDTO dto) { | ||||
|  | 		return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerInfo", dto); | ||||
|  | 	} | ||||
|  | } | ||||
					Loading…
					
					
				
		Reference in new issue