Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
3346ede5
Commit
3346ede5
authored
Mar 25, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move constants LASTEST_VERSION_ID to portal
parent
71ffb8c6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
7 deletions
+12
-7
Constants.java
...o-core/src/main/java/com/ctrip/apollo/core/Constants.java
+0
-2
PortalConstants.java
...va/com/ctrip/apollo/portal/constants/PortalConstants.java
+6
-0
ConfigController.java
.../com/ctrip/apollo/portal/controller/ConfigController.java
+2
-2
ConfigServiceImpl.java
...m/ctrip/apollo/portal/service/impl/ConfigServiceImpl.java
+2
-1
ConfigServiceTest.java
...va/com/ctrip/apollo/portal/service/ConfigServiceTest.java
+2
-2
No files found.
apollo-core/src/main/java/com/ctrip/apollo/core/Constants.java
View file @
3346ede5
...
...
@@ -4,6 +4,4 @@ public interface Constants {
String
DEFAULT_CLUSTER_NAME
=
"default-cluster-name"
;
long
LASTEST_VERSION_ID
=
-
1
;
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/constants/PortalConstants.java
0 → 100644
View file @
3346ede5
package
com
.
ctrip
.
apollo
.
portal
.
constants
;
public
interface
PortalConstants
{
long
LASTEST_VERSION_ID
=
-
1
;
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/ConfigController.java
View file @
3346ede5
package
com
.
ctrip
.
apollo
.
portal
.
controller
;
import
com.ctrip.apollo.
core.
Constants
;
import
com.ctrip.apollo.
portal.constants.Portal
Constants
;
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
==
Portal
Constants
.
LASTEST_VERSION_ID
)
{
return
configService
.
loadLatestConfig
(
appId
);
}
else
if
(
versionId
>
0
)
{
return
configService
.
loadReleaseConfig
(
appId
,
versionId
);
...
...
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/impl/ConfigServiceImpl.java
View file @
3346ede5
...
...
@@ -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
,
Portal
Constants
.
LASTEST_VERSION_ID
);
groupConfigByAppAndEnrichDTO
(
groupedClusterConfigs
,
appConfigVO
);
...
...
apollo-portal/src/test/java/com/ctrip/apollo/portal/service/ConfigServiceTest.java
View file @
3346ede5
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
(),
Portal
Constants
.
LASTEST_VERSION_ID
);
assertEquals
(
appConfigVO
.
getDefaultClusterConfigs
().
size
(),
3
);
assertEquals
(
appConfigVO
.
getOverrideAppConfigs
().
size
(),
1
);
assertEquals
(
appConfigVO
.
getOverrideClusterConfigs
().
size
(),
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment