/**
* 获取设备列表
*
* @param depotId
* @return
*/
@RequestMapping(path = "/list", method = RequestMethod.GET)
public ResponseResult getDeviceList(String depotId) {
super.checkLoginUserAuth();
if ("null".equals(depotId)) {
depotId = null;
}
Map<String, String> params = Maps.newLinkedHashMap();
params.put("depotId", depotId);
LocalResponseResult responseResult = super.buildResponseResult(params);
//使用{}占位符,后面跟Object类型参数,这里使用Map<String,String>类型,里面存入了depotId
ResponseEntity<Map> response = this.restTemplate.getForEntity("/device?depotId={depotId}", Map.class, params);
if (response.getStatusCode() != HttpStatus.OK) {
return responseResult.result(response.getStatusCode());
}
return responseResult.result(HttpStatus.OK, response.getBody().get("content"));
}