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
e74556fe
Commit
e74556fe
authored
Apr 07, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix AdminService bugs
parent
6da1ec5a
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
348 additions
and
205 deletions
+348
-205
pom.xml
apollo-adminservice/pom.xml
+32
-42
AdminServiceApplication.java
...c/main/java/com/ctrip/apollo/AdminServiceApplication.java
+1
-1
AppController.java
...m/ctrip/apollo/adminservice/controller/AppController.java
+16
-8
ClusterController.java
...rip/apollo/adminservice/controller/ClusterController.java
+11
-0
NamespaceController.java
...p/apollo/adminservice/controller/NamespaceController.java
+17
-8
WebMvcConfig.java
...om/ctrip/apollo/adminservice/controller/WebMvcConfig.java
+24
-0
SampleAdminServiceApplication.java
.../java/com/ctrip/apollo/SampleAdminServiceApplication.java
+13
-0
application.properties
...lo-adminservice/src/test/resources/application.properties
+4
-0
import.sql
apollo-adminservice/src/test/resources/import.sql
+31
-0
pom.xml
apollo-biz/pom.xml
+0
-6
App.java
...lo-biz/src/main/java/com/ctrip/apollo/biz/entity/App.java
+3
-3
AppNamespace.java
...c/main/java/com/ctrip/apollo/biz/entity/AppNamespace.java
+3
-3
Cluster.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Cluster.java
+2
-2
Item.java
...o-biz/src/main/java/com/ctrip/apollo/biz/entity/Item.java
+2
-2
Namespace.java
.../src/main/java/com/ctrip/apollo/biz/entity/Namespace.java
+2
-2
Privilege.java
.../src/main/java/com/ctrip/apollo/biz/entity/Privilege.java
+2
-2
Release.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Release.java
+2
-2
AppService.java
...rc/main/java/com/ctrip/apollo/biz/service/AppService.java
+1
-1
ClusterService.java
...ain/java/com/ctrip/apollo/biz/service/ClusterService.java
+18
-0
NamespaceService.java
...n/java/com/ctrip/apollo/biz/service/NamespaceService.java
+8
-2
ConfigServiceApplication.java
.../main/java/com/ctrip/apollo/ConfigServiceApplication.java
+2
-4
ServletInitializer.java
...ce/src/main/java/com/ctrip/apollo/ServletInitializer.java
+1
-1
SampleConfigServiceApplication.java
...java/com/ctrip/apollo/SampleConfigServiceApplication.java
+13
-0
AbstractConfigServiceTest.java
...ctrip/apollo/configservice/AbstractConfigServiceTest.java
+2
-2
application.yml
apollo-configservice/src/test/resources/application.yml
+11
-8
bootstrap.yml
apollo-configservice/src/test/resources/bootstrap.yml
+6
-2
AppDTO.java
...-core/src/main/java/com/ctrip/apollo/core/dto/AppDTO.java
+10
-0
ItemDTO.java
...core/src/main/java/com/ctrip/apollo/core/dto/ItemDTO.java
+17
-37
NamespaceDTO.java
...src/main/java/com/ctrip/apollo/core/dto/NamespaceDTO.java
+17
-17
ReleaseDTO.java
...e/src/main/java/com/ctrip/apollo/core/dto/ReleaseDTO.java
+41
-14
ConfigService.java
...n/java/com/ctrip/apollo/portal/service/ConfigService.java
+32
-32
ConfigServiceTest.java
...va/com/ctrip/apollo/portal/service/ConfigServiceTest.java
+4
-4
No files found.
apollo-adminservice/pom.xml
View file @
e74556fe
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<parent>
<parent>
<groupId>
com.ctrip.apollo
</groupId>
<groupId>
com.ctrip.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<version>
0.0.1-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-adminservice
</artifactId>
<artifactId>
apollo-adminservice
</artifactId>
<name>
Apollo AdminService
</name>
<name>
Apollo AdminService
</name>
<dependencies>
<dependencies>
<!-- apollo -->
<!-- apollo -->
<dependency>
<dependency>
<groupId>
com.ctrip.apollo
</groupId>
<groupId>
com.ctrip.apollo
</groupId>
<artifactId>
apollo-biz
</artifactId>
<artifactId>
apollo-biz
</artifactId>
</dependency>
</dependency>
<!-- end of apollo -->
<!-- end of apollo -->
<!-- redis -->
<!-- eureka -->
<dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-data-redis
</artifactId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
</dependency>
<dependency>
<!-- end of eureka -->
<groupId>
redis.clients
</groupId>
</dependencies>
<artifactId>
jedis
</artifactId>
<build>
</dependency>
<plugins>
<!-- end of redis -->
<plugin>
<!-- eureka -->
<groupId>
org.springframework.boot
</groupId>
<dependency>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<groupId>
org.springframework.cloud
</groupId>
</plugin>
<artifactId>
spring-cloud-starter-eureka-server
</artifactId>
</plugins>
</dependency>
</build>
<!-- end of eureka -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
</project>
apollo-adminservice/src/main/java/com/ctrip/apollo/AdminServiceApplication.java
View file @
e74556fe
...
@@ -9,6 +9,6 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
...
@@ -9,6 +9,6 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@EnableEurekaClient
@EnableEurekaClient
public
class
AdminServiceApplication
{
public
class
AdminServiceApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
AdminServiceApplication
.
class
).
web
(
true
).
run
(
args
);
new
SpringApplicationBuilder
(
AdminServiceApplication
.
class
).
run
(
args
);
}
}
}
}
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/AppController.java
View file @
e74556fe
...
@@ -3,6 +3,7 @@ package com.ctrip.apollo.adminservice.controller;
...
@@ -3,6 +3,7 @@ package com.ctrip.apollo.adminservice.controller;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -12,22 +13,29 @@ import com.ctrip.apollo.biz.entity.App;
...
@@ -12,22 +13,29 @@ import com.ctrip.apollo.biz.entity.App;
import
com.ctrip.apollo.biz.service.AppService
;
import
com.ctrip.apollo.biz.service.AppService
;
import
com.ctrip.apollo.biz.utils.BeanUtils
;
import
com.ctrip.apollo.biz.utils.BeanUtils
;
import
com.ctrip.apollo.core.dto.AppDTO
;
import
com.ctrip.apollo.core.dto.AppDTO
;
import
com.google.common.base.Strings
;
@RestController
@RestController
public
class
AppController
{
public
class
AppController
{
@Autowired
@Autowired
private
AppService
appService
;
private
AppService
appService
;
@RequestMapping
(
"/apps/{appId}"
)
@RequestMapping
(
"/apps/{appId}"
)
public
AppDTO
findByAppId
(
@PathVariable
(
"appId"
)
String
appId
)
{
public
AppDTO
getApp
(
@PathVariable
(
"appId"
)
String
appId
)
{
App
app
=
appService
.
findByAppId
(
appId
);
App
app
=
appService
.
findOne
(
appId
);
return
BeanUtils
.
transfrom
(
AppDTO
.
class
,
app
);
return
BeanUtils
.
transfrom
(
AppDTO
.
class
,
app
);
}
}
@RequestMapping
(
"/apps"
)
@RequestMapping
(
"/apps"
)
public
List
<
AppDTO
>
findByName
(
@RequestParam
(
"name"
)
String
name
)
{
public
List
<
AppDTO
>
findApps
(
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
List
<
App
>
app
=
appService
.
findByName
(
name
);
Pageable
pageable
)
{
return
BeanUtils
.
batchTransform
(
AppDTO
.
class
,
app
);
List
<
App
>
app
=
null
;
if
(
Strings
.
isNullOrEmpty
(
name
))
{
app
=
appService
.
findAll
(
pageable
);
}
else
{
app
=
appService
.
findByName
(
name
);
}
return
BeanUtils
.
batchTransform
(
AppDTO
.
class
,
app
);
}
}
}
}
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/ClusterController.java
View file @
e74556fe
...
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ctrip.apollo.biz.entity.Cluster
;
import
com.ctrip.apollo.biz.entity.Cluster
;
import
com.ctrip.apollo.biz.service.ClusterService
;
import
com.ctrip.apollo.biz.service.ViewService
;
import
com.ctrip.apollo.biz.service.ViewService
;
import
com.ctrip.apollo.biz.utils.BeanUtils
;
import
com.ctrip.apollo.biz.utils.BeanUtils
;
import
com.ctrip.apollo.core.dto.ClusterDTO
;
import
com.ctrip.apollo.core.dto.ClusterDTO
;
...
@@ -18,9 +19,19 @@ public class ClusterController {
...
@@ -18,9 +19,19 @@ public class ClusterController {
@Autowired
@Autowired
private
ViewService
viewService
;
private
ViewService
viewService
;
@Autowired
private
ClusterService
clusterService
;
@RequestMapping
(
"/apps/{appId}/clusters"
)
@RequestMapping
(
"/apps/{appId}/clusters"
)
public
List
<
ClusterDTO
>
findClusters
(
@PathVariable
(
"appId"
)
String
appId
)
{
public
List
<
ClusterDTO
>
findClusters
(
@PathVariable
(
"appId"
)
String
appId
)
{
List
<
Cluster
>
clusters
=
viewService
.
findClusters
(
appId
);
List
<
Cluster
>
clusters
=
viewService
.
findClusters
(
appId
);
return
BeanUtils
.
batchTransform
(
ClusterDTO
.
class
,
clusters
);
return
BeanUtils
.
batchTransform
(
ClusterDTO
.
class
,
clusters
);
}
}
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}"
)
public
ClusterDTO
getCluster
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
)
{
Cluster
cluster
=
clusterService
.
findOne
(
appId
,
clusterName
);
return
BeanUtils
.
transfrom
(
ClusterDTO
.
class
,
cluster
);
}
}
}
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/
Group
Controller.java
→
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/
Namespace
Controller.java
View file @
e74556fe
...
@@ -14,24 +14,33 @@ import com.ctrip.apollo.biz.utils.BeanUtils;
...
@@ -14,24 +14,33 @@ import com.ctrip.apollo.biz.utils.BeanUtils;
import
com.ctrip.apollo.core.dto.NamespaceDTO
;
import
com.ctrip.apollo.core.dto.NamespaceDTO
;
@RestController
@RestController
public
class
Group
Controller
{
public
class
Namespace
Controller
{
@Autowired
@Autowired
private
ViewService
viewService
;
private
ViewService
viewService
;
@Autowired
@Autowired
private
NamespaceService
group
Service
;
private
NamespaceService
namespace
Service
;
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}/
group
s"
)
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}/
namespace
s"
)
public
List
<
NamespaceDTO
>
find
Group
s
(
@PathVariable
(
"appId"
)
String
appId
,
public
List
<
NamespaceDTO
>
find
Namespace
s
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
)
{
@PathVariable
(
"clusterName"
)
String
clusterName
)
{
List
<
Namespace
>
groups
=
viewService
.
findNamespaces
(
appId
,
clusterName
);
List
<
Namespace
>
groups
=
viewService
.
findNamespaces
(
appId
,
clusterName
);
return
BeanUtils
.
batchTransform
(
NamespaceDTO
.
class
,
groups
);
return
BeanUtils
.
batchTransform
(
NamespaceDTO
.
class
,
groups
);
}
}
@RequestMapping
(
"/groups/{groupId}"
)
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}"
)
public
NamespaceDTO
findOne
(
@PathVariable
(
"groupId"
)
Long
groupId
)
{
public
NamespaceDTO
getNamespace
(
@PathVariable
(
"appId"
)
String
appId
,
Namespace
group
=
groupService
.
findOne
(
groupId
);
@PathVariable
(
"clusterName"
)
String
clusterName
,
return
BeanUtils
.
transfrom
(
NamespaceDTO
.
class
,
group
);
@PathVariable
(
"namespaceName"
)
String
namespaceName
)
{
Namespace
namespace
=
namespaceService
.
findOne
(
appId
,
clusterName
,
namespaceName
);
return
BeanUtils
.
transfrom
(
NamespaceDTO
.
class
,
namespace
);
}
@RequestMapping
(
"/namespaces/{namespaceId}"
)
public
NamespaceDTO
getNamespace
(
@PathVariable
(
"namespaceId"
)
Long
namespaceId
)
{
Namespace
namespace
=
namespaceService
.
findOne
(
namespaceId
);
return
BeanUtils
.
transfrom
(
NamespaceDTO
.
class
,
namespace
);
}
}
}
}
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/WebMvcConfig.java
0 → 100644
View file @
e74556fe
package
com
.
ctrip
.
apollo
.
adminservice
.
controller
;
import
java.util.List
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.web.PageableHandlerMethodArgumentResolver
;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
@Configuration
@EnableWebMvc
public
class
WebMvcConfig
extends
WebMvcConfigurerAdapter
{
@Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
PageableHandlerMethodArgumentResolver
resolver
=
new
PageableHandlerMethodArgumentResolver
();
resolver
.
setFallbackPageable
(
new
PageRequest
(
0
,
10
));
argumentResolvers
.
add
(
resolver
);
}
}
apollo-adminservice/src/test/java/com/ctrip/apollo/SampleAdminServiceApplication.java
0 → 100644
View file @
e74556fe
package
com
.
ctrip
.
apollo
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
@SpringBootApplication
@EnableEurekaClient
public
class
SampleAdminServiceApplication
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
SampleAdminServiceApplication
.
class
).
run
(
args
);
}
}
apollo-adminservice/src/test/resources/application.properties
0 → 100644
View file @
e74556fe
spring.datasource.url
=
jdbc:h2:mem:~/fxapolloconfigdb;mode=mysql
spring.jpa.hibernate.naming_strategy
=
org.hibernate.cfg.EJB3NamingStrategy
spring.h2.console.enabled
=
true
spring.h2.console.settings.web-allow-others
=
true
apollo-adminservice/src/test/resources/import.sql
0 → 100644
View file @
e74556fe
INSERT
INTO
App
(
AppId
,
Name
,
OwnerName
,
OwnerEmail
)
VALUES
(
'100003171'
,
'apollo-config-service'
,
'刘一鸣'
,
'liuym@ctrip.com'
);
INSERT
INTO
App
(
AppId
,
Name
,
OwnerName
,
OwnerEmail
)
VALUES
(
'100003172'
,
'apollo-admin-service'
,
'宋顺'
,
'song_s@ctrip.com'
);
INSERT
INTO
App
(
AppId
,
Name
,
OwnerName
,
OwnerEmail
)
VALUES
(
'100003173'
,
'apollo-portal'
,
'张乐'
,
'zhanglea@ctrip.com'
);
INSERT
INTO
App
(
AppId
,
Name
,
OwnerName
,
OwnerEmail
)
VALUES
(
'fxhermesproducer'
,
'fx-hermes-producer'
,
'梁锦华'
,
'jhliang@ctrip.com'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003171'
,
'default'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003171'
,
'cluster1'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003172'
,
'default'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003172'
,
'cluster2'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003173'
,
'default'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003173'
,
'cluster3'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'fxhermesproducer'
,
'default'
);
INSERT
INTO
AppNamespace
(
AppId
,
Name
)
VALUES
(
'100003171'
,
'apollo-config-service'
);
INSERT
INTO
AppNamespace
(
AppId
,
Name
)
VALUES
(
'100003172'
,
'apollo-admin-service'
);
INSERT
INTO
AppNamespace
(
AppId
,
Name
)
VALUES
(
'100003173'
,
'apollo-portal-service'
);
INSERT
INTO
AppNamespace
(
AppID
,
Name
)
VALUES
(
'fxhermesproducer'
,
'fx-hermes-producer'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
1
,
'100003171'
,
'default'
,
'apollo-config-service'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
2
,
'fxhermesproducer'
,
'default'
,
'fx-hermes-producer'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
3
,
'100003172'
,
'default'
,
'apollo-admin-service'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
4
,
'100003173'
,
'default'
,
'apollo-portal'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
5
,
'100003171'
,
'default'
,
'fx-hermes-producer'
);
INSERT
INTO
Item
(
NamespaceId
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k1'
,
'v1'
,
'comment1'
);
INSERT
INTO
Item
(
NamespaceId
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k2'
,
'v2'
,
'comment2'
);
INSERT
INTO
Item
(
NamespaceId
,
`Key`
,
Value
,
Comment
)
VALUES
(
2
,
'k3'
,
'v3'
,
'comment3'
);
INSERT
INTO
Item
(
NamespaceId
,
`Key`
,
Value
,
Comment
)
VALUES
(
5
,
'k3'
,
'v4'
,
'comment4'
);
INSERT
INTO
`RELEASE`
(
Name
,
Comment
,
AppId
,
ClusterName
,
NamespaceName
,
Configurations
)
VALUES
(
'REV1'
,
'First Release'
,
'100003171'
,
'default'
,
'apollo-config-service'
,
'{"k1":"v1"}'
);
apollo-biz/pom.xml
View file @
e74556fe
...
@@ -19,12 +19,6 @@
...
@@ -19,12 +19,6 @@
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
<exclusions>
<exclusion>
<artifactId>
logback-classic
</artifactId>
<groupId>
ch.qos.logback
</groupId>
</exclusion>
</exclusions>
</dependency>
</dependency>
</dependencies>
</dependencies>
<profiles>
<profiles>
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/App.java
View file @
e74556fe
...
@@ -7,14 +7,14 @@ import org.hibernate.annotations.SQLDelete;
...
@@ -7,14 +7,14 @@ import org.hibernate.annotations.SQLDelete;
import
org.hibernate.annotations.Where
;
import
org.hibernate.annotations.Where
;
@Entity
@Entity
@SQLDelete
(
sql
=
"Update App set isDeleted =
1
where id = ?"
)
@SQLDelete
(
sql
=
"Update App set isDeleted =
'false'
where id = ?"
)
@Where
(
clause
=
"isDeleted =
0
"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
public
class
App
extends
BaseEntity
{
public
class
App
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
private
String
name
;
private
String
name
;
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
,
unique
=
true
)
private
String
appId
;
private
String
appId
;
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/AppNamespace.java
View file @
e74556fe
...
@@ -7,11 +7,11 @@ import org.hibernate.annotations.SQLDelete;
...
@@ -7,11 +7,11 @@ import org.hibernate.annotations.SQLDelete;
import
org.hibernate.annotations.Where
;
import
org.hibernate.annotations.Where
;
@Entity
@Entity
@SQLDelete
(
sql
=
"Update AppNamespace set isDeleted =
1
where id = ?"
)
@SQLDelete
(
sql
=
"Update AppNamespace set isDeleted =
'false'
where id = ?"
)
@Where
(
clause
=
"isDeleted =
0
"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
public
class
AppNamespace
extends
BaseEntity
{
public
class
AppNamespace
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
,
unique
=
true
)
private
String
name
;
private
String
name
;
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Cluster.java
View file @
e74556fe
...
@@ -10,8 +10,8 @@ import org.hibernate.annotations.Where;
...
@@ -10,8 +10,8 @@ import org.hibernate.annotations.Where;
* @author Jason Song(song_s@ctrip.com)
* @author Jason Song(song_s@ctrip.com)
*/
*/
@Entity
@Entity
@SQLDelete
(
sql
=
"Update Cluster set isDeleted =
1
where id = ?"
)
@SQLDelete
(
sql
=
"Update Cluster set isDeleted =
'false'
where id = ?"
)
@Where
(
clause
=
"isDeleted =
0
"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
public
class
Cluster
extends
BaseEntity
{
public
class
Cluster
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Item.java
View file @
e74556fe
...
@@ -7,8 +7,8 @@ import org.hibernate.annotations.SQLDelete;
...
@@ -7,8 +7,8 @@ import org.hibernate.annotations.SQLDelete;
import
org.hibernate.annotations.Where
;
import
org.hibernate.annotations.Where
;
@Entity
@Entity
@SQLDelete
(
sql
=
"Update Item set isDeleted =
1
where id = ?"
)
@SQLDelete
(
sql
=
"Update Item set isDeleted =
'false'
where id = ?"
)
@Where
(
clause
=
"isDeleted =
0
"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
public
class
Item
extends
BaseEntity
{
public
class
Item
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Namespace.java
View file @
e74556fe
...
@@ -7,8 +7,8 @@ import org.hibernate.annotations.SQLDelete;
...
@@ -7,8 +7,8 @@ import org.hibernate.annotations.SQLDelete;
import
org.hibernate.annotations.Where
;
import
org.hibernate.annotations.Where
;
@Entity
@Entity
@SQLDelete
(
sql
=
"Update Namespace set isDeleted =
1
where id = ?"
)
@SQLDelete
(
sql
=
"Update Namespace set isDeleted =
'false'
where id = ?"
)
@Where
(
clause
=
"isDeleted =
0
"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
public
class
Namespace
extends
BaseEntity
{
public
class
Namespace
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Privilege.java
View file @
e74556fe
...
@@ -7,8 +7,8 @@ import org.hibernate.annotations.SQLDelete;
...
@@ -7,8 +7,8 @@ import org.hibernate.annotations.SQLDelete;
import
org.hibernate.annotations.Where
;
import
org.hibernate.annotations.Where
;
@Entity
@Entity
@SQLDelete
(
sql
=
"Update Privilege set isDeleted =
1
where id = ?"
)
@SQLDelete
(
sql
=
"Update Privilege set isDeleted =
'false'
where id = ?"
)
@Where
(
clause
=
"isDeleted =
0
"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
public
class
Privilege
extends
BaseEntity
{
public
class
Privilege
extends
BaseEntity
{
@Column
@Column
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Release.java
View file @
e74556fe
...
@@ -11,8 +11,8 @@ import org.hibernate.annotations.Where;
...
@@ -11,8 +11,8 @@ import org.hibernate.annotations.Where;
* @author Jason Song(song_s@ctrip.com)
* @author Jason Song(song_s@ctrip.com)
*/
*/
@Entity
@Entity
@SQLDelete
(
sql
=
"Update Release set isDeleted =
1
where id = ?"
)
@SQLDelete
(
sql
=
"Update Release set isDeleted =
'false'
where id = ?"
)
@Where
(
clause
=
"isDeleted =
0
"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
public
class
Release
extends
BaseEntity
{
public
class
Release
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/AppService.java
View file @
e74556fe
...
@@ -29,7 +29,7 @@ public class AppService {
...
@@ -29,7 +29,7 @@ public class AppService {
return
appRepository
.
findByName
(
name
);
return
appRepository
.
findByName
(
name
);
}
}
public
App
find
ByAppId
(
String
appId
){
public
App
find
One
(
String
appId
){
return
appRepository
.
findByAppId
(
appId
);
return
appRepository
.
findByAppId
(
appId
);
}
}
}
}
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ClusterService.java
0 → 100644
View file @
e74556fe
package
com
.
ctrip
.
apollo
.
biz
.
service
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ctrip.apollo.biz.entity.Cluster
;
import
com.ctrip.apollo.biz.repository.ClusterRepository
;
@Service
public
class
ClusterService
{
@Autowired
private
ClusterRepository
clusterRepository
;
public
Cluster
findOne
(
String
appId
,
String
name
)
{
return
clusterRepository
.
findByAppIdAndName
(
appId
,
name
);
}
}
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/NamespaceService.java
View file @
e74556fe
...
@@ -11,8 +11,14 @@ public class NamespaceService {
...
@@ -11,8 +11,14 @@ public class NamespaceService {
@Autowired
@Autowired
private
NamespaceRepository
namespaceRepository
;
private
NamespaceRepository
namespaceRepository
;
public
Namespace
findOne
(
Long
namespaceId
){
public
Namespace
findOne
(
Long
namespaceId
)
{
return
namespaceRepository
.
findOne
(
namespaceId
);
return
namespaceRepository
.
findOne
(
namespaceId
);
}
}
public
Namespace
findOne
(
String
appId
,
String
clusterName
,
String
namespaceName
)
{
return
namespaceRepository
.
findByAppIdAndClusterNameAndNamespaceName
(
appId
,
clusterName
,
namespaceName
);
}
}
}
apollo-configservice/src/main/java/com/ctrip/apollo/
Server
Application.java
→
apollo-configservice/src/main/java/com/ctrip/apollo/
ConfigService
Application.java
View file @
e74556fe
...
@@ -3,7 +3,6 @@ package com.ctrip.apollo;
...
@@ -3,7 +3,6 @@ package com.ctrip.apollo;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.cloud.netflix.eureka.server.EnableEurekaServer
;
import
org.springframework.cloud.netflix.eureka.server.EnableEurekaServer
;
import
org.springframework.context.ConfigurableApplicationContext
;
/**
/**
* Spring boot application entry point
* Spring boot application entry point
...
@@ -12,11 +11,10 @@ import org.springframework.context.ConfigurableApplicationContext;
...
@@ -12,11 +11,10 @@ import org.springframework.context.ConfigurableApplicationContext;
*/
*/
@SpringBootApplication
@SpringBootApplication
@EnableEurekaServer
@EnableEurekaServer
public
class
Server
Application
{
public
class
ConfigService
Application
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ConfigurableApplicationContext
context
=
new
SpringApplicationBuilder
(
ConfigServiceApplication
.
class
).
run
(
args
);
new
SpringApplicationBuilder
(
ServerApplication
.
class
).
web
(
true
).
run
(
args
);
}
}
}
}
apollo-configservice/src/main/java/com/ctrip/apollo/ServletInitializer.java
View file @
e74556fe
...
@@ -12,7 +12,7 @@ public class ServletInitializer extends SpringBootServletInitializer {
...
@@ -12,7 +12,7 @@ public class ServletInitializer extends SpringBootServletInitializer {
@Override
@Override
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
application
)
{
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
application
)
{
return
application
.
sources
(
Server
Application
.
class
);
return
application
.
sources
(
ConfigService
Application
.
class
);
}
}
}
}
apollo-configservice/src/test/java/com/ctrip/apollo/SampleConfigServiceApplication.java
0 → 100644
View file @
e74556fe
package
com
.
ctrip
.
apollo
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.cloud.netflix.eureka.server.EnableEurekaServer
;
@SpringBootApplication
@EnableEurekaServer
public
class
SampleConfigServiceApplication
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
SampleConfigServiceApplication
.
class
).
run
(
args
);
}
}
apollo-configservice/src/test/java/com/ctrip/apollo/configservice/AbstractConfigServiceTest.java
View file @
e74556fe
package
com
.
ctrip
.
apollo
.
configservice
;
package
com
.
ctrip
.
apollo
.
configservice
;
import
com.ctrip.apollo.
Server
Application
;
import
com.ctrip.apollo.
ConfigService
Application
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
(
classes
=
Server
Application
.
class
)
@SpringApplicationConfiguration
(
classes
=
ConfigService
Application
.
class
)
public
abstract
class
AbstractConfigServiceTest
{
public
abstract
class
AbstractConfigServiceTest
{
}
}
apollo-configservice/src/test/resources/application.yml
View file @
e74556fe
spring
:
application
:
name
:
apollo-configservice
datasource
:
url
:
jdbc:h2:mem:~/fxapolloconfigdb;DB_CLOSE_ON_EXIT=FALSE
server
:
server
:
port
:
8888
port
:
${port:8080}
logging
:
logging
:
level
:
level
:
org.springframework.cloud
:
'
DEBUG'
org.springframework.cloud
:
'
DEBUG'
file
:
/opt/logs/${ctrip.appid}/apollo-configservice.log
spring
:
ctrip
:
application
:
appid
:
100003171
name
:
apollo-configservice
\ No newline at end of file
datasource
:
url
:
jdbc:h2:file:~/fxapolloconfigdb;DB_CLOSE_ON_EXIT=FALSE
username
:
sa
password
:
apollo-configservice/src/test/resources/bootstrap.yml
View file @
e74556fe
eureka
:
eureka
:
instance
:
instance
:
hostname
:
localhost
hostname
:
${hostname:localhost}
preferIpAddress
:
true
client
:
client
:
serviceUrl
:
serviceUrl
:
defaultZone
:
http://${eureka.instance.hostname}:8761/eureka/
defaultZone
:
http://${eureka.instance.hostname}:8080/eureka/
healthcheck
:
enabled
:
true
\ No newline at end of file
apollo-core/src/main/java/com/ctrip/apollo/core/dto/AppDTO.java
View file @
e74556fe
...
@@ -2,6 +2,8 @@ package com.ctrip.apollo.core.dto;
...
@@ -2,6 +2,8 @@ package com.ctrip.apollo.core.dto;
public
class
AppDTO
{
public
class
AppDTO
{
private
long
id
;
private
String
name
;
private
String
name
;
private
String
appId
;
private
String
appId
;
...
@@ -14,6 +16,10 @@ public class AppDTO {
...
@@ -14,6 +16,10 @@ public class AppDTO {
return
appId
;
return
appId
;
}
}
public
long
getId
()
{
return
id
;
}
public
String
getName
()
{
public
String
getName
()
{
return
name
;
return
name
;
}
}
...
@@ -30,6 +36,10 @@ public class AppDTO {
...
@@ -30,6 +36,10 @@ public class AppDTO {
this
.
appId
=
appId
;
this
.
appId
=
appId
;
}
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
void
setName
(
String
name
)
{
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
this
.
name
=
name
;
}
}
...
...
apollo-core/src/main/java/com/ctrip/apollo/core/dto/ItemDTO.java
View file @
e74556fe
...
@@ -4,11 +4,7 @@ public class ItemDTO {
...
@@ -4,11 +4,7 @@ public class ItemDTO {
private
long
id
;
private
long
id
;
private
long
clusterId
;
private
long
namespaceId
;
private
String
clusterName
;
private
String
appId
;
private
String
key
;
private
String
key
;
...
@@ -25,59 +21,43 @@ public class ItemDTO {
...
@@ -25,59 +21,43 @@ public class ItemDTO {
this
.
value
=
value
;
this
.
value
=
value
;
}
}
public
long
getId
()
{
public
String
getComment
()
{
return
id
;
return
comment
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
long
getClusterId
()
{
return
clusterId
;
}
}
public
void
setClusterId
(
long
clusterId
)
{
public
long
getId
(
)
{
this
.
clusterId
=
clusterI
d
;
return
i
d
;
}
}
public
String
get
ClusterName
()
{
public
String
get
Key
()
{
return
clusterName
;
return
key
;
}
}
public
void
setClusterName
(
String
clusterName
)
{
public
long
getNamespaceId
(
)
{
this
.
clusterName
=
clusterName
;
return
namespaceId
;
}
}
public
String
get
AppId
()
{
public
String
get
Value
()
{
return
appId
;
return
value
;
}
}
public
void
set
AppId
(
String
appId
)
{
public
void
set
Comment
(
String
comment
)
{
this
.
appId
=
appId
;
this
.
comment
=
comment
;
}
}
public
String
getKey
(
)
{
public
void
setId
(
long
id
)
{
return
key
;
this
.
id
=
id
;
}
}
public
void
setKey
(
String
key
)
{
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
this
.
key
=
key
;
}
}
public
String
getValue
(
)
{
public
void
setNamespaceId
(
long
namespaceId
)
{
return
value
;
this
.
namespaceId
=
namespaceId
;
}
}
public
void
setValue
(
String
value
)
{
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
this
.
value
=
value
;
}
}
public
String
getComment
()
{
return
comment
;
}
public
void
setComment
(
String
comment
)
{
this
.
comment
=
comment
;
}
}
}
apollo-core/src/main/java/com/ctrip/apollo/core/dto/NamespaceDTO.java
View file @
e74556fe
...
@@ -4,41 +4,41 @@ public class NamespaceDTO {
...
@@ -4,41 +4,41 @@ public class NamespaceDTO {
private
long
id
;
private
long
id
;
private
long
clusterId
;
private
String
appId
;
private
String
clusterName
;
private
long
namespaceId
;
private
String
namespaceName
;
private
String
name
;
public
String
getAppId
()
{
return
appId
;
}
public
lo
ng
getClusterId
()
{
public
Stri
ng
getClusterId
()
{
return
cluster
Id
;
return
cluster
Name
;
}
}
public
long
getId
()
{
public
long
getId
()
{
return
id
;
return
id
;
}
}
public
String
getName
()
{
public
String
getName
spaceName
()
{
return
name
;
return
name
spaceName
;
}
}
public
long
getNamespaceId
(
)
{
public
void
setAppId
(
String
appId
)
{
return
namespace
Id
;
this
.
appId
=
app
Id
;
}
}
public
void
setCluster
Id
(
long
clusterId
)
{
public
void
setCluster
Name
(
String
clusterName
)
{
this
.
cluster
Id
=
clusterId
;
this
.
cluster
Name
=
clusterName
;
}
}
public
void
setId
(
long
id
)
{
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
void
setName
(
String
name
)
{
public
void
setNamespaceName
(
String
namespaceName
)
{
this
.
name
=
name
;
this
.
namespaceName
=
namespaceName
;
}
public
void
setNamespaceId
(
long
namespaceId
)
{
this
.
namespaceId
=
namespaceId
;
}
}
}
}
apollo-core/src/main/java/com/ctrip/apollo/core/dto/ReleaseDTO.java
View file @
e74556fe
...
@@ -4,45 +4,72 @@ public class ReleaseDTO {
...
@@ -4,45 +4,72 @@ public class ReleaseDTO {
private
long
id
;
private
long
id
;
private
long
releaseId
;
private
String
name
;
private
String
appId
;
private
String
clusterName
;
private
String
clusterName
;
private
String
namespaceName
;
private
String
configurations
;
private
String
configurations
;
public
ReleaseDTO
()
{
private
String
comment
;
public
String
getAppId
()
{
return
appId
;
}
}
public
long
getId
()
{
public
String
getClusterName
()
{
return
id
;
return
clusterName
;
}
}
public
void
setId
(
long
id
)
{
public
String
getComment
(
)
{
this
.
id
=
id
;
return
comment
;
}
}
public
long
getReleaseId
()
{
public
String
getConfigurations
()
{
return
releaseId
;
return
configurations
;
}
}
public
void
setReleaseId
(
long
releaseId
)
{
public
long
getId
(
)
{
this
.
releaseId
=
releaseI
d
;
return
i
d
;
}
}
public
String
getClusterName
()
{
public
String
getName
()
{
return
clusterName
;
return
name
;
}
public
String
getNamespaceName
()
{
return
namespaceName
;
}
public
void
setAppId
(
String
appId
)
{
this
.
appId
=
appId
;
}
}
public
void
setClusterName
(
String
clusterName
)
{
public
void
setClusterName
(
String
clusterName
)
{
this
.
clusterName
=
clusterName
;
this
.
clusterName
=
clusterName
;
}
}
public
String
getConfigurations
(
)
{
public
void
setComment
(
String
comment
)
{
return
configurations
;
this
.
comment
=
comment
;
}
}
public
void
setConfigurations
(
String
configurations
)
{
public
void
setConfigurations
(
String
configurations
)
{
this
.
configurations
=
configurations
;
this
.
configurations
=
configurations
;
}
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
void
setNamespaceName
(
String
namespaceName
)
{
this
.
namespaceName
=
namespaceName
;
}
}
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/ConfigService.java
View file @
e74556fe
...
@@ -180,16 +180,16 @@ public class ConfigService {
...
@@ -180,16 +180,16 @@ public class ConfigService {
private
Map
<
String
,
List
<
ItemDTO
>>
groupConfigByCluster
(
List
<
ItemDTO
>
configItems
)
{
private
Map
<
String
,
List
<
ItemDTO
>>
groupConfigByCluster
(
List
<
ItemDTO
>
configItems
)
{
Map
<
String
,
List
<
ItemDTO
>>
groupedClusterConfigs
=
new
HashMap
<>();
Map
<
String
,
List
<
ItemDTO
>>
groupedClusterConfigs
=
new
HashMap
<>();
String
clusterName
;
//
String clusterName;
for
(
ItemDTO
configItem
:
configItems
)
{
//
for (ItemDTO configItem : configItems) {
clusterName
=
configItem
.
getClusterName
();
//
clusterName = configItem.getClusterName();
List
<
ItemDTO
>
clusterConfigs
=
groupedClusterConfigs
.
get
(
clusterName
);
//
List<ItemDTO> clusterConfigs = groupedClusterConfigs.get(clusterName);
if
(
clusterConfigs
==
null
)
{
//
if (clusterConfigs == null) {
clusterConfigs
=
new
LinkedList
<>();
//
clusterConfigs = new LinkedList<>();
groupedClusterConfigs
.
put
(
clusterName
,
clusterConfigs
);
//
groupedClusterConfigs.put(clusterName, clusterConfigs);
}
//
}
clusterConfigs
.
add
(
configItem
);
//
clusterConfigs.add(configItem);
}
//
}
return
groupedClusterConfigs
;
return
groupedClusterConfigs
;
}
}
...
@@ -227,28 +227,28 @@ public class ConfigService {
...
@@ -227,28 +227,28 @@ public class ConfigService {
Map
<
String
,
AppConfigVO
.
OverrideAppConfig
>
appIdMapOverrideAppConfig
=
null
;
Map
<
String
,
AppConfigVO
.
OverrideAppConfig
>
appIdMapOverrideAppConfig
=
null
;
for
(
ItemDTO
config
:
clusterConfigs
)
{
//
for (ItemDTO config : clusterConfigs) {
String
targetAppId
=
config
.
getAppId
();
//
String targetAppId = config.getAppId();
if
(
appId
.
equals
(
targetAppId
))
{
// app self's configs
//
if (appId.equals(targetAppId)) {// app self's configs
defaultClusterConfigs
.
add
(
config
);
//
defaultClusterConfigs.add(config);
}
else
{
// override other app configs
//
} else {// override other app configs
if
(
appIdMapOverrideAppConfig
==
null
)
{
//
if (appIdMapOverrideAppConfig == null) {
appIdMapOverrideAppConfig
=
new
HashMap
<>();
//
appIdMapOverrideAppConfig = new HashMap<>();
}
//
}
//
AppConfigVO
.
OverrideAppConfig
overrideAppConfig
=
//
AppConfigVO.OverrideAppConfig overrideAppConfig =
appIdMapOverrideAppConfig
.
get
(
targetAppId
);
//
appIdMapOverrideAppConfig.get(targetAppId);
//
if
(
overrideAppConfig
==
null
)
{
//
if (overrideAppConfig == null) {
overrideAppConfig
=
new
AppConfigVO
.
OverrideAppConfig
();
//
overrideAppConfig = new AppConfigVO.OverrideAppConfig();
appIdMapOverrideAppConfig
.
put
(
targetAppId
,
overrideAppConfig
);
//
appIdMapOverrideAppConfig.put(targetAppId, overrideAppConfig);
overrideAppConfigs
.
add
(
overrideAppConfig
);
//
overrideAppConfigs.add(overrideAppConfig);
}
//
}
//
overrideAppConfig
.
setAppId
(
targetAppId
);
//
overrideAppConfig.setAppId(targetAppId);
overrideAppConfig
.
addConfig
(
config
);
//
overrideAppConfig.addConfig(config);
}
//
}
}
//
}
}
}
private
void
collectSpecialClusterConfigs
(
String
clusterName
,
List
<
ItemDTO
>
clusterConfigs
,
private
void
collectSpecialClusterConfigs
(
String
clusterName
,
List
<
ItemDTO
>
clusterConfigs
,
...
...
apollo-portal/src/test/java/com/ctrip/apollo/portal/service/ConfigServiceTest.java
View file @
e74556fe
...
@@ -187,7 +187,7 @@ public class ConfigServiceTest {
...
@@ -187,7 +187,7 @@ public class ConfigServiceTest {
private
ReleaseDTO
assembleReleaseSnapShot
(
long
releaseId
,
String
clusterName
,
private
ReleaseDTO
assembleReleaseSnapShot
(
long
releaseId
,
String
clusterName
,
String
configurations
)
{
String
configurations
)
{
ReleaseDTO
releaseSnapShot
=
new
ReleaseDTO
();
ReleaseDTO
releaseSnapShot
=
new
ReleaseDTO
();
releaseSnapShot
.
setReleaseId
(
releaseId
);
//
releaseSnapShot.setReleaseId(releaseId);
releaseSnapShot
.
setClusterName
(
clusterName
);
releaseSnapShot
.
setClusterName
(
clusterName
);
releaseSnapShot
.
setConfigurations
(
configurations
);
releaseSnapShot
.
setConfigurations
(
configurations
);
return
releaseSnapShot
;
return
releaseSnapShot
;
...
@@ -221,9 +221,9 @@ public class ConfigServiceTest {
...
@@ -221,9 +221,9 @@ public class ConfigServiceTest {
private
ItemDTO
assembleConfigItem
(
long
clusterId
,
String
clusterName
,
String
appId
,
private
ItemDTO
assembleConfigItem
(
long
clusterId
,
String
clusterName
,
String
appId
,
String
key
,
String
value
)
{
String
key
,
String
value
)
{
ItemDTO
configItem
=
new
ItemDTO
();
ItemDTO
configItem
=
new
ItemDTO
();
configItem
.
setClusterName
(
clusterName
);
//
configItem.setClusterName(clusterName);
configItem
.
setClusterId
(
clusterId
);
//
configItem.setClusterId(clusterId);
configItem
.
setAppId
(
appId
);
//
configItem.setAppId(appId);
configItem
.
setKey
(
key
);
configItem
.
setKey
(
key
);
configItem
.
setValue
(
value
);
configItem
.
setValue
(
value
);
return
configItem
;
return
configItem
;
...
...
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