微服务架构中不同微服务之间的接口调用

假定系统管理微服务的实例名称为system,
在系统管理中查询码表 :/api/system/codeTable/queryDataDictionaryByDicCode


在自己的微服务中调用系统管理的查询码表接口写法如下:

DataDictionaryService
【微服务架构中不同微服务之间的接口调用】@AuthorizedFeignClient(name = "system",fallback = DataDictionaryServiceImpl.class)
public interface DataDictionaryService extends BaseService {
/**
* 根据dic_key获取value
* @param dto
* @return
*/
@RequestMapping(method= RequestMethod.POST,value="https://www.it610.com/api/system/codeTable/queryDataDictionaryByDicCode",consumes = "application/json")
ResponseDTO queryDataDictionaryByDicCode(@RequestBody DataDictionaryDTO dto);
}
----------------------------------------------------------------------------------------------------------------------------
DataDictionaryServiceImpl
@Service
public class DataDictionaryServiceImpl implements DataDictionaryService {
@Override
public ResponseDTO queryDataDictionaryByDicCode(DataDictionaryDTO dto) {
return new ResponseDTO("300","system==queryDataDictionaryByDicCode==调用失败");
}
}

    推荐阅读