8 changed files with 85 additions and 2 deletions
@ -0,0 +1,25 @@ |
|||||
|
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.CustomerGridDTO; |
||||
|
import com.epmet.feign.impl.GovOrgFeignClientFallBack; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
|
||||
|
/** |
||||
|
* Created by 11 on 2020/3/18. |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class, url="http://localhost:8092") |
||||
|
public interface GovOrgFeignClient { |
||||
|
|
||||
|
|
||||
|
@GetMapping("gov/org/customergrid/page") |
||||
|
Result<PageData<CustomerGridDTO>> page(); |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.feign.impl;/** |
||||
|
* Created by 11 on 2020/3/18. |
||||
|
*/ |
||||
|
|
||||
|
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.CustomerGridDTO; |
||||
|
import com.epmet.feign.GovOrgFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @ClassName GovOrgFeignClientFallBack |
||||
|
* @Author wangc |
||||
|
* @date 2020.03.18 14:52 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GovOrgFeignClientFallBack implements GovOrgFeignClient{ |
||||
|
@Override |
||||
|
public Result<PageData<CustomerGridDTO>> page() { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "page"); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue