old mode 100644
new mode 100755
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.client.RestTemplate; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Override |
| | | public ResultVo restartMachine(JSONObject paramIn) { |
| | | JSONObject postParameters = new JSONObject(); |
| | | postParameters.put("taskId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_machineTranslateId)); |
| | | postParameters.put("machineCode", paramIn.getString("machineCode")); |
| | | HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders(outRestTemplate)); |
| | | HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters.toJSONString(), getHeaders(outRestTemplate)); |
| | | ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.getUrl(IotConstant.RESTART_MACHINE), HttpMethod.POST, httpEntity, String.class); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return new ResultVo(ResultVo.CODE_ERROR, responseEntity.getBody()); |