Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
apollo
Commits
34b912c5
Commit
34b912c5
authored
Dec 31, 2018
by
kezhenxu94
Committed by
Jason Song
Dec 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typo
parent
0ab20b09
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
57 additions
and
59 deletions
+57
-59
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/AppController.java
...amework/apollo/adminservice/controller/AppController.java
+3
-3
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/AppNamespaceController.java
...pollo/adminservice/controller/AppNamespaceController.java
+2
-2
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ClusterController.java
...ork/apollo/adminservice/controller/ClusterController.java
+3
-3
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/InstanceConfigController.java
...llo/adminservice/controller/InstanceConfigController.java
+1
-1
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ItemController.java
...mework/apollo/adminservice/controller/ItemController.java
+7
-7
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/NamespaceBranchController.java
...lo/adminservice/controller/NamespaceBranchController.java
+3
-3
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/NamespaceController.java
...k/apollo/adminservice/controller/NamespaceController.java
+5
-5
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/NamespaceLockController.java
...ollo/adminservice/controller/NamespaceLockController.java
+1
-1
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ReleaseController.java
...ork/apollo/adminservice/controller/ReleaseController.java
+5
-5
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/AppControllerTest.java
...ork/apollo/adminservice/controller/AppControllerTest.java
+2
-2
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ItemSetService.java
...om/ctrip/framework/apollo/biz/service/ItemSetService.java
+3
-3
apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/BeanUtils.java
...va/com/ctrip/framework/apollo/common/utils/BeanUtils.java
+4
-4
apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/util/OpenApiBeanUtils.java
...ctrip/framework/apollo/openapi/util/OpenApiBeanUtils.java
+7
-7
apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/NamespaceBranchController.java
...ollo/openapi/v1/controller/NamespaceBranchController.java
+1
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ReleaseController.java
...ework/apollo/openapi/v1/controller/ReleaseController.java
+3
-3
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/NamespaceController.java
...amework/apollo/portal/controller/NamespaceController.java
+1
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/listener/AppInfoChangedListener.java
...mework/apollo/portal/listener/AppInfoChangedListener.java
+1
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/listener/CreationListener.java
...ip/framework/apollo/portal/listener/CreationListener.java
+2
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/listener/DeletionListener.java
...ip/framework/apollo/portal/listener/DeletionListener.java
+2
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppService.java
...com/ctrip/framework/apollo/portal/service/AppService.java
+1
-1
No files found.
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/AppController.java
View file @
34b912c5
...
@@ -36,7 +36,7 @@ public class AppController {
...
@@ -36,7 +36,7 @@ public class AppController {
if
(!
InputValidator
.
isValidClusterNamespace
(
dto
.
getAppId
()))
{
if
(!
InputValidator
.
isValidClusterNamespace
(
dto
.
getAppId
()))
{
throw
new
BadRequestException
(
String
.
format
(
"AppId格式错误: %s"
,
InputValidator
.
INVALID_CLUSTER_NAMESPACE_MESSAGE
));
throw
new
BadRequestException
(
String
.
format
(
"AppId格式错误: %s"
,
InputValidator
.
INVALID_CLUSTER_NAMESPACE_MESSAGE
));
}
}
App
entity
=
BeanUtils
.
transf
ro
m
(
App
.
class
,
dto
);
App
entity
=
BeanUtils
.
transf
or
m
(
App
.
class
,
dto
);
App
managedEntity
=
appService
.
findOne
(
entity
.
getAppId
());
App
managedEntity
=
appService
.
findOne
(
entity
.
getAppId
());
if
(
managedEntity
!=
null
)
{
if
(
managedEntity
!=
null
)
{
throw
new
BadRequestException
(
"app already exist."
);
throw
new
BadRequestException
(
"app already exist."
);
...
@@ -44,7 +44,7 @@ public class AppController {
...
@@ -44,7 +44,7 @@ public class AppController {
entity
=
adminService
.
createNewApp
(
entity
);
entity
=
adminService
.
createNewApp
(
entity
);
dto
=
BeanUtils
.
transf
ro
m
(
AppDTO
.
class
,
entity
);
dto
=
BeanUtils
.
transf
or
m
(
AppDTO
.
class
,
entity
);
return
dto
;
return
dto
;
}
}
...
@@ -84,7 +84,7 @@ public class AppController {
...
@@ -84,7 +84,7 @@ public class AppController {
if
(
app
==
null
)
{
if
(
app
==
null
)
{
throw
new
NotFoundException
(
"app not found for appId "
+
appId
);
throw
new
NotFoundException
(
"app not found for appId "
+
appId
);
}
}
return
BeanUtils
.
transf
ro
m
(
AppDTO
.
class
,
app
);
return
BeanUtils
.
transf
or
m
(
AppDTO
.
class
,
app
);
}
}
@RequestMapping
(
value
=
"/apps/{appId}/unique"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/apps/{appId}/unique"
,
method
=
RequestMethod
.
GET
)
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/AppNamespaceController.java
View file @
34b912c5
...
@@ -34,7 +34,7 @@ public class AppNamespaceController {
...
@@ -34,7 +34,7 @@ public class AppNamespaceController {
public
AppNamespaceDTO
create
(
@RequestBody
AppNamespaceDTO
appNamespace
,
public
AppNamespaceDTO
create
(
@RequestBody
AppNamespaceDTO
appNamespace
,
@RequestParam
(
defaultValue
=
"false"
)
boolean
silentCreation
)
{
@RequestParam
(
defaultValue
=
"false"
)
boolean
silentCreation
)
{
AppNamespace
entity
=
BeanUtils
.
transf
ro
m
(
AppNamespace
.
class
,
appNamespace
);
AppNamespace
entity
=
BeanUtils
.
transf
or
m
(
AppNamespace
.
class
,
appNamespace
);
AppNamespace
managedEntity
=
appNamespaceService
.
findOne
(
entity
.
getAppId
(),
entity
.
getName
());
AppNamespace
managedEntity
=
appNamespaceService
.
findOne
(
entity
.
getAppId
(),
entity
.
getName
());
if
(
managedEntity
==
null
)
{
if
(
managedEntity
==
null
)
{
...
@@ -52,7 +52,7 @@ public class AppNamespaceController {
...
@@ -52,7 +52,7 @@ public class AppNamespaceController {
throw
new
BadRequestException
(
"app namespaces already exist."
);
throw
new
BadRequestException
(
"app namespaces already exist."
);
}
}
return
BeanUtils
.
transf
ro
m
(
AppNamespaceDTO
.
class
,
entity
);
return
BeanUtils
.
transf
or
m
(
AppNamespaceDTO
.
class
,
entity
);
}
}
@RequestMapping
(
value
=
"/apps/{appId}/appnamespaces/{namespaceName:.+}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/apps/{appId}/appnamespaces/{namespaceName:.+}"
,
method
=
RequestMethod
.
DELETE
)
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ClusterController.java
View file @
34b912c5
...
@@ -33,7 +33,7 @@ public class ClusterController {
...
@@ -33,7 +33,7 @@ public class ClusterController {
throw
new
BadRequestException
(
String
.
format
(
"Cluster格式错误: %s"
,
InputValidator
.
INVALID_CLUSTER_NAMESPACE_MESSAGE
));
throw
new
BadRequestException
(
String
.
format
(
"Cluster格式错误: %s"
,
InputValidator
.
INVALID_CLUSTER_NAMESPACE_MESSAGE
));
}
}
Cluster
entity
=
BeanUtils
.
transf
ro
m
(
Cluster
.
class
,
dto
);
Cluster
entity
=
BeanUtils
.
transf
or
m
(
Cluster
.
class
,
dto
);
Cluster
managedEntity
=
clusterService
.
findOne
(
appId
,
entity
.
getName
());
Cluster
managedEntity
=
clusterService
.
findOne
(
appId
,
entity
.
getName
());
if
(
managedEntity
!=
null
)
{
if
(
managedEntity
!=
null
)
{
throw
new
BadRequestException
(
"cluster already exist."
);
throw
new
BadRequestException
(
"cluster already exist."
);
...
@@ -45,7 +45,7 @@ public class ClusterController {
...
@@ -45,7 +45,7 @@ public class ClusterController {
entity
=
clusterService
.
saveWithoutInstanceOfAppNamespaces
(
entity
);
entity
=
clusterService
.
saveWithoutInstanceOfAppNamespaces
(
entity
);
}
}
dto
=
BeanUtils
.
transf
ro
m
(
ClusterDTO
.
class
,
entity
);
dto
=
BeanUtils
.
transf
or
m
(
ClusterDTO
.
class
,
entity
);
return
dto
;
return
dto
;
}
}
...
@@ -79,7 +79,7 @@ public class ClusterController {
...
@@ -79,7 +79,7 @@ public class ClusterController {
if
(
cluster
==
null
)
{
if
(
cluster
==
null
)
{
throw
new
NotFoundException
(
"cluster not found for name "
+
clusterName
);
throw
new
NotFoundException
(
"cluster not found for name "
+
clusterName
);
}
}
return
BeanUtils
.
transf
ro
m
(
ClusterDTO
.
class
,
cluster
);
return
BeanUtils
.
transf
or
m
(
ClusterDTO
.
class
,
cluster
);
}
}
@RequestMapping
(
value
=
"/apps/{appId}/cluster/{clusterName}/unique"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/apps/{appId}/cluster/{clusterName}/unique"
,
method
=
RequestMethod
.
GET
)
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/InstanceConfigController.java
View file @
34b912c5
...
@@ -139,7 +139,7 @@ public class InstanceConfigController {
...
@@ -139,7 +139,7 @@ public class InstanceConfigController {
for
(
Release
release
:
otherReleases
)
{
for
(
Release
release
:
otherReleases
)
{
//unset configurations to save space
//unset configurations to save space
release
.
setConfigurations
(
null
);
release
.
setConfigurations
(
null
);
ReleaseDTO
releaseDTO
=
BeanUtils
.
transf
ro
m
(
ReleaseDTO
.
class
,
release
);
ReleaseDTO
releaseDTO
=
BeanUtils
.
transf
or
m
(
ReleaseDTO
.
class
,
release
);
releaseMap
.
put
(
release
.
getReleaseKey
(),
releaseDTO
);
releaseMap
.
put
(
release
.
getReleaseKey
(),
releaseDTO
);
}
}
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ItemController.java
View file @
34b912c5
...
@@ -38,7 +38,7 @@ public class ItemController {
...
@@ -38,7 +38,7 @@ public class ItemController {
public
ItemDTO
create
(
@PathVariable
(
"appId"
)
String
appId
,
public
ItemDTO
create
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
,
@RequestBody
ItemDTO
dto
)
{
@PathVariable
(
"namespaceName"
)
String
namespaceName
,
@RequestBody
ItemDTO
dto
)
{
Item
entity
=
BeanUtils
.
transf
ro
m
(
Item
.
class
,
dto
);
Item
entity
=
BeanUtils
.
transf
or
m
(
Item
.
class
,
dto
);
ConfigChangeContentBuilder
builder
=
new
ConfigChangeContentBuilder
();
ConfigChangeContentBuilder
builder
=
new
ConfigChangeContentBuilder
();
Item
managedEntity
=
itemService
.
findOne
(
appId
,
clusterName
,
namespaceName
,
entity
.
getKey
());
Item
managedEntity
=
itemService
.
findOne
(
appId
,
clusterName
,
namespaceName
,
entity
.
getKey
());
...
@@ -48,7 +48,7 @@ public class ItemController {
...
@@ -48,7 +48,7 @@ public class ItemController {
entity
=
itemService
.
save
(
entity
);
entity
=
itemService
.
save
(
entity
);
builder
.
createItem
(
entity
);
builder
.
createItem
(
entity
);
}
}
dto
=
BeanUtils
.
transf
ro
m
(
ItemDTO
.
class
,
entity
);
dto
=
BeanUtils
.
transf
or
m
(
ItemDTO
.
class
,
entity
);
Commit
commit
=
new
Commit
();
Commit
commit
=
new
Commit
();
commit
.
setAppId
(
appId
);
commit
.
setAppId
(
appId
);
...
@@ -70,7 +70,7 @@ public class ItemController {
...
@@ -70,7 +70,7 @@ public class ItemController {
@PathVariable
(
"itemId"
)
long
itemId
,
@PathVariable
(
"itemId"
)
long
itemId
,
@RequestBody
ItemDTO
itemDTO
)
{
@RequestBody
ItemDTO
itemDTO
)
{
Item
entity
=
BeanUtils
.
transf
ro
m
(
Item
.
class
,
itemDTO
);
Item
entity
=
BeanUtils
.
transf
or
m
(
Item
.
class
,
itemDTO
);
ConfigChangeContentBuilder
builder
=
new
ConfigChangeContentBuilder
();
ConfigChangeContentBuilder
builder
=
new
ConfigChangeContentBuilder
();
...
@@ -79,7 +79,7 @@ public class ItemController {
...
@@ -79,7 +79,7 @@ public class ItemController {
throw
new
BadRequestException
(
"item not exist"
);
throw
new
BadRequestException
(
"item not exist"
);
}
}
Item
beforeUpdateItem
=
BeanUtils
.
transf
ro
m
(
Item
.
class
,
managedEntity
);
Item
beforeUpdateItem
=
BeanUtils
.
transf
or
m
(
Item
.
class
,
managedEntity
);
//protect. only value,comment,lastModifiedBy can be modified
//protect. only value,comment,lastModifiedBy can be modified
managedEntity
.
setValue
(
entity
.
getValue
());
managedEntity
.
setValue
(
entity
.
getValue
());
...
@@ -88,7 +88,7 @@ public class ItemController {
...
@@ -88,7 +88,7 @@ public class ItemController {
entity
=
itemService
.
update
(
managedEntity
);
entity
=
itemService
.
update
(
managedEntity
);
builder
.
updateItem
(
beforeUpdateItem
,
entity
);
builder
.
updateItem
(
beforeUpdateItem
,
entity
);
itemDTO
=
BeanUtils
.
transf
ro
m
(
ItemDTO
.
class
,
entity
);
itemDTO
=
BeanUtils
.
transf
or
m
(
ItemDTO
.
class
,
entity
);
if
(
builder
.
hasContent
())
{
if
(
builder
.
hasContent
())
{
Commit
commit
=
new
Commit
();
Commit
commit
=
new
Commit
();
...
@@ -138,7 +138,7 @@ public class ItemController {
...
@@ -138,7 +138,7 @@ public class ItemController {
if
(
item
==
null
)
{
if
(
item
==
null
)
{
throw
new
NotFoundException
(
"item not found for itemId "
+
itemId
);
throw
new
NotFoundException
(
"item not found for itemId "
+
itemId
);
}
}
return
BeanUtils
.
transf
ro
m
(
ItemDTO
.
class
,
item
);
return
BeanUtils
.
transf
or
m
(
ItemDTO
.
class
,
item
);
}
}
@RequestMapping
(
value
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key:.+}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key:.+}"
,
method
=
RequestMethod
.
GET
)
...
@@ -150,7 +150,7 @@ public class ItemController {
...
@@ -150,7 +150,7 @@ public class ItemController {
throw
new
NotFoundException
(
throw
new
NotFoundException
(
String
.
format
(
"item not found for %s %s %s %s"
,
appId
,
clusterName
,
namespaceName
,
key
));
String
.
format
(
"item not found for %s %s %s %s"
,
appId
,
clusterName
,
namespaceName
,
key
));
}
}
return
BeanUtils
.
transf
ro
m
(
ItemDTO
.
class
,
item
);
return
BeanUtils
.
transf
or
m
(
ItemDTO
.
class
,
item
);
}
}
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/NamespaceBranchController.java
View file @
34b912c5
...
@@ -44,7 +44,7 @@ public class NamespaceBranchController {
...
@@ -44,7 +44,7 @@ public class NamespaceBranchController {
Namespace
createdBranch
=
namespaceBranchService
.
createBranch
(
appId
,
clusterName
,
namespaceName
,
operator
);
Namespace
createdBranch
=
namespaceBranchService
.
createBranch
(
appId
,
clusterName
,
namespaceName
,
operator
);
return
BeanUtils
.
transf
ro
m
(
NamespaceDTO
.
class
,
createdBranch
);
return
BeanUtils
.
transf
or
m
(
NamespaceDTO
.
class
,
createdBranch
);
}
}
@RequestMapping
(
value
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/rules"
,
@RequestMapping
(
value
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/rules"
,
...
@@ -79,7 +79,7 @@ public class NamespaceBranchController {
...
@@ -79,7 +79,7 @@ public class NamespaceBranchController {
checkBranch
(
appId
,
clusterName
,
namespaceName
,
branchName
);
checkBranch
(
appId
,
clusterName
,
namespaceName
,
branchName
);
GrayReleaseRule
newRules
=
BeanUtils
.
transf
ro
m
(
GrayReleaseRule
.
class
,
newRuleDto
);
GrayReleaseRule
newRules
=
BeanUtils
.
transf
or
m
(
GrayReleaseRule
.
class
,
newRuleDto
);
newRules
.
setRules
(
GrayReleaseRuleItemTransformer
.
batchTransformToJSON
(
newRuleDto
.
getRuleItems
()));
newRules
.
setRules
(
GrayReleaseRuleItemTransformer
.
batchTransformToJSON
(
newRuleDto
.
getRuleItems
()));
newRules
.
setBranchStatus
(
NamespaceBranchStatus
.
ACTIVE
);
newRules
.
setBranchStatus
(
NamespaceBranchStatus
.
ACTIVE
);
...
@@ -116,7 +116,7 @@ public class NamespaceBranchController {
...
@@ -116,7 +116,7 @@ public class NamespaceBranchController {
return
null
;
return
null
;
}
}
return
BeanUtils
.
transf
ro
m
(
NamespaceDTO
.
class
,
childNamespace
);
return
BeanUtils
.
transf
or
m
(
NamespaceDTO
.
class
,
childNamespace
);
}
}
private
void
checkBranch
(
String
appId
,
String
clusterName
,
String
namespaceName
,
String
branchName
)
{
private
void
checkBranch
(
String
appId
,
String
clusterName
,
String
namespaceName
,
String
branchName
)
{
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/NamespaceController.java
View file @
34b912c5
...
@@ -31,7 +31,7 @@ public class NamespaceController {
...
@@ -31,7 +31,7 @@ public class NamespaceController {
if
(!
InputValidator
.
isValidClusterNamespace
(
dto
.
getNamespaceName
()))
{
if
(!
InputValidator
.
isValidClusterNamespace
(
dto
.
getNamespaceName
()))
{
throw
new
BadRequestException
(
String
.
format
(
"Namespace格式错误: %s"
,
InputValidator
.
INVALID_CLUSTER_NAMESPACE_MESSAGE
));
throw
new
BadRequestException
(
String
.
format
(
"Namespace格式错误: %s"
,
InputValidator
.
INVALID_CLUSTER_NAMESPACE_MESSAGE
));
}
}
Namespace
entity
=
BeanUtils
.
transf
ro
m
(
Namespace
.
class
,
dto
);
Namespace
entity
=
BeanUtils
.
transf
or
m
(
Namespace
.
class
,
dto
);
Namespace
managedEntity
=
namespaceService
.
findOne
(
appId
,
clusterName
,
entity
.
getNamespaceName
());
Namespace
managedEntity
=
namespaceService
.
findOne
(
appId
,
clusterName
,
entity
.
getNamespaceName
());
if
(
managedEntity
!=
null
)
{
if
(
managedEntity
!=
null
)
{
throw
new
BadRequestException
(
"namespace already exist."
);
throw
new
BadRequestException
(
"namespace already exist."
);
...
@@ -39,7 +39,7 @@ public class NamespaceController {
...
@@ -39,7 +39,7 @@ public class NamespaceController {
entity
=
namespaceService
.
save
(
entity
);
entity
=
namespaceService
.
save
(
entity
);
dto
=
BeanUtils
.
transf
ro
m
(
NamespaceDTO
.
class
,
entity
);
dto
=
BeanUtils
.
transf
or
m
(
NamespaceDTO
.
class
,
entity
);
return
dto
;
return
dto
;
}
}
...
@@ -66,7 +66,7 @@ public class NamespaceController {
...
@@ -66,7 +66,7 @@ public class NamespaceController {
Namespace
namespace
=
namespaceService
.
findOne
(
namespaceId
);
Namespace
namespace
=
namespaceService
.
findOne
(
namespaceId
);
if
(
namespace
==
null
)
if
(
namespace
==
null
)
throw
new
NotFoundException
(
String
.
format
(
"namespace not found for %s"
,
namespaceId
));
throw
new
NotFoundException
(
String
.
format
(
"namespace not found for %s"
,
namespaceId
));
return
BeanUtils
.
transf
ro
m
(
NamespaceDTO
.
class
,
namespace
);
return
BeanUtils
.
transf
or
m
(
NamespaceDTO
.
class
,
namespace
);
}
}
@RequestMapping
(
value
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName:.+}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName:.+}"
,
method
=
RequestMethod
.
GET
)
...
@@ -76,7 +76,7 @@ public class NamespaceController {
...
@@ -76,7 +76,7 @@ public class NamespaceController {
Namespace
namespace
=
namespaceService
.
findOne
(
appId
,
clusterName
,
namespaceName
);
Namespace
namespace
=
namespaceService
.
findOne
(
appId
,
clusterName
,
namespaceName
);
if
(
namespace
==
null
)
throw
new
NotFoundException
(
if
(
namespace
==
null
)
throw
new
NotFoundException
(
String
.
format
(
"namespace not found for %s %s %s"
,
appId
,
clusterName
,
namespaceName
));
String
.
format
(
"namespace not found for %s %s %s"
,
appId
,
clusterName
,
namespaceName
));
return
BeanUtils
.
transf
ro
m
(
NamespaceDTO
.
class
,
namespace
);
return
BeanUtils
.
transf
or
m
(
NamespaceDTO
.
class
,
namespace
);
}
}
@RequestMapping
(
value
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/associated-public-namespace"
,
@RequestMapping
(
value
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/associated-public-namespace"
,
...
@@ -90,7 +90,7 @@ public class NamespaceController {
...
@@ -90,7 +90,7 @@ public class NamespaceController {
throw
new
NotFoundException
(
String
.
format
(
"public namespace not found. namespace:%s"
,
namespaceName
));
throw
new
NotFoundException
(
String
.
format
(
"public namespace not found. namespace:%s"
,
namespaceName
));
}
}
return
BeanUtils
.
transf
ro
m
(
NamespaceDTO
.
class
,
namespace
);
return
BeanUtils
.
transf
or
m
(
NamespaceDTO
.
class
,
namespace
);
}
}
/**
/**
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/NamespaceLockController.java
View file @
34b912c5
...
@@ -44,7 +44,7 @@ public class NamespaceLockController {
...
@@ -44,7 +44,7 @@ public class NamespaceLockController {
return
null
;
return
null
;
}
}
return
BeanUtils
.
transf
ro
m
(
NamespaceLockDTO
.
class
,
lock
);
return
BeanUtils
.
transf
or
m
(
NamespaceLockDTO
.
class
,
lock
);
}
}
}
}
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ReleaseController.java
View file @
34b912c5
...
@@ -54,7 +54,7 @@ public class ReleaseController {
...
@@ -54,7 +54,7 @@ public class ReleaseController {
if
(
release
==
null
)
{
if
(
release
==
null
)
{
throw
new
NotFoundException
(
String
.
format
(
"release not found for %s"
,
releaseId
));
throw
new
NotFoundException
(
String
.
format
(
"release not found for %s"
,
releaseId
));
}
}
return
BeanUtils
.
transf
ro
m
(
ReleaseDTO
.
class
,
release
);
return
BeanUtils
.
transf
or
m
(
ReleaseDTO
.
class
,
release
);
}
}
@RequestMapping
(
value
=
"/releases"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/releases"
,
method
=
RequestMethod
.
GET
)
...
@@ -91,7 +91,7 @@ public class ReleaseController {
...
@@ -91,7 +91,7 @@ public class ReleaseController {
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
)
{
@PathVariable
(
"namespaceName"
)
String
namespaceName
)
{
Release
release
=
releaseService
.
findLatestActiveRelease
(
appId
,
clusterName
,
namespaceName
);
Release
release
=
releaseService
.
findLatestActiveRelease
(
appId
,
clusterName
,
namespaceName
);
return
BeanUtils
.
transf
ro
m
(
ReleaseDTO
.
class
,
release
);
return
BeanUtils
.
transf
or
m
(
ReleaseDTO
.
class
,
release
);
}
}
@Transactional
@Transactional
...
@@ -120,7 +120,7 @@ public class ReleaseController {
...
@@ -120,7 +120,7 @@ public class ReleaseController {
}
}
messageSender
.
sendMessage
(
ReleaseMessageKeyGenerator
.
generate
(
appId
,
messageCluster
,
namespaceName
),
messageSender
.
sendMessage
(
ReleaseMessageKeyGenerator
.
generate
(
appId
,
messageCluster
,
namespaceName
),
Topics
.
APOLLO_RELEASE_TOPIC
);
Topics
.
APOLLO_RELEASE_TOPIC
);
return
BeanUtils
.
transf
ro
m
(
ReleaseDTO
.
class
,
release
);
return
BeanUtils
.
transf
or
m
(
ReleaseDTO
.
class
,
release
);
}
}
...
@@ -157,7 +157,7 @@ public class ReleaseController {
...
@@ -157,7 +157,7 @@ public class ReleaseController {
messageSender
.
sendMessage
(
ReleaseMessageKeyGenerator
.
generate
(
appId
,
clusterName
,
namespaceName
),
messageSender
.
sendMessage
(
ReleaseMessageKeyGenerator
.
generate
(
appId
,
clusterName
,
namespaceName
),
Topics
.
APOLLO_RELEASE_TOPIC
);
Topics
.
APOLLO_RELEASE_TOPIC
);
return
BeanUtils
.
transf
ro
m
(
ReleaseDTO
.
class
,
release
);
return
BeanUtils
.
transf
or
m
(
ReleaseDTO
.
class
,
release
);
}
}
...
@@ -204,7 +204,7 @@ public class ReleaseController {
...
@@ -204,7 +204,7 @@ public class ReleaseController {
}
}
messageSender
.
sendMessage
(
ReleaseMessageKeyGenerator
.
generate
(
appId
,
messageCluster
,
namespaceName
),
messageSender
.
sendMessage
(
ReleaseMessageKeyGenerator
.
generate
(
appId
,
messageCluster
,
namespaceName
),
Topics
.
APOLLO_RELEASE_TOPIC
);
Topics
.
APOLLO_RELEASE_TOPIC
);
return
BeanUtils
.
transf
ro
m
(
ReleaseDTO
.
class
,
release
);
return
BeanUtils
.
transf
or
m
(
ReleaseDTO
.
class
,
release
);
}
}
}
}
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/AppControllerTest.java
View file @
34b912c5
...
@@ -85,7 +85,7 @@ public class AppControllerTest extends AbstractControllerTest {
...
@@ -85,7 +85,7 @@ public class AppControllerTest extends AbstractControllerTest {
@Sql
(
scripts
=
"/controller/cleanup.sql"
,
executionPhase
=
ExecutionPhase
.
AFTER_TEST_METHOD
)
@Sql
(
scripts
=
"/controller/cleanup.sql"
,
executionPhase
=
ExecutionPhase
.
AFTER_TEST_METHOD
)
public
void
testFind
()
{
public
void
testFind
()
{
AppDTO
dto
=
generateSampleDTOData
();
AppDTO
dto
=
generateSampleDTOData
();
App
app
=
BeanUtils
.
transf
ro
m
(
App
.
class
,
dto
);
App
app
=
BeanUtils
.
transf
or
m
(
App
.
class
,
dto
);
app
=
appRepository
.
save
(
app
);
app
=
appRepository
.
save
(
app
);
AppDTO
result
=
restTemplate
.
getForObject
(
getBaseAppUrl
()
+
dto
.
getAppId
(),
AppDTO
.
class
);
AppDTO
result
=
restTemplate
.
getForObject
(
getBaseAppUrl
()
+
dto
.
getAppId
(),
AppDTO
.
class
);
...
@@ -103,7 +103,7 @@ public class AppControllerTest extends AbstractControllerTest {
...
@@ -103,7 +103,7 @@ public class AppControllerTest extends AbstractControllerTest {
@Sql
(
scripts
=
"/controller/cleanup.sql"
,
executionPhase
=
ExecutionPhase
.
AFTER_TEST_METHOD
)
@Sql
(
scripts
=
"/controller/cleanup.sql"
,
executionPhase
=
ExecutionPhase
.
AFTER_TEST_METHOD
)
public
void
testDelete
()
{
public
void
testDelete
()
{
AppDTO
dto
=
generateSampleDTOData
();
AppDTO
dto
=
generateSampleDTOData
();
App
app
=
BeanUtils
.
transf
ro
m
(
App
.
class
,
dto
);
App
app
=
BeanUtils
.
transf
or
m
(
App
.
class
,
dto
);
app
=
appRepository
.
save
(
app
);
app
=
appRepository
.
save
(
app
);
restTemplate
.
delete
(
"http://localhost:{port}/apps/{appId}?operator={operator}"
,
port
,
app
.
getAppId
(),
"test"
);
restTemplate
.
delete
(
"http://localhost:{port}/apps/{appId}?operator={operator}"
,
port
,
app
.
getAppId
(),
"test"
);
...
...
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ItemSetService.java
View file @
34b912c5
...
@@ -41,7 +41,7 @@ public class ItemSetService {
...
@@ -41,7 +41,7 @@ public class ItemSetService {
if
(!
CollectionUtils
.
isEmpty
(
changeSet
.
getCreateItems
()))
{
if
(!
CollectionUtils
.
isEmpty
(
changeSet
.
getCreateItems
()))
{
for
(
ItemDTO
item
:
changeSet
.
getCreateItems
())
{
for
(
ItemDTO
item
:
changeSet
.
getCreateItems
())
{
Item
entity
=
BeanUtils
.
transf
ro
m
(
Item
.
class
,
item
);
Item
entity
=
BeanUtils
.
transf
or
m
(
Item
.
class
,
item
);
entity
.
setDataChangeCreatedBy
(
operator
);
entity
.
setDataChangeCreatedBy
(
operator
);
entity
.
setDataChangeLastModifiedBy
(
operator
);
entity
.
setDataChangeLastModifiedBy
(
operator
);
Item
createdItem
=
itemService
.
save
(
entity
);
Item
createdItem
=
itemService
.
save
(
entity
);
...
@@ -52,13 +52,13 @@ public class ItemSetService {
...
@@ -52,13 +52,13 @@ public class ItemSetService {
if
(!
CollectionUtils
.
isEmpty
(
changeSet
.
getUpdateItems
()))
{
if
(!
CollectionUtils
.
isEmpty
(
changeSet
.
getUpdateItems
()))
{
for
(
ItemDTO
item
:
changeSet
.
getUpdateItems
())
{
for
(
ItemDTO
item
:
changeSet
.
getUpdateItems
())
{
Item
entity
=
BeanUtils
.
transf
ro
m
(
Item
.
class
,
item
);
Item
entity
=
BeanUtils
.
transf
or
m
(
Item
.
class
,
item
);
Item
managedItem
=
itemService
.
findOne
(
entity
.
getId
());
Item
managedItem
=
itemService
.
findOne
(
entity
.
getId
());
if
(
managedItem
==
null
)
{
if
(
managedItem
==
null
)
{
throw
new
NotFoundException
(
String
.
format
(
"item not found.(key=%s)"
,
entity
.
getKey
()));
throw
new
NotFoundException
(
String
.
format
(
"item not found.(key=%s)"
,
entity
.
getKey
()));
}
}
Item
beforeUpdateItem
=
BeanUtils
.
transf
ro
m
(
Item
.
class
,
managedItem
);
Item
beforeUpdateItem
=
BeanUtils
.
transf
or
m
(
Item
.
class
,
managedItem
);
//protect. only value,comment,lastModifiedBy,lineNum can be modified
//protect. only value,comment,lastModifiedBy,lineNum can be modified
managedItem
.
setValue
(
entity
.
getValue
());
managedItem
.
setValue
(
entity
.
getValue
());
...
...
apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/BeanUtils.java
View file @
34b912c5
...
@@ -32,7 +32,7 @@ public class BeanUtils {
...
@@ -32,7 +32,7 @@ public class BeanUtils {
List
<
T
>
result
=
new
ArrayList
<>(
srcList
.
size
());
List
<
T
>
result
=
new
ArrayList
<>(
srcList
.
size
());
for
(
Object
srcObject
:
srcList
)
{
for
(
Object
srcObject
:
srcList
)
{
result
.
add
(
transf
ro
m
(
clazz
,
srcObject
));
result
.
add
(
transf
or
m
(
clazz
,
srcObject
));
}
}
return
result
;
return
result
;
}
}
...
@@ -45,7 +45,7 @@ public class BeanUtils {
...
@@ -45,7 +45,7 @@ public class BeanUtils {
* return BeanUtil.transform(UserDTO.class, userBean);
* return BeanUtil.transform(UserDTO.class, userBean);
* </pre>
* </pre>
*/
*/
public
static
<
T
>
T
transf
ro
m
(
Class
<
T
>
clazz
,
Object
src
)
{
public
static
<
T
>
T
transf
or
m
(
Class
<
T
>
clazz
,
Object
src
)
{
if
(
src
==
null
)
{
if
(
src
==
null
)
{
return
null
;
return
null
;
}
}
...
@@ -210,7 +210,7 @@ public class BeanUtils {
...
@@ -210,7 +210,7 @@ public class BeanUtils {
}
}
/**
/**
*
*
* @param source
* @param source
* @param target
* @param target
*/
*/
...
@@ -227,6 +227,6 @@ public class BeanUtils {
...
@@ -227,6 +227,6 @@ public class BeanUtils {
public
static
void
copyEntityProperties
(
Object
source
,
Object
target
)
{
public
static
void
copyEntityProperties
(
Object
source
,
Object
target
)
{
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
source
,
target
,
COPY_IGNORED_PROPERTIES
);
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
source
,
target
,
COPY_IGNORED_PROPERTIES
);
}
}
private
static
final
String
[]
COPY_IGNORED_PROPERTIES
=
{
"id"
,
"dataChangeCreatedBy"
,
"dataChangeCreatedTime"
,
"dataChangeLastModifiedTime"
};
private
static
final
String
[]
COPY_IGNORED_PROPERTIES
=
{
"id"
,
"dataChangeCreatedBy"
,
"dataChangeCreatedTime"
,
"dataChangeLastModifiedTime"
};
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/util/OpenApiBeanUtils.java
View file @
34b912c5
...
@@ -25,28 +25,28 @@ public class OpenApiBeanUtils {
...
@@ -25,28 +25,28 @@ public class OpenApiBeanUtils {
public
static
OpenItemDTO
transformFromItemDTO
(
ItemDTO
item
)
{
public
static
OpenItemDTO
transformFromItemDTO
(
ItemDTO
item
)
{
Preconditions
.
checkArgument
(
item
!=
null
);
Preconditions
.
checkArgument
(
item
!=
null
);
return
BeanUtils
.
transf
ro
m
(
OpenItemDTO
.
class
,
item
);
return
BeanUtils
.
transf
or
m
(
OpenItemDTO
.
class
,
item
);
}
}
public
static
ItemDTO
transformToItemDTO
(
OpenItemDTO
openItemDTO
)
{
public
static
ItemDTO
transformToItemDTO
(
OpenItemDTO
openItemDTO
)
{
Preconditions
.
checkArgument
(
openItemDTO
!=
null
);
Preconditions
.
checkArgument
(
openItemDTO
!=
null
);
return
BeanUtils
.
transf
ro
m
(
ItemDTO
.
class
,
openItemDTO
);
return
BeanUtils
.
transf
or
m
(
ItemDTO
.
class
,
openItemDTO
);
}
}
public
static
OpenAppNamespaceDTO
transformToOpenAppNamespaceDTO
(
AppNamespace
appNamespace
)
{
public
static
OpenAppNamespaceDTO
transformToOpenAppNamespaceDTO
(
AppNamespace
appNamespace
)
{
Preconditions
.
checkArgument
(
appNamespace
!=
null
);
Preconditions
.
checkArgument
(
appNamespace
!=
null
);
return
BeanUtils
.
transf
ro
m
(
OpenAppNamespaceDTO
.
class
,
appNamespace
);
return
BeanUtils
.
transf
or
m
(
OpenAppNamespaceDTO
.
class
,
appNamespace
);
}
}
public
static
AppNamespace
transformToAppNamespace
(
OpenAppNamespaceDTO
openAppNamespaceDTO
)
{
public
static
AppNamespace
transformToAppNamespace
(
OpenAppNamespaceDTO
openAppNamespaceDTO
)
{
Preconditions
.
checkArgument
(
openAppNamespaceDTO
!=
null
);
Preconditions
.
checkArgument
(
openAppNamespaceDTO
!=
null
);
return
BeanUtils
.
transf
ro
m
(
AppNamespace
.
class
,
openAppNamespaceDTO
);
return
BeanUtils
.
transf
or
m
(
AppNamespace
.
class
,
openAppNamespaceDTO
);
}
}
public
static
OpenReleaseDTO
transformFromReleaseDTO
(
ReleaseDTO
release
)
{
public
static
OpenReleaseDTO
transformFromReleaseDTO
(
ReleaseDTO
release
)
{
Preconditions
.
checkArgument
(
release
!=
null
);
Preconditions
.
checkArgument
(
release
!=
null
);
OpenReleaseDTO
openReleaseDTO
=
BeanUtils
.
transf
ro
m
(
OpenReleaseDTO
.
class
,
release
);
OpenReleaseDTO
openReleaseDTO
=
BeanUtils
.
transf
or
m
(
OpenReleaseDTO
.
class
,
release
);
Map
<
String
,
String
>
configs
=
gson
.
fromJson
(
release
.
getConfigurations
(),
type
);
Map
<
String
,
String
>
configs
=
gson
.
fromJson
(
release
.
getConfigurations
(),
type
);
...
@@ -57,7 +57,7 @@ public class OpenApiBeanUtils {
...
@@ -57,7 +57,7 @@ public class OpenApiBeanUtils {
public
static
OpenNamespaceDTO
transformFromNamespaceBO
(
NamespaceBO
namespaceBO
)
{
public
static
OpenNamespaceDTO
transformFromNamespaceBO
(
NamespaceBO
namespaceBO
)
{
Preconditions
.
checkArgument
(
namespaceBO
!=
null
);
Preconditions
.
checkArgument
(
namespaceBO
!=
null
);
OpenNamespaceDTO
openNamespaceDTO
=
BeanUtils
.
transf
ro
m
(
OpenNamespaceDTO
.
class
,
namespaceBO
OpenNamespaceDTO
openNamespaceDTO
=
BeanUtils
.
transf
or
m
(
OpenNamespaceDTO
.
class
,
namespaceBO
.
getBaseInfo
());
.
getBaseInfo
());
//app namespace info
//app namespace info
...
@@ -110,7 +110,7 @@ public class OpenApiBeanUtils {
...
@@ -110,7 +110,7 @@ public class OpenApiBeanUtils {
public
static
OpenGrayReleaseRuleDTO
transformFromGrayReleaseRuleDTO
(
GrayReleaseRuleDTO
grayReleaseRuleDTO
){
public
static
OpenGrayReleaseRuleDTO
transformFromGrayReleaseRuleDTO
(
GrayReleaseRuleDTO
grayReleaseRuleDTO
){
Preconditions
.
checkArgument
(
grayReleaseRuleDTO
!=
null
);
Preconditions
.
checkArgument
(
grayReleaseRuleDTO
!=
null
);
return
BeanUtils
.
transf
ro
m
(
OpenGrayReleaseRuleDTO
.
class
,
grayReleaseRuleDTO
);
return
BeanUtils
.
transf
or
m
(
OpenGrayReleaseRuleDTO
.
class
,
grayReleaseRuleDTO
);
}
}
public
static
GrayReleaseRuleDTO
transformToGrayReleaseRuleDTO
(
OpenGrayReleaseRuleDTO
openGrayReleaseRuleDTO
){
public
static
GrayReleaseRuleDTO
transformToGrayReleaseRuleDTO
(
OpenGrayReleaseRuleDTO
openGrayReleaseRuleDTO
){
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/NamespaceBranchController.java
View file @
34b912c5
...
@@ -15,7 +15,6 @@ import com.ctrip.framework.apollo.openapi.auth.ConsumerPermissionValidator;
...
@@ -15,7 +15,6 @@ import com.ctrip.framework.apollo.openapi.auth.ConsumerPermissionValidator;
import
com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleDTO
;
import
com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleDTO
;
import
com.ctrip.framework.apollo.openapi.dto.OpenNamespaceDTO
;
import
com.ctrip.framework.apollo.openapi.dto.OpenNamespaceDTO
;
import
com.ctrip.framework.apollo.openapi.util.OpenApiBeanUtils
;
import
com.ctrip.framework.apollo.openapi.util.OpenApiBeanUtils
;
import
com.ctrip.framework.apollo.portal.component.PermissionValidator
;
import
com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO
;
import
com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO
;
import
com.ctrip.framework.apollo.portal.service.NamespaceBranchService
;
import
com.ctrip.framework.apollo.portal.service.NamespaceBranchService
;
import
com.ctrip.framework.apollo.portal.service.ReleaseService
;
import
com.ctrip.framework.apollo.portal.service.ReleaseService
;
...
@@ -70,7 +69,7 @@ public class NamespaceBranchController {
...
@@ -70,7 +69,7 @@ public class NamespaceBranchController {
if
(
namespaceDTO
==
null
)
{
if
(
namespaceDTO
==
null
)
{
return
null
;
return
null
;
}
}
return
BeanUtils
.
transf
ro
m
(
OpenNamespaceDTO
.
class
,
namespaceDTO
);
return
BeanUtils
.
transf
or
m
(
OpenNamespaceDTO
.
class
,
namespaceDTO
);
}
}
@PreAuthorize
(
value
=
"@consumerPermissionValidator.hasModifyNamespacePermission(#request, #appId, #namespaceName, #env)"
)
@PreAuthorize
(
value
=
"@consumerPermissionValidator.hasModifyNamespacePermission(#request, #appId, #namespaceName, #env)"
)
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ReleaseController.java
View file @
34b912c5
...
@@ -57,7 +57,7 @@ public class ReleaseController {
...
@@ -57,7 +57,7 @@ public class ReleaseController {
throw
new
BadRequestException
(
"user(releaseBy) not exists"
);
throw
new
BadRequestException
(
"user(releaseBy) not exists"
);
}
}
NamespaceReleaseModel
releaseModel
=
BeanUtils
.
transf
ro
m
(
NamespaceReleaseModel
.
class
,
model
);
NamespaceReleaseModel
releaseModel
=
BeanUtils
.
transf
or
m
(
NamespaceReleaseModel
.
class
,
model
);
releaseModel
.
setAppId
(
appId
);
releaseModel
.
setAppId
(
appId
);
releaseModel
.
setEnv
(
Env
.
fromString
(
env
).
toString
());
releaseModel
.
setEnv
(
Env
.
fromString
(
env
).
toString
());
...
@@ -119,7 +119,7 @@ public class ReleaseController {
...
@@ -119,7 +119,7 @@ public class ReleaseController {
throw
new
BadRequestException
(
"user(releaseBy) not exists"
);
throw
new
BadRequestException
(
"user(releaseBy) not exists"
);
}
}
NamespaceReleaseModel
releaseModel
=
BeanUtils
.
transf
ro
m
(
NamespaceReleaseModel
.
class
,
model
);
NamespaceReleaseModel
releaseModel
=
BeanUtils
.
transf
or
m
(
NamespaceReleaseModel
.
class
,
model
);
releaseModel
.
setAppId
(
appId
);
releaseModel
.
setAppId
(
appId
);
releaseModel
.
setEnv
(
Env
.
fromString
(
env
).
toString
());
releaseModel
.
setEnv
(
Env
.
fromString
(
env
).
toString
());
...
@@ -149,7 +149,7 @@ public class ReleaseController {
...
@@ -149,7 +149,7 @@ public class ReleaseController {
throw
new
BadRequestException
(
"user(releaseBy) not exists"
);
throw
new
BadRequestException
(
"user(releaseBy) not exists"
);
}
}
NamespaceGrayDelReleaseModel
releaseModel
=
BeanUtils
.
transf
ro
m
(
NamespaceGrayDelReleaseModel
.
class
,
model
);
NamespaceGrayDelReleaseModel
releaseModel
=
BeanUtils
.
transf
or
m
(
NamespaceGrayDelReleaseModel
.
class
,
model
);
releaseModel
.
setAppId
(
appId
);
releaseModel
.
setAppId
(
appId
);
releaseModel
.
setEnv
(
env
.
toUpperCase
());
releaseModel
.
setEnv
(
env
.
toUpperCase
());
releaseModel
.
setClusterName
(
branchName
);
releaseModel
.
setClusterName
(
branchName
);
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/NamespaceController.java
View file @
34b912c5
...
@@ -172,7 +172,7 @@ public class NamespaceController {
...
@@ -172,7 +172,7 @@ public class NamespaceController {
String
.
format
(
"AppNamespace not exists. AppId = %s, NamespaceName = %s"
,
appId
,
namespaceName
));
String
.
format
(
"AppNamespace not exists. AppId = %s, NamespaceName = %s"
,
appId
,
namespaceName
));
}
}
return
BeanUtils
.
transf
ro
m
(
AppNamespaceDTO
.
class
,
appNamespace
);
return
BeanUtils
.
transf
or
m
(
AppNamespaceDTO
.
class
,
appNamespace
);
}
}
@PreAuthorize
(
value
=
"@permissionValidator.hasCreateAppNamespacePermission(#appId, #appNamespace)"
)
@PreAuthorize
(
value
=
"@permissionValidator.hasCreateAppNamespacePermission(#appId, #appNamespace)"
)
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/listener/AppInfoChangedListener.java
View file @
34b912c5
...
@@ -5,7 +5,6 @@ import com.ctrip.framework.apollo.common.utils.BeanUtils;
...
@@ -5,7 +5,6 @@ import com.ctrip.framework.apollo.common.utils.BeanUtils;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.framework.apollo.portal.component.PortalSettings
;
import
com.ctrip.framework.apollo.portal.component.PortalSettings
;
import
com.ctrip.framework.apollo.portal.spi.UserInfoHolder
;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -27,7 +26,7 @@ public class AppInfoChangedListener {
...
@@ -27,7 +26,7 @@ public class AppInfoChangedListener {
@EventListener
@EventListener
public
void
onAppInfoChange
(
AppInfoChangedEvent
event
)
{
public
void
onAppInfoChange
(
AppInfoChangedEvent
event
)
{
AppDTO
appDTO
=
BeanUtils
.
transf
ro
m
(
AppDTO
.
class
,
event
.
getApp
());
AppDTO
appDTO
=
BeanUtils
.
transf
or
m
(
AppDTO
.
class
,
event
.
getApp
());
String
appId
=
appDTO
.
getAppId
();
String
appId
=
appDTO
.
getAppId
();
List
<
Env
>
envs
=
portalSettings
.
getActiveEnvs
();
List
<
Env
>
envs
=
portalSettings
.
getActiveEnvs
();
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/listener/CreationListener.java
View file @
34b912c5
...
@@ -30,7 +30,7 @@ public class CreationListener {
...
@@ -30,7 +30,7 @@ public class CreationListener {
@EventListener
@EventListener
public
void
onAppCreationEvent
(
AppCreationEvent
event
)
{
public
void
onAppCreationEvent
(
AppCreationEvent
event
)
{
AppDTO
appDTO
=
BeanUtils
.
transf
ro
m
(
AppDTO
.
class
,
event
.
getApp
());
AppDTO
appDTO
=
BeanUtils
.
transf
or
m
(
AppDTO
.
class
,
event
.
getApp
());
List
<
Env
>
envs
=
portalSettings
.
getActiveEnvs
();
List
<
Env
>
envs
=
portalSettings
.
getActiveEnvs
();
for
(
Env
env
:
envs
)
{
for
(
Env
env
:
envs
)
{
try
{
try
{
...
@@ -44,7 +44,7 @@ public class CreationListener {
...
@@ -44,7 +44,7 @@ public class CreationListener {
@EventListener
@EventListener
public
void
onAppNamespaceCreationEvent
(
AppNamespaceCreationEvent
event
)
{
public
void
onAppNamespaceCreationEvent
(
AppNamespaceCreationEvent
event
)
{
AppNamespaceDTO
appNamespace
=
BeanUtils
.
transf
ro
m
(
AppNamespaceDTO
.
class
,
event
.
getAppNamespace
());
AppNamespaceDTO
appNamespace
=
BeanUtils
.
transf
or
m
(
AppNamespaceDTO
.
class
,
event
.
getAppNamespace
());
List
<
Env
>
envs
=
portalSettings
.
getActiveEnvs
();
List
<
Env
>
envs
=
portalSettings
.
getActiveEnvs
();
for
(
Env
env
:
envs
)
{
for
(
Env
env
:
envs
)
{
try
{
try
{
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/listener/DeletionListener.java
View file @
34b912c5
...
@@ -28,7 +28,7 @@ public class DeletionListener {
...
@@ -28,7 +28,7 @@ public class DeletionListener {
@EventListener
@EventListener
public
void
onAppDeletionEvent
(
AppDeletionEvent
event
)
{
public
void
onAppDeletionEvent
(
AppDeletionEvent
event
)
{
AppDTO
appDTO
=
BeanUtils
.
transf
ro
m
(
AppDTO
.
class
,
event
.
getApp
());
AppDTO
appDTO
=
BeanUtils
.
transf
or
m
(
AppDTO
.
class
,
event
.
getApp
());
String
appId
=
appDTO
.
getAppId
();
String
appId
=
appDTO
.
getAppId
();
String
operator
=
appDTO
.
getDataChangeLastModifiedBy
();
String
operator
=
appDTO
.
getDataChangeLastModifiedBy
();
...
@@ -45,7 +45,7 @@ public class DeletionListener {
...
@@ -45,7 +45,7 @@ public class DeletionListener {
@EventListener
@EventListener
public
void
onAppNamespaceDeletionEvent
(
AppNamespaceDeletionEvent
event
)
{
public
void
onAppNamespaceDeletionEvent
(
AppNamespaceDeletionEvent
event
)
{
AppNamespaceDTO
appNamespace
=
BeanUtils
.
transf
ro
m
(
AppNamespaceDTO
.
class
,
event
.
getAppNamespace
());
AppNamespaceDTO
appNamespace
=
BeanUtils
.
transf
or
m
(
AppNamespaceDTO
.
class
,
event
.
getAppNamespace
());
List
<
Env
>
envs
=
portalSettings
.
getActiveEnvs
();
List
<
Env
>
envs
=
portalSettings
.
getActiveEnvs
();
String
appId
=
appNamespace
.
getAppId
();
String
appId
=
appNamespace
.
getAppId
();
String
namespaceName
=
appNamespace
.
getName
();
String
namespaceName
=
appNamespace
.
getName
();
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppService.java
View file @
34b912c5
...
@@ -81,7 +81,7 @@ public class AppService {
...
@@ -81,7 +81,7 @@ public class AppService {
app
.
setDataChangeCreatedBy
(
username
);
app
.
setDataChangeCreatedBy
(
username
);
app
.
setDataChangeLastModifiedBy
(
username
);
app
.
setDataChangeLastModifiedBy
(
username
);
AppDTO
appDTO
=
BeanUtils
.
transf
ro
m
(
AppDTO
.
class
,
app
);
AppDTO
appDTO
=
BeanUtils
.
transf
or
m
(
AppDTO
.
class
,
app
);
appAPI
.
createApp
(
env
,
appDTO
);
appAPI
.
createApp
(
env
,
appDTO
);
}
}
...
...
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