forked from rongchao/epmet-cloud-rizhao
5 changed files with 72 additions and 2 deletions
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.modules.feign; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.form.UserEnterGridFormDTO; |
||||
|
import com.epmet.dto.result.UserInfoOnEnterGridResultDTO; |
||||
|
import com.epmet.modules.feign.fallback.ResiGuideFeignClientFallback; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
/** |
||||
|
* @Description TODO |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2020/5/18 15:13 |
||||
|
*/ |
||||
|
//,url = "http://localhost:8091"
|
||||
|
@FeignClient(name = ServiceConstant.RESI_GUIDE_SERVER, fallback = ResiGuideFeignClientFallback.class) |
||||
|
public interface ResiGuideFeignClient { |
||||
|
|
||||
|
@PostMapping("/resi/guide/user/entergrid") |
||||
|
Result<UserInfoOnEnterGridResultDTO> enterGrid(@RequestBody UserEnterGridFormDTO userEnterGridFormDTO); |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.modules.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.UserEnterGridFormDTO; |
||||
|
import com.epmet.dto.result.UserInfoOnEnterGridResultDTO; |
||||
|
import com.epmet.modules.feign.ResiGuideFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @Description TODO |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2020/5/18 15:14 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class ResiGuideFeignClientFallback implements ResiGuideFeignClient { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public Result<UserInfoOnEnterGridResultDTO> enterGrid(UserEnterGridFormDTO userEnterGridFormDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.RESI_GUIDE_SERVER,"enterGrid",userEnterGridFormDTO); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
Loading…
Reference in new issue