3 changed files with 60 additions and 3 deletions
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.commons.tools.feign; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.feign.fallback.CommonAggFeignClientFallBackFactory; |
||||
|
import com.epmet.commons.tools.feign.fallback.CommonGovOrgFeignClientFallBackFactory; |
||||
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2022/3/17 1:42 下午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = CommonGovOrgFeignClientFallBackFactory.class) |
||||
|
public interface CommonGovOrgFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询网格信息 |
||||
|
* @param gridId |
||||
|
* @author zxc |
||||
|
* @date 2021/11/5 2:54 下午 |
||||
|
*/ |
||||
|
@PostMapping("/gov/org/grid/getbaseinfo") |
||||
|
Result<GridInfoCache> getGridInfo(@RequestParam("gridId")String gridId); |
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.commons.tools.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.feign.CommonGovOrgFeignClient; |
||||
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
||||
|
import com.epmet.commons.tools.utils.ModuleUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2022/3/17 1:46 下午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Component |
||||
|
public class CommonGovOrgFeignClientFallBackFactory implements CommonGovOrgFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public Result<GridInfoCache> getGridInfo(String gridId) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo", gridId); |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue