Commit fd40ee3b authored by linruibiao's avatar linruibiao

接口编写

parent df6946ce
...@@ -123,8 +123,6 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper, ...@@ -123,8 +123,6 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
if(StringUtils.isBlank(filed)){ if(StringUtils.isBlank(filed)){
throw new SysException("对应检索字段必填"); throw new SysException("对应检索字段必填");
} }
Map<String, String> heads = Maps.newHashMap();
heads.put("X-Token", currentUser.getToken());
Map<String, Object> uriVariables = Maps.newHashMap(); Map<String, Object> uriVariables = Maps.newHashMap();
uriVariables.put("appId", currentUser.getAppId()); uriVariables.put("appId", currentUser.getAppId());
uriVariables.put("filed", filed); uriVariables.put("filed", filed);
...@@ -133,7 +131,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper, ...@@ -133,7 +131,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
uriVariables.put("size", size); uriVariables.put("size", size);
uriVariables.put("name", name); uriVariables.put("name", name);
IPage<String> page = new Page<>(current,size); IPage<String> page = new Page<>(current,size);
R<Map<String,Object>> result = RestTemplateUtils.get(uri, heads, new TypeToken<R<Map<String,Object>>>() {}.getType(), uriVariables); R<Map<String,Object>> result = RestTemplateUtils.get(uri, new TypeToken<R<Map<String,Object>>>() {}.getType(), uriVariables);
Map<String, Object> resultMaps = result.detach(); Map<String, Object> resultMaps = result.detach();
if(CollectionUtils.isNotEmpty(resultMaps)){ if(CollectionUtils.isNotEmpty(resultMaps)){
page.setTotal(new BigDecimal(resultMaps.get("total")+"").longValue()); page.setTotal(new BigDecimal(resultMaps.get("total")+"").longValue());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment