use of com.ctrip.framework.apollo.common.exception.ServiceException in project apollo by ctripcorp.
the class ClusterService method createDefaultCluster.
@Transactional
public void createDefaultCluster(String appId, String createBy) {
if (!isClusterNameUnique(appId, ConfigConsts.CLUSTER_NAME_DEFAULT)) {
throw new ServiceException("cluster not unique");
}
Cluster cluster = new Cluster();
cluster.setName(ConfigConsts.CLUSTER_NAME_DEFAULT);
cluster.setAppId(appId);
cluster.setDataChangeCreatedBy(createBy);
cluster.setDataChangeLastModifiedBy(createBy);
clusterRepository.save(cluster);
auditService.audit(Cluster.class.getSimpleName(), cluster.getId(), Audit.OP.INSERT, createBy);
}
Aggregations