|
|
|
@ -263,6 +263,9 @@ public class CmdServiceImpl implements CmdService {
|
|
|
|
|
case "i1_cmd_stop_aging_test":
|
|
|
|
|
this.stopagingtest(model);
|
|
|
|
|
break;
|
|
|
|
|
case "list_files":
|
|
|
|
|
this.listFiles(model);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
throw new ApiException("action无效");
|
|
|
|
|
}
|
|
|
|
@ -694,6 +697,34 @@ public class CmdServiceImpl implements CmdService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void listFiles(CmdModel model) {
|
|
|
|
|
if (CollectionUtils.isEmpty(model.getTermIds())) {
|
|
|
|
|
throw new ApiException("termIds不能为空");
|
|
|
|
|
} else if (StringUtils.isBlank(model.getPath())) {
|
|
|
|
|
throw new ApiException("path不能为空");
|
|
|
|
|
}
|
|
|
|
|
String name = "list_files";
|
|
|
|
|
|
|
|
|
|
for (Integer termId : model.getTermIds()) {
|
|
|
|
|
MntnCmdsExample example = new MntnCmdsExample();
|
|
|
|
|
MntnCmdsExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
criteria.andTermIdEqualTo(termId);
|
|
|
|
|
criteria.andNameEqualTo(name);
|
|
|
|
|
cmdsMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("path", model.getPath());
|
|
|
|
|
String json = JSONUtil.object2Json(map);
|
|
|
|
|
|
|
|
|
|
MntnCmds cmd = new MntnCmds();
|
|
|
|
|
cmd.setTermId(termId);
|
|
|
|
|
cmd.setName(name);
|
|
|
|
|
cmd.setCmd(json);
|
|
|
|
|
cmd.setCreateTime(new Date());
|
|
|
|
|
cmdsMapper.insert(cmd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void startfrpc(CmdModel model) {
|
|
|
|
|
if (model.getTermId() == null) {
|
|
|
|
|
throw new ApiException("termId不能为空");
|
|
|
|
|