|
|
@@ -52,6 +52,9 @@ public class DockerMetaService extends SuperService {
|
|
|
Assert.hasText(param.getGroupCode(), "groupCode不能为空");
|
|
|
Assert.hasText(param.getName(), "name不能为空");
|
|
|
Assert.hasText(param.getImage(), "image不能为空");
|
|
|
+ if (StringUtils.isEmpty(param.getId())) {
|
|
|
+ param.setId(null);
|
|
|
+ }
|
|
|
|
|
|
DockerMeta dockerMeta = new DockerMeta();
|
|
|
DockerMeta temp = dockerMetaDao.findTopByGroupCodeAndName(groupCode, param.getName());
|
|
|
@@ -70,7 +73,6 @@ public class DockerMetaService extends SuperService {
|
|
|
"分组【%s】下已存在名称【%s】", groupCode, param.getName()));
|
|
|
}
|
|
|
dockerMeta = new DockerMeta();
|
|
|
- param.setId(null);
|
|
|
}
|
|
|
BeanUtils.copyProperties(param, dockerMeta);
|
|
|
dockerMetaDao.save(dockerMeta);
|
|
|
@@ -120,6 +122,7 @@ public class DockerMetaService extends SuperService {
|
|
|
lastTime = new DockerMetaLastTime();
|
|
|
}
|
|
|
lastTime.setLastTime(System.currentTimeMillis());
|
|
|
+ lastTime.setGroupCode(groupCode);
|
|
|
dockerMetaLastTimeDao.save(lastTime);
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
@@ -182,7 +185,7 @@ public class DockerMetaService extends SuperService {
|
|
|
if (ObjectUtils.isNotEmpty(restartPolicy)) {
|
|
|
JSONObject RestartPolicy = new JSONObject();
|
|
|
RestartPolicy.set("Name", restartPolicy.getName());
|
|
|
- HostConfig.set("MaximumRetryCount", restartPolicy.getMaximumRetryCount());
|
|
|
+ RestartPolicy.set("MaximumRetryCount", restartPolicy.getMaximumRetryCount());
|
|
|
HostConfig.set("RestartPolicy", RestartPolicy);
|
|
|
}
|
|
|
|