use of com.baidu.disconf.web.web.config.dto.ConfigFullModel in project disconf by knightliao.
the class ZkDeployValidator method verify.
/**
* @param zkDeployForm
*
* @return
*/
public ConfigFullModel verify(ZkDeployForm zkDeployForm) {
//
if (zkDeployForm.getAppId() == null) {
throw new FieldException("app is empty", null);
}
App app = appMgr.getById(zkDeployForm.getAppId());
if (app == null) {
throw new FieldException("app " + zkDeployForm.getAppId() + " doesn't exist in db.", null);
}
//
if (zkDeployForm.getEnvId() == null) {
throw new FieldException("app is empty", null);
}
Env env = envMgr.getById(zkDeployForm.getEnvId());
if (env == null) {
throw new FieldException("env " + zkDeployForm.getEnvId() + " doesn't exist in db.", null);
}
//
if (StringUtils.isEmpty(zkDeployForm.getVersion())) {
throw new FieldException("version is empty", null);
}
return new ConfigFullModel(app, env, zkDeployForm.getVersion(), "");
}
Aggregations