6 changed files with 114 additions and 6 deletions
			
			
		@ -0,0 +1,22 @@ | 
				
			|||||
 | 
					package com.epmet.feign; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					import com.epmet.commons.tools.constant.ServiceConstant; | 
				
			||||
 | 
					import com.epmet.commons.tools.page.PageData; | 
				
			||||
 | 
					import com.epmet.commons.tools.utils.Result; | 
				
			||||
 | 
					import com.epmet.dto.result.CustomerGridListResultDTO; | 
				
			||||
 | 
					import com.epmet.feign.impl.GovOrgFeginFallBack; | 
				
			||||
 | 
					import org.springframework.cloud.openfeign.FeignClient; | 
				
			||||
 | 
					import org.springframework.http.MediaType; | 
				
			||||
 | 
					import org.springframework.web.bind.annotation.PathVariable; | 
				
			||||
 | 
					import org.springframework.web.bind.annotation.PostMapping; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					/** | 
				
			||||
 | 
					 * Created by 11 on 2020/3/17. | 
				
			||||
 | 
					 */ | 
				
			||||
 | 
					@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeginFallBack.class) | 
				
			||||
 | 
					public interface GovOrgFeignClient { | 
				
			||||
 | 
					    @PostMapping(value = "/gov/org/customergrid/{areaCode}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) | 
				
			||||
 | 
					    Result<PageData<CustomerGridListResultDTO>> getPageForStrangerGuideInterface(@PathVariable("areaCode")String areaCode); | 
				
			||||
 | 
					} | 
				
			||||
@ -0,0 +1,29 @@ | 
				
			|||||
 | 
					package com.epmet.feign.impl;/** | 
				
			||||
 | 
					 * Created by 11 on 2020/3/17. | 
				
			||||
 | 
					 */ | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					import com.epmet.commons.tools.constant.ServiceConstant; | 
				
			||||
 | 
					import com.epmet.commons.tools.page.PageData; | 
				
			||||
 | 
					import com.epmet.commons.tools.utils.ModuleUtils; | 
				
			||||
 | 
					import com.epmet.commons.tools.utils.Result; | 
				
			||||
 | 
					import com.epmet.dto.CustomerGridListQueryDTO; | 
				
			||||
 | 
					import com.epmet.dto.result.CustomerGridListResultDTO; | 
				
			||||
 | 
					import com.epmet.feign.GovOrgFeignClient; | 
				
			||||
 | 
					import org.springframework.stereotype.Component; | 
				
			||||
 | 
					import org.springframework.stereotype.Controller; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					/** | 
				
			||||
 | 
					 * @Description | 
				
			||||
 | 
					 * @ClassName GovOrgFeginFallBack | 
				
			||||
 | 
					 * @Author wangc | 
				
			||||
 | 
					 * @date 2020.03.17 14:29 | 
				
			||||
 | 
					 */ | 
				
			||||
 | 
					@Component | 
				
			||||
 | 
					public class GovOrgFeginFallBack implements GovOrgFeignClient { | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @Override | 
				
			||||
 | 
					    public Result<PageData<CustomerGridListResultDTO>> getPageForStrangerGuideInterface(String areaCode) { | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListByAreaCodeOrderBy",areaCode); | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					} | 
				
			||||
					Loading…
					
					
				
		Reference in new issue