提交 3346ede5 编写于 作者: L lepdou

move constants LASTEST_VERSION_ID to portal

上级 71ffb8c6
......@@ -4,6 +4,4 @@ public interface Constants {
String DEFAULT_CLUSTER_NAME = "default-cluster-name";
long LASTEST_VERSION_ID = -1;
}
package com.ctrip.apollo.portal.constants;
public interface PortalConstants {
long LASTEST_VERSION_ID = -1;
}
package com.ctrip.apollo.portal.controller;
import com.ctrip.apollo.core.Constants;
import com.ctrip.apollo.portal.constants.PortalConstants;
import com.ctrip.apollo.portal.entity.AppConfigVO;
import com.ctrip.apollo.portal.exception.NotFoundException;
import com.ctrip.apollo.portal.service.ConfigService;
......@@ -23,7 +23,7 @@ public class ConfigController {
throw new NotFoundException();
}
if (versionId == Constants.LASTEST_VERSION_ID) {
if (versionId == PortalConstants.LASTEST_VERSION_ID) {
return configService.loadLatestConfig(appId);
} else if (versionId > 0) {
return configService.loadReleaseConfig(appId, versionId);
......
......@@ -3,6 +3,7 @@ package com.ctrip.apollo.portal.service.impl;
import com.ctrip.apollo.core.Constants;
import com.ctrip.apollo.core.dto.*;
import com.ctrip.apollo.portal.RestUtils;
import com.ctrip.apollo.portal.constants.PortalConstants;
import com.ctrip.apollo.portal.entity.AppConfigVO;
import com.ctrip.apollo.portal.service.ConfigService;
import com.fasterxml.jackson.databind.ObjectMapper;
......@@ -164,7 +165,7 @@ public class ConfigServiceImpl implements ConfigService {
Map<String, List<ConfigItemDTO>> groupedClusterConfigs = groupConfigByCluster(configItems);
AppConfigVO appConfigVO =
AppConfigVO.newInstance(appId, Constants.LASTEST_VERSION_ID);
AppConfigVO.newInstance(appId, PortalConstants.LASTEST_VERSION_ID);
groupConfigByAppAndEnrichDTO(groupedClusterConfigs, appConfigVO);
......
package com.ctrip.apollo.portal.service;
import com.ctrip.apollo.core.Constants;
import com.ctrip.apollo.core.dto.*;
import com.ctrip.apollo.portal.RestUtils;
import com.ctrip.apollo.portal.constants.PortalConstants;
import com.ctrip.apollo.portal.entity.AppConfigVO;
import com.ctrip.apollo.portal.service.impl.ConfigServiceImpl;
import org.junit.Before;
......@@ -162,7 +162,7 @@ public class ConfigServiceTest {
AppConfigVO appConfigVO = configService.loadLatestConfig(appId);
assertEquals(appConfigVO.getAppId(), 6666);
assertEquals(appConfigVO.getVersionId(), Constants.LASTEST_VERSION_ID);
assertEquals(appConfigVO.getVersionId(), PortalConstants.LASTEST_VERSION_ID);
assertEquals(appConfigVO.getDefaultClusterConfigs().size(), 3);
assertEquals(appConfigVO.getOverrideAppConfigs().size(), 1);
assertEquals(appConfigVO.getOverrideClusterConfigs().size(), 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册