Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zhangjian1949
apollo
提交
ea20fad0
apollo
项目概览
zhangjian1949
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ea20fad0
编写于
6月 07, 2016
作者:
L
lepdou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户信息通过dto传递
上级
be118512
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
227 addition
and
166 deletion
+227
-166
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/AppController.java
...amework/apollo/adminservice/controller/AppController.java
+4
-8
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/AppNamespaceController.java
...pollo/adminservice/controller/AppNamespaceController.java
+3
-8
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ClusterController.java
...ork/apollo/adminservice/controller/ClusterController.java
+6
-10
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ItemController.java
...mework/apollo/adminservice/controller/ItemController.java
+24
-22
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ItemSetController.java
...ork/apollo/adminservice/controller/ItemSetController.java
+2
-4
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/NamespaceController.java
...k/apollo/adminservice/controller/NamespaceController.java
+6
-10
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ReleaseController.java
...ork/apollo/adminservice/controller/ReleaseController.java
+2
-4
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ControllerExceptionTest.java
...ollo/adminservice/controller/ControllerExceptionTest.java
+3
-2
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ItemSetControllerTest.java
...apollo/adminservice/controller/ItemSetControllerTest.java
+9
-3
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ReleaseControllerTest.java
...apollo/adminservice/controller/ReleaseControllerTest.java
+2
-3
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ItemSetService.java
...om/ctrip/framework/apollo/biz/service/ItemSetService.java
+2
-1
apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/WebMvcConfig.java
...trip/framework/apollo/common/controller/WebMvcConfig.java
+1
-0
apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/BeanUtils.java
...va/com/ctrip/framework/apollo/common/utils/BeanUtils.java
+1
-2
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/AppDTO.java
...main/java/com/ctrip/framework/apollo/core/dto/AppDTO.java
+1
-1
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/AppNamespaceDTO.java
.../com/ctrip/framework/apollo/core/dto/AppNamespaceDTO.java
+1
-1
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/BaseDTO.java
...ain/java/com/ctrip/framework/apollo/core/dto/BaseDTO.java
+25
-0
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/ClusterDTO.java
.../java/com/ctrip/framework/apollo/core/dto/ClusterDTO.java
+1
-1
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/ItemChangeSets.java
...a/com/ctrip/framework/apollo/core/dto/ItemChangeSets.java
+1
-1
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/ItemDTO.java
...ain/java/com/ctrip/framework/apollo/core/dto/ItemDTO.java
+1
-1
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/NamespaceDTO.java
...ava/com/ctrip/framework/apollo/core/dto/NamespaceDTO.java
+1
-1
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/ReleaseDTO.java
.../java/com/ctrip/framework/apollo/core/dto/ReleaseDTO.java
+1
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/PortalSettings.java
...ava/com/ctrip/framework/apollo/portal/PortalSettings.java
+3
-3
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/api/API.java
.../main/java/com/ctrip/framework/apollo/portal/api/API.java
+2
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/api/AdminServiceAPI.java
...om/ctrip/framework/apollo/portal/api/AdminServiceAPI.java
+50
-53
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalAppService.java
...rip/framework/apollo/portal/service/PortalAppService.java
+12
-0
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalConfigService.java
.../framework/apollo/portal/service/PortalConfigService.java
+40
-13
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalNamespaceService.java
...amework/apollo/portal/service/PortalNamespaceService.java
+13
-5
apollo-portal/src/main/resources/static/config.html
apollo-portal/src/main/resources/static/config.html
+1
-1
apollo-portal/src/main/resources/static/config/sync.html
apollo-portal/src/main/resources/static/config/sync.html
+5
-3
apollo-portal/src/main/resources/static/scripts/controller/app/ConfigNamespaceController.js
...tatic/scripts/controller/app/ConfigNamespaceController.js
+4
-3
未找到文件。
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/AppController.java
浏览文件 @
ea20fad0
...
...
@@ -4,7 +4,6 @@ import java.util.List;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -15,7 +14,6 @@ import org.springframework.web.bind.annotation.RestController;
import
com.ctrip.framework.apollo.biz.entity.App
;
import
com.ctrip.framework.apollo.biz.service.AdminService
;
import
com.ctrip.framework.apollo.biz.service.AppService
;
import
com.ctrip.framework.apollo.common.auth.ActiveUser
;
import
com.ctrip.framework.apollo.common.utils.BeanUtils
;
import
com.ctrip.framework.apollo.core.dto.AppDTO
;
import
com.ctrip.framework.apollo.core.exception.NotFoundException
;
...
...
@@ -31,16 +29,14 @@ public class AppController {
private
AdminService
adminService
;
@RequestMapping
(
path
=
"/apps"
,
method
=
RequestMethod
.
POST
)
public
AppDTO
createOrUpdate
(
@RequestBody
AppDTO
dto
,
@ActiveUser
UserDetails
user
)
{
public
AppDTO
createOrUpdate
(
@RequestBody
AppDTO
dto
)
{
App
entity
=
BeanUtils
.
transfrom
(
App
.
class
,
dto
);
App
managedEntity
=
appService
.
findOne
(
entity
.
getAppId
());
if
(
managedEntity
!=
null
)
{
managedEntity
.
setDataChangeLastModifiedBy
(
user
.
getUsername
());
managedEntity
.
setDataChangeLastModifiedBy
(
entity
.
getDataChangeLastModifiedBy
());
BeanUtils
.
copyEntityProperties
(
entity
,
managedEntity
);
entity
=
appService
.
update
(
managedEntity
);
}
else
{
entity
.
setDataChangeCreatedBy
(
user
.
getUsername
());
entity
.
setDataChangeLastModifiedBy
(
user
.
getUsername
());
entity
=
adminService
.
createNewApp
(
entity
);
}
...
...
@@ -49,10 +45,10 @@ public class AppController {
}
@RequestMapping
(
path
=
"/apps/{appId}"
,
method
=
RequestMethod
.
DELETE
)
public
void
delete
(
@PathVariable
(
"appId"
)
String
appId
,
@
ActiveUser
UserDetails
use
r
)
{
public
void
delete
(
@PathVariable
(
"appId"
)
String
appId
,
@
RequestParam
String
operato
r
)
{
App
entity
=
appService
.
findOne
(
appId
);
if
(
entity
==
null
)
throw
new
NotFoundException
(
"app not found for appId "
+
appId
);
appService
.
delete
(
entity
.
getId
(),
user
.
getUsername
()
);
appService
.
delete
(
entity
.
getId
(),
operator
);
}
@RequestMapping
(
"/apps"
)
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/AppNamespaceController.java
浏览文件 @
ea20fad0
package
com.ctrip.framework.apollo.adminservice.controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -10,7 +9,6 @@ import org.springframework.web.bind.annotation.RestController;
import
com.ctrip.framework.apollo.biz.entity.AppNamespace
;
import
com.ctrip.framework.apollo.biz.service.AppNamespaceService
;
import
com.ctrip.framework.apollo.common.auth.ActiveUser
;
import
com.ctrip.framework.apollo.common.utils.BeanUtils
;
import
com.ctrip.framework.apollo.core.dto.AppNamespaceDTO
;
...
...
@@ -35,20 +33,17 @@ public class AppNamespaceController {
}
@RequestMapping
(
value
=
"/apps/{appId}/appnamespaces"
,
method
=
RequestMethod
.
POST
)
public
AppNamespaceDTO
createOrUpdate
(
@RequestBody
AppNamespaceDTO
appNamespace
,
@ActiveUser
UserDetails
user
){
public
AppNamespaceDTO
createOrUpdate
(
@RequestBody
AppNamespaceDTO
appNamespace
){
AppNamespace
entity
=
BeanUtils
.
transfrom
(
AppNamespace
.
class
,
appNamespace
);
AppNamespace
managedEntity
=
appNamespaceService
.
findOne
(
entity
.
getAppId
(),
entity
.
getName
());
String
userName
=
user
.
getUsername
();
if
(
managedEntity
!=
null
){
managedEntity
.
setDataChangeLastModifiedBy
(
userName
);
managedEntity
.
setDataChangeLastModifiedBy
(
entity
.
getDataChangeLastModifiedBy
()
);
BeanUtils
.
copyEntityProperties
(
entity
,
managedEntity
);
entity
=
appNamespaceService
.
update
(
managedEntity
);
}
else
{
entity
.
setDataChangeLastModifiedBy
(
userName
);
entity
.
setDataChangeCreatedBy
(
userName
);
entity
=
appNamespaceService
.
createAppNamespace
(
entity
,
userName
);
entity
=
appNamespaceService
.
createAppNamespace
(
entity
,
entity
.
getDataChangeCreatedBy
());
}
return
BeanUtils
.
transfrom
(
AppNamespaceDTO
.
class
,
entity
);
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ClusterController.java
浏览文件 @
ea20fad0
...
...
@@ -3,16 +3,15 @@ package com.ctrip.framework.apollo.adminservice.controller;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ctrip.framework.apollo.biz.entity.Cluster
;
import
com.ctrip.framework.apollo.biz.service.ClusterService
;
import
com.ctrip.framework.apollo.common.auth.ActiveUser
;
import
com.ctrip.framework.apollo.common.utils.BeanUtils
;
import
com.ctrip.framework.apollo.core.dto.ClusterDTO
;
import
com.ctrip.framework.apollo.core.exception.NotFoundException
;
...
...
@@ -24,16 +23,13 @@ public class ClusterController {
private
ClusterService
clusterService
;
@RequestMapping
(
path
=
"/apps/{appId}/clusters"
,
method
=
RequestMethod
.
POST
)
public
ClusterDTO
createOrUpdate
(
@PathVariable
(
"appId"
)
String
appId
,
@RequestBody
ClusterDTO
dto
,
@ActiveUser
UserDetails
user
)
{
public
ClusterDTO
createOrUpdate
(
@PathVariable
(
"appId"
)
String
appId
,
@RequestBody
ClusterDTO
dto
)
{
Cluster
entity
=
BeanUtils
.
transfrom
(
Cluster
.
class
,
dto
);
Cluster
managedEntity
=
clusterService
.
findOne
(
appId
,
entity
.
getName
());
if
(
managedEntity
!=
null
)
{
managedEntity
.
setDataChangeLastModifiedBy
(
user
.
getUsername
());
BeanUtils
.
copyEntityProperties
(
entity
,
managedEntity
);
entity
=
clusterService
.
update
(
managedEntity
);
}
else
{
entity
.
setDataChangeCreatedBy
(
user
.
getUsername
());
entity
=
clusterService
.
save
(
entity
);
}
...
...
@@ -41,13 +37,13 @@ public class ClusterController {
return
dto
;
}
@RequestMapping
(
path
=
"/apps/{appId}/clusters/{clusterName}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
path
=
"/apps/{appId}/clusters/{clusterName
:.+
}"
,
method
=
RequestMethod
.
DELETE
)
public
void
delete
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@
ActiveUser
UserDetails
use
r
)
{
@PathVariable
(
"clusterName"
)
String
clusterName
,
@
RequestParam
String
operato
r
)
{
Cluster
entity
=
clusterService
.
findOne
(
appId
,
clusterName
);
if
(
entity
==
null
)
throw
new
NotFoundException
(
"cluster not found for clusterName "
+
clusterName
);
clusterService
.
delete
(
entity
.
getId
(),
user
.
getUsername
()
);
clusterService
.
delete
(
entity
.
getId
(),
operator
);
}
@RequestMapping
(
"/apps/{appId}/clusters"
)
...
...
@@ -56,7 +52,7 @@ public class ClusterController {
return
BeanUtils
.
batchTransform
(
ClusterDTO
.
class
,
clusters
);
}
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}"
)
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName
:.+
}"
)
public
ClusterDTO
get
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
)
{
Cluster
cluster
=
clusterService
.
findOne
(
appId
,
clusterName
);
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ItemController.java
浏览文件 @
ea20fad0
...
...
@@ -4,16 +4,15 @@ import java.util.LinkedList;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ctrip.framework.apollo.biz.entity.Item
;
import
com.ctrip.framework.apollo.biz.service.ItemService
;
import
com.ctrip.framework.apollo.common.auth.ActiveUser
;
import
com.ctrip.framework.apollo.common.utils.BeanUtils
;
import
com.ctrip.framework.apollo.core.dto.ItemDTO
;
import
com.ctrip.framework.apollo.core.exception.NotFoundException
;
...
...
@@ -26,24 +25,21 @@ public class ItemController {
@RequestMapping
(
path
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items"
,
method
=
RequestMethod
.
POST
)
public
ItemDTO
createOrUpdate
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
,
@RequestBody
ItemDTO
dto
,
@ActiveUser
UserDetails
user
)
{
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
,
@RequestBody
ItemDTO
dto
)
{
Item
entity
=
BeanUtils
.
transfrom
(
Item
.
class
,
dto
);
Item
managedEntity
=
itemService
.
findOne
(
appId
,
clusterName
,
namespaceName
,
entity
.
getKey
());
if
(
managedEntity
!=
null
)
{
managedEntity
.
setDataChangeLastModifiedBy
(
user
.
getUsername
());
BeanUtils
.
copyEntityProperties
(
entity
,
managedEntity
);
entity
=
itemService
.
update
(
managedEntity
);
}
else
{
Item
lastItem
=
itemService
.
findLastOne
(
appId
,
clusterName
,
namespaceName
);
int
lineNum
=
1
;
if
(
lastItem
!=
null
){
lineNum
=
lastItem
.
getLineNum
()
+
1
;
if
(
lastItem
!=
null
)
{
Integer
lastItemNum
=
lastItem
.
getLineNum
();
lineNum
=
lastItemNum
==
null
?
1
:
lastItemNum
+
1
;
}
entity
.
setLineNum
(
lineNum
);
entity
.
setDataChangeCreatedBy
(
user
.
getUsername
());
entity
.
setDataChangeLastModifiedBy
(
user
.
getUsername
());
entity
=
itemService
.
save
(
entity
);
}
...
...
@@ -52,20 +48,22 @@ public class ItemController {
}
@RequestMapping
(
path
=
"/items/{itemId}"
,
method
=
RequestMethod
.
DELETE
)
public
void
delete
(
@PathVariable
(
"itemId"
)
long
itemId
,
@
ActiveUser
UserDetails
use
r
)
{
public
void
delete
(
@PathVariable
(
"itemId"
)
long
itemId
,
@
RequestParam
String
operato
r
)
{
Item
entity
=
itemService
.
findOne
(
itemId
);
if
(
entity
==
null
)
throw
new
NotFoundException
(
"item not found for itemId "
+
itemId
);
itemService
.
delete
(
entity
.
getId
(),
user
.
getUsername
());
if
(
entity
==
null
)
{
throw
new
NotFoundException
(
"item not found for itemId "
+
itemId
);
}
itemService
.
delete
(
entity
.
getId
(),
operator
);
}
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items"
)
public
List
<
ItemDTO
>
findItems
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
)
{
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
)
{
List
<
Item
>
items
=
itemService
.
findItems
(
appId
,
clusterName
,
namespaceName
);
List
<
ItemDTO
>
itemDTOs
=
new
LinkedList
<>();
for
(
Item
item
:
items
)
{
for
(
Item
item
:
items
)
{
ItemDTO
itemDTO
=
BeanUtils
.
transfrom
(
ItemDTO
.
class
,
item
);
itemDTO
.
setLastModifiedBy
(
item
.
getDataChangeLastModifiedBy
());
itemDTO
.
setLastModifiedTime
(
item
.
getDataChangeLastModifiedTime
());
...
...
@@ -77,17 +75,21 @@ public class ItemController {
@RequestMapping
(
"/items/{itemId}"
)
public
ItemDTO
get
(
@PathVariable
(
"itemId"
)
long
itemId
)
{
Item
item
=
itemService
.
findOne
(
itemId
);
if
(
item
==
null
)
throw
new
NotFoundException
(
"item not found for itemId "
+
itemId
);
if
(
item
==
null
)
{
throw
new
NotFoundException
(
"item not found for itemId "
+
itemId
);
}
return
BeanUtils
.
transfrom
(
ItemDTO
.
class
,
item
);
}
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key}"
)
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key
:.+
}"
)
public
ItemDTO
get
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
,
@PathVariable
(
"key"
)
String
key
)
{
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
,
@PathVariable
(
"key"
)
String
key
)
{
Item
item
=
itemService
.
findOne
(
appId
,
clusterName
,
namespaceName
,
key
);
if
(
item
==
null
)
throw
new
NotFoundException
(
String
.
format
(
"item not found for %s %s %s %s"
,
appId
,
clusterName
,
namespaceName
,
key
));
if
(
item
==
null
)
{
throw
new
NotFoundException
(
String
.
format
(
"item not found for %s %s %s %s"
,
appId
,
clusterName
,
namespaceName
,
key
));
}
return
BeanUtils
.
transfrom
(
ItemDTO
.
class
,
item
);
}
}
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ItemSetController.java
浏览文件 @
ea20fad0
...
...
@@ -3,14 +3,12 @@ package com.ctrip.framework.apollo.adminservice.controller;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ctrip.framework.apollo.biz.service.ItemSetService
;
import
com.ctrip.framework.apollo.common.auth.ActiveUser
;
import
com.ctrip.framework.apollo.core.dto.ItemChangeSets
;
@RestController
...
...
@@ -20,8 +18,8 @@ public class ItemSetController {
private
ItemSetService
itemSetService
;
@RequestMapping
(
path
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/itemset"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
Void
>
create
(
@RequestBody
ItemChangeSets
changeSet
,
@ActiveUser
UserDetails
user
)
{
itemSetService
.
updateSet
(
changeSet
,
user
.
getUsername
()
);
public
ResponseEntity
<
Void
>
create
(
@RequestBody
ItemChangeSets
changeSet
)
{
itemSetService
.
updateSet
(
changeSet
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
build
();
}
}
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/NamespaceController.java
浏览文件 @
ea20fad0
...
...
@@ -3,16 +3,15 @@ package com.ctrip.framework.apollo.adminservice.controller;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ctrip.framework.apollo.biz.entity.Namespace
;
import
com.ctrip.framework.apollo.biz.service.NamespaceService
;
import
com.ctrip.framework.apollo.common.auth.ActiveUser
;
import
com.ctrip.framework.apollo.common.utils.BeanUtils
;
import
com.ctrip.framework.apollo.core.dto.NamespaceDTO
;
import
com.ctrip.framework.apollo.core.exception.NotFoundException
;
...
...
@@ -25,16 +24,13 @@ public class NamespaceController {
@RequestMapping
(
path
=
"/apps/{appId}/clusters/{clusterName}/namespaces"
,
method
=
RequestMethod
.
POST
)
public
NamespaceDTO
createOrUpdate
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@RequestBody
NamespaceDTO
dto
,
@ActiveUser
UserDetails
user
)
{
@PathVariable
(
"clusterName"
)
String
clusterName
,
@RequestBody
NamespaceDTO
dto
)
{
Namespace
entity
=
BeanUtils
.
transfrom
(
Namespace
.
class
,
dto
);
Namespace
managedEntity
=
namespaceService
.
findOne
(
appId
,
clusterName
,
entity
.
getNamespaceName
());
if
(
managedEntity
!=
null
)
{
managedEntity
.
setDataChangeLastModifiedBy
(
user
.
getUsername
());
BeanUtils
.
copyEntityProperties
(
entity
,
managedEntity
);
entity
=
namespaceService
.
update
(
managedEntity
);
}
else
{
entity
.
setDataChangeCreatedBy
(
user
.
getUsername
());
entity
=
namespaceService
.
save
(
entity
);
}
...
...
@@ -42,14 +38,14 @@ public class NamespaceController {
return
dto
;
}
@RequestMapping
(
path
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
path
=
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName
:.+
}"
,
method
=
RequestMethod
.
DELETE
)
public
void
delete
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
,
@
ActiveUser
UserDetails
use
r
)
{
@PathVariable
(
"namespaceName"
)
String
namespaceName
,
@
RequestParam
String
operato
r
)
{
Namespace
entity
=
namespaceService
.
findOne
(
appId
,
clusterName
,
namespaceName
);
if
(
entity
==
null
)
throw
new
NotFoundException
(
String
.
format
(
"namespace not found for %s %s %s"
,
appId
,
clusterName
,
namespaceName
));
namespaceService
.
delete
(
entity
.
getId
(),
user
.
getUsername
()
);
namespaceService
.
delete
(
entity
.
getId
(),
operator
);
}
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}/namespaces"
)
...
...
@@ -67,7 +63,7 @@ public class NamespaceController {
return
BeanUtils
.
transfrom
(
NamespaceDTO
.
class
,
namespace
);
}
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}"
)
@RequestMapping
(
"/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName
:.+
}"
)
public
NamespaceDTO
get
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
)
{
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ReleaseController.java
浏览文件 @
ea20fad0
...
...
@@ -9,14 +9,12 @@ import com.ctrip.framework.apollo.biz.message.Topics;
import
com.ctrip.framework.apollo.biz.service.ConfigService
;
import
com.ctrip.framework.apollo.biz.service.NamespaceService
;
import
com.ctrip.framework.apollo.biz.service.ReleaseService
;
import
com.ctrip.framework.apollo.common.auth.ActiveUser
;
import
com.ctrip.framework.apollo.common.utils.BeanUtils
;
import
com.ctrip.framework.apollo.core.ConfigConsts
;
import
com.ctrip.framework.apollo.core.dto.ReleaseDTO
;
import
com.ctrip.framework.apollo.core.exception.NotFoundException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
...
@@ -78,13 +76,13 @@ public class ReleaseController {
@PathVariable
(
"namespaceName"
)
String
namespaceName
,
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
name
=
"comment"
,
required
=
false
)
String
comment
,
@
ActiveUser
UserDetails
use
r
)
{
@
RequestParam
(
"operator"
)
String
operato
r
)
{
Namespace
namespace
=
namespaceService
.
findOne
(
appId
,
clusterName
,
namespaceName
);
if
(
namespace
==
null
)
{
throw
new
NotFoundException
(
String
.
format
(
"Could not find namespace for %s %s %s"
,
appId
,
clusterName
,
namespaceName
));
}
Release
release
=
releaseService
.
buildRelease
(
name
,
comment
,
namespace
,
user
.
getUsername
()
);
Release
release
=
releaseService
.
buildRelease
(
name
,
comment
,
namespace
,
operator
);
messageSender
.
sendMessage
(
assembleKey
(
appId
,
clusterName
,
namespaceName
),
Topics
.
APOLLO_RELEASE_TOPIC
);
return
BeanUtils
.
transfrom
(
ReleaseDTO
.
class
,
release
);
...
...
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ControllerExceptionTest.java
浏览文件 @
ea20fad0
...
...
@@ -85,8 +85,7 @@ public class ControllerExceptionTest {
when
(
adminService
.
createNewApp
(
any
(
App
.
class
)))
.
thenThrow
(
new
ServiceException
(
"create app failed"
));
UserDetails
user
=
new
User
(
"user"
,
""
,
new
ArrayList
<
GrantedAuthority
>());
appController
.
createOrUpdate
(
dto
,
user
);
appController
.
createOrUpdate
(
dto
);
}
private
AppDTO
generateSampleDTOData
()
{
...
...
@@ -95,6 +94,8 @@ public class ControllerExceptionTest {
dto
.
setName
(
"someName"
);
dto
.
setOwnerName
(
"someOwner"
);
dto
.
setOwnerEmail
(
"someOwner@ctrip.com"
);
dto
.
setDataChangeLastModifiedBy
(
"test"
);
dto
.
setDataChangeCreatedBy
(
"test"
);
return
dto
;
}
}
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ItemSetControllerTest.java
浏览文件 @
ea20fad0
...
...
@@ -46,6 +46,7 @@ public class ItemSetControllerTest extends AbstractControllerTest {
Assert
.
assertEquals
(
"application"
,
namespace
.
getNamespaceName
());
ItemChangeSets
itemSet
=
new
ItemChangeSets
();
itemSet
.
setDataChangeLastModifiedBy
(
"created"
);
RestTemplate
createdTemplate
=
new
TestRestTemplate
(
"created"
,
""
);
createdTemplate
.
setMessageConverters
(
restTemplate
.
getMessageConverters
());
...
...
@@ -94,6 +95,7 @@ public class ItemSetControllerTest extends AbstractControllerTest {
Assert
.
assertEquals
(
"application"
,
namespace
.
getNamespaceName
());
ItemChangeSets
createChangeSet
=
new
ItemChangeSets
();
createChangeSet
.
setDataChangeLastModifiedBy
(
"created"
);
RestTemplate
createdRestTemplate
=
new
TestRestTemplate
(
"created"
,
""
);
createdRestTemplate
.
setMessageConverters
(
restTemplate
.
getMessageConverters
());
...
...
@@ -118,20 +120,22 @@ public class ItemSetControllerTest extends AbstractControllerTest {
+
cluster
.
getName
()
+
"/namespaces/"
+
namespace
.
getNamespaceName
()
+
"/items"
,
ItemDTO
[].
class
);
ItemChangeSets
udpateChangeSet
=
new
ItemChangeSets
();
ItemChangeSets
updateChangeSet
=
new
ItemChangeSets
();
updateChangeSet
.
setDataChangeLastModifiedBy
(
"updated"
);
RestTemplate
updatedRestTemplate
=
new
TestRestTemplate
(
"updated"
,
""
);
updatedRestTemplate
.
setMessageConverters
(
restTemplate
.
getMessageConverters
());
int
updatedSize
=
2
;
for
(
int
i
=
0
;
i
<
updatedSize
;
i
++)
{
items
[
i
].
setValue
(
"updated_value_"
+
i
);
u
dp
ateChangeSet
.
addUpdateItem
(
items
[
i
]);
u
pd
ateChangeSet
.
addUpdateItem
(
items
[
i
]);
}
response
=
updatedRestTemplate
.
postForEntity
(
"http://localhost:"
+
port
+
"/apps/"
+
app
.
getAppId
()
+
"/clusters/"
+
cluster
.
getName
()
+
"/namespaces/"
+
namespace
.
getNamespaceName
()
+
"/itemset"
,
u
dp
ateChangeSet
,
Void
.
class
);
u
pd
ateChangeSet
,
Void
.
class
);
Assert
.
assertEquals
(
HttpStatus
.
OK
,
response
.
getStatusCode
());
List
<
Item
>
savedItems
=
itemRepository
.
findByNamespaceIdOrderByLineNumAsc
(
namespace
.
getId
());
Assert
.
assertEquals
(
createdSize
,
savedItems
.
size
());
...
...
@@ -165,6 +169,7 @@ public class ItemSetControllerTest extends AbstractControllerTest {
Assert
.
assertEquals
(
"application"
,
namespace
.
getNamespaceName
());
ItemChangeSets
createChangeSet
=
new
ItemChangeSets
();
createChangeSet
.
setDataChangeLastModifiedBy
(
"created"
);
RestTemplate
createdTemplate
=
new
TestRestTemplate
(
"created"
,
""
);
createdTemplate
.
setMessageConverters
(
restTemplate
.
getMessageConverters
());
...
...
@@ -190,6 +195,7 @@ public class ItemSetControllerTest extends AbstractControllerTest {
ItemDTO
[].
class
);
ItemChangeSets
deleteChangeSet
=
new
ItemChangeSets
();
deleteChangeSet
.
setDataChangeLastModifiedBy
(
"deleted"
);
RestTemplate
deletedTemplate
=
new
TestRestTemplate
(
"deleted"
,
""
);
deletedTemplate
.
setMessageConverters
(
restTemplate
.
getMessageConverters
());
...
...
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ReleaseControllerTest.java
浏览文件 @
ea20fad0
...
...
@@ -76,6 +76,7 @@ public class ReleaseControllerTest extends AbstractControllerTest {
MultiValueMap
<
String
,
String
>
parameters
=
new
LinkedMultiValueMap
<
String
,
String
>();
parameters
.
add
(
"name"
,
"someReleaseName"
);
parameters
.
add
(
"comment"
,
"someComment"
);
parameters
.
add
(
"operator"
,
"test"
);
HttpEntity
<
MultiValueMap
<
String
,
String
>>
entity
=
new
HttpEntity
<
MultiValueMap
<
String
,
String
>>(
parameters
,
headers
);
ResponseEntity
<
ReleaseDTO
>
response
=
restTemplate
.
postForEntity
(
...
...
@@ -111,7 +112,6 @@ public class ReleaseControllerTest extends AbstractControllerTest {
ReleaseService
someReleaseService
=
mock
(
ReleaseService
.
class
);
MessageSender
someMessageSender
=
mock
(
MessageSender
.
class
);
Namespace
someNamespace
=
mock
(
Namespace
.
class
);
UserDetails
someUser
=
mock
(
UserDetails
.
class
);
ReleaseController
releaseController
=
new
ReleaseController
();
ReflectionTestUtils
.
setField
(
releaseController
,
"releaseService"
,
someReleaseService
);
...
...
@@ -120,10 +120,9 @@ public class ReleaseControllerTest extends AbstractControllerTest {
when
(
someNamespaceService
.
findOne
(
someAppId
,
someCluster
,
someNamespaceName
))
.
thenReturn
(
someNamespace
);
when
(
someUser
.
getUsername
()).
thenReturn
(
someUserName
);
releaseController
.
buildRelease
(
someAppId
,
someCluster
,
someNamespaceName
,
someName
,
someComment
,
someUser
);
.
buildRelease
(
someAppId
,
someCluster
,
someNamespaceName
,
someName
,
someComment
,
"test"
);
verify
(
someMessageSender
,
times
(
1
))
.
sendMessage
(
Joiner
.
on
(
ConfigConsts
.
CLUSTER_NAMESPACE_SEPARATOR
)
...
...
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ItemSetService.java
浏览文件 @
ea20fad0
...
...
@@ -21,7 +21,8 @@ public class ItemSetService {
private
AuditService
auditService
;
@Transactional
public
void
updateSet
(
ItemChangeSets
changeSet
,
String
owner
)
{
public
void
updateSet
(
ItemChangeSets
changeSet
)
{
String
owner
=
changeSet
.
getDataChangeLastModifiedBy
();
if
(
changeSet
.
getCreateItems
()
!=
null
)
{
for
(
ItemDTO
item
:
changeSet
.
getCreateItems
())
{
Item
entity
=
BeanUtils
.
transfrom
(
Item
.
class
,
item
);
...
...
apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/WebMvcConfig.java
浏览文件 @
ea20fad0
...
...
@@ -24,6 +24,7 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public
void
configureContentNegotiation
(
ContentNegotiationConfigurer
configurer
)
{
configurer
.
favorPathExtension
(
false
);
configurer
.
ignoreAcceptHeader
(
true
).
defaultContentType
(
MediaType
.
APPLICATION_JSON
);
}
...
...
apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/BeanUtils.java
浏览文件 @
ea20fad0
...
...
@@ -226,6 +226,5 @@ public class BeanUtils {
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
source
,
target
,
COPY_IGNORED_PROPERTIES
);
}
private
static
final
String
[]
COPY_IGNORED_PROPERTIES
=
{
"id"
,
"dataChangeCreatedBy"
,
"dataChangeCreatedTime"
,
"dataChangeLastModifiedBy"
,
"dataChangeLastModifiedTime"
};
private
static
final
String
[]
COPY_IGNORED_PROPERTIES
=
{
"id"
,
"dataChangeCreatedTime"
,
"dataChangeLastModifiedTime"
};
}
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/AppDTO.java
浏览文件 @
ea20fad0
package
com.ctrip.framework.apollo.core.dto
;
public
class
AppDTO
{
public
class
AppDTO
extends
BaseDTO
{
private
long
id
;
...
...
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/AppNamespaceDTO.java
浏览文件 @
ea20fad0
package
com.ctrip.framework.apollo.core.dto
;
public
class
AppNamespaceDTO
{
public
class
AppNamespaceDTO
extends
BaseDTO
{
private
long
id
;
private
String
name
;
...
...
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/BaseDTO.java
0 → 100644
浏览文件 @
ea20fad0
package
com.ctrip.framework.apollo.core.dto
;
public
class
BaseDTO
{
protected
String
dataChangeCreatedBy
;
protected
String
dataChangeLastModifiedBy
;
public
String
getDataChangeCreatedBy
()
{
return
dataChangeCreatedBy
;
}
public
void
setDataChangeCreatedBy
(
String
dataChangeCreatedBy
)
{
this
.
dataChangeCreatedBy
=
dataChangeCreatedBy
;
}
public
String
getDataChangeLastModifiedBy
()
{
return
dataChangeLastModifiedBy
;
}
public
void
setDataChangeLastModifiedBy
(
String
dataChangeLastModifiedBy
)
{
this
.
dataChangeLastModifiedBy
=
dataChangeLastModifiedBy
;
}
}
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/ClusterDTO.java
浏览文件 @
ea20fad0
package
com.ctrip.framework.apollo.core.dto
;
public
class
ClusterDTO
{
public
class
ClusterDTO
extends
BaseDTO
{
private
long
id
;
...
...
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/ItemChangeSets.java
浏览文件 @
ea20fad0
...
...
@@ -6,7 +6,7 @@ import java.util.List;
/**
* storage cud result
*/
public
class
ItemChangeSets
{
public
class
ItemChangeSets
extends
BaseDTO
{
private
List
<
ItemDTO
>
createItems
=
new
LinkedList
<>();
private
List
<
ItemDTO
>
updateItems
=
new
LinkedList
<>();
...
...
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/ItemDTO.java
浏览文件 @
ea20fad0
...
...
@@ -2,7 +2,7 @@ package com.ctrip.framework.apollo.core.dto;
import
java.util.Date
;
public
class
ItemDTO
{
public
class
ItemDTO
extends
BaseDTO
{
private
long
id
;
...
...
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/NamespaceDTO.java
浏览文件 @
ea20fad0
package
com.ctrip.framework.apollo.core.dto
;
public
class
NamespaceDTO
{
public
class
NamespaceDTO
extends
BaseDTO
{
private
long
id
;
private
String
appId
;
...
...
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/ReleaseDTO.java
浏览文件 @
ea20fad0
package
com.ctrip.framework.apollo.core.dto
;
public
class
ReleaseDTO
{
public
class
ReleaseDTO
extends
BaseDTO
{
private
long
id
;
private
String
releaseKey
;
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/PortalSettings.java
浏览文件 @
ea20fad0
...
...
@@ -73,9 +73,9 @@ public class PortalSettings {
healthCheckService
=
Executors
.
newScheduledThreadPool
(
1
);
healthCheckService
.
scheduleWithFixedDelay
(
new
HealthCheckTask
(
applicationContext
),
1000
,
HEALTH_CHECK_INTERVAL
,
TimeUnit
.
MILLISECONDS
);
//
healthCheckService
//
.scheduleWithFixedDelay(new HealthCheckTask(applicationContext), 1000, HEALTH_CHECK_INTERVAL,
//
TimeUnit.MILLISECONDS);
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/api/API.java
浏览文件 @
ea20fad0
...
...
@@ -25,6 +25,7 @@ public class API {
}
public
String
getAdminServiceHost
(
Env
env
)
{
return
serviceLocator
.
getServiceAddress
(
env
).
getHomepageUrl
();
return
"http://localhost:8090"
;
// return serviceLocator.getServiceAddress(env).getHomepageUrl();
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/api/AdminServiceAPI.java
浏览文件 @
ea20fad0
...
...
@@ -27,9 +27,9 @@ import java.util.List;
public
class
AdminServiceAPI
{
@Service
public
static
class
HealthAPI
extends
API
{
public
static
class
HealthAPI
extends
API
{
public
Health
health
(
Env
env
){
public
Health
health
(
Env
env
)
{
return
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
"/health"
,
Health
.
class
);
}
}
...
...
@@ -37,20 +37,18 @@ public class AdminServiceAPI {
@Service
public
static
class
AppAPI
extends
API
{
public
static
String
APP_API
=
"/apps"
;
public
List
<
AppDTO
>
findApps
(
Env
env
)
{
AppDTO
[]
appDTOs
=
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
APP_API
,
AppDTO
[].
class
);
restTemplate
.
getForObject
(
"{host}/apps"
,
AppDTO
[].
class
,
getAdminServiceHost
(
env
)
);
return
Arrays
.
asList
(
appDTOs
);
}
public
AppDTO
loadApp
(
Env
env
,
String
appId
){
return
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
APP_API
+
"/"
+
appId
,
AppDTO
.
class
);
public
AppDTO
loadApp
(
Env
env
,
String
appId
)
{
return
restTemplate
.
getForObject
(
"{host}/apps/{appId}"
,
AppDTO
.
class
,
getAdminServiceHost
(
env
),
appId
);
}
public
AppDTO
createApp
(
Env
env
,
AppDTO
app
)
{
return
restTemplate
.
postForEntity
(
getAdminServiceHost
(
env
)
+
APP_API
,
app
,
AppDTO
.
class
)
return
restTemplate
.
postForEntity
(
"{host}/apps"
,
app
,
AppDTO
.
class
,
getAdminServiceHost
(
env
)
)
.
getBody
();
}
}
...
...
@@ -60,38 +58,36 @@ public class AdminServiceAPI {
public
static
class
NamespaceAPI
extends
API
{
public
List
<
NamespaceDTO
>
findNamespaceByCluster
(
String
appId
,
Env
env
,
String
clusterName
)
{
NamespaceDTO
[]
namespaceDTOs
=
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
String
.
format
(
"apps/%s/clusters/%s/namespaces"
,
appId
,
clusterName
),
NamespaceDTO
[].
class
);
NamespaceDTO
[]
namespaceDTOs
=
restTemplate
.
getForObject
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces"
,
NamespaceDTO
[].
class
,
getAdminServiceHost
(
env
),
appId
,
clusterName
);
return
Arrays
.
asList
(
namespaceDTOs
);
}
public
NamespaceDTO
loadNamespace
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespaceName
)
{
return
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
String
.
format
(
"apps/%s/clusters/%s/namespaces/%s"
,
appId
,
clusterName
,
namespaceName
),
NamespaceDTO
.
class
)
;
String
namespaceName
)
{
NamespaceDTO
dto
=
restTemplate
.
getForObject
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/"
+
namespaceName
,
NamespaceDTO
.
class
,
getAdminServiceHost
(
env
),
appId
,
clusterName
);
return
dto
;
}
public
List
<
AppNamespaceDTO
>
findPublicAppNamespaces
(
Env
env
){
AppNamespaceDTO
[]
appNamespaceDTOs
=
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)+
"appnamespaces/public"
,
AppNamespaceDTO
[].
class
);
public
List
<
AppNamespaceDTO
>
findPublicAppNamespaces
(
Env
env
)
{
AppNamespaceDTO
[]
appNamespaceDTOs
=
restTemplate
.
getForObject
(
"{host}/appnamespaces/public"
,
AppNamespaceDTO
[].
class
,
getAdminServiceHost
(
env
));
return
Arrays
.
asList
(
appNamespaceDTOs
);
}
public
NamespaceDTO
createNamespace
(
Env
env
,
NamespaceDTO
namespace
)
{
return
restTemplate
.
postForEntity
(
getAdminServiceHost
(
env
)
+
String
.
format
(
"/apps/%s/clusters/%s/namespaces"
,
namespace
.
getAppId
(),
namespace
.
getClusterName
()),
namespace
,
NamespaceDTO
.
class
)
.
getBody
();
return
restTemplate
.
postForEntity
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces"
,
namespace
,
NamespaceDTO
.
class
,
getAdminServiceHost
(
env
),
namespace
.
getAppId
(),
namespace
.
getClusterName
()).
getBody
();
}
public
AppNamespaceDTO
createAppNamespace
(
Env
env
,
AppNamespaceDTO
appNamespace
)
{
return
restTemplate
.
postForEntity
(
getAdminServiceHost
(
env
)
+
String
.
format
(
"/apps/%s/appnamespaces"
,
appNamespace
.
getAppId
()),
appNamespace
,
AppNamespaceDTO
.
class
)
.
getBody
();
public
AppNamespaceDTO
createOrUpdate
(
Env
env
,
AppNamespaceDTO
appNamespace
)
{
return
restTemplate
.
postForEntity
(
"{host}/apps/{appId}/appnamespaces"
,
appNamespace
,
AppNamespaceDTO
.
class
,
getAdminServiceHost
(
env
),
appNamespace
.
getAppId
()).
getBody
();
}
}
...
...
@@ -102,28 +98,27 @@ public class AdminServiceAPI {
public
List
<
ItemDTO
>
findItems
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespace
)
{
ItemDTO
[]
itemDTOs
=
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
String
.
format
(
"apps/%s/clusters/%s/namespaces/%s/items"
,
appId
,
clusterName
,
namespace
),
ItemDTO
[].
class
);
.
getForObject
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items"
,
ItemDTO
[].
class
,
getAdminServiceHost
(
env
),
appId
,
clusterName
,
namespace
);
return
Arrays
.
asList
(
itemDTOs
);
}
public
void
updateItems
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespace
,
ItemChangeSets
changeSets
)
{
restTemplate
.
postForEntity
(
getAdminServiceHost
(
env
)
+
String
.
format
(
"apps/%s/clusters/%s/namespaces/%s/itemset"
,
appId
,
clusterName
,
namespace
),
changeSets
,
Void
.
class
);
ItemChangeSets
changeSets
)
{
restTemplate
.
postForEntity
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/itemset"
,
changeSets
,
Void
.
class
,
getAdminServiceHost
(
env
),
appId
,
clusterName
,
namespace
);
}
public
ItemDTO
createOrUpdateItem
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespace
,
ItemDTO
item
){
return
restTemplate
.
postForEntity
(
getAdminServiceHost
(
env
)
+
String
.
format
(
"apps/%s/clusters/%s/namespaces/%s/items"
,
appId
,
clusterName
,
namespace
),
item
,
ItemDTO
.
class
)
.
getBody
();
public
ItemDTO
createOrUpdateItem
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespace
,
ItemDTO
item
)
{
return
restTemplate
.
postForEntity
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items"
,
item
,
ItemDTO
.
class
,
getAdminServiceHost
(
env
),
appId
,
clusterName
,
namespace
)
.
getBody
();
}
public
void
deleteItem
(
Env
env
,
long
itemId
){
restTemplate
.
delete
(
getAdminServiceHost
(
env
)
+
"items/"
+
itemId
);
public
void
deleteItem
(
Env
env
,
long
itemId
,
String
operator
)
{
restTemplate
.
delete
(
"{host}/items/{itemId}?operator={operator}"
,
getAdminServiceHost
(
env
),
itemId
,
operator
);
}
}
...
...
@@ -131,8 +126,8 @@ public class AdminServiceAPI {
public
static
class
ClusterAPI
extends
API
{
public
List
<
ClusterDTO
>
findClustersByApp
(
String
appId
,
Env
env
)
{
ClusterDTO
[]
clusterDTOs
=
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
String
.
format
(
"apps/%s/clusters"
,
appId
),
ClusterDTO
[].
class
);
ClusterDTO
[]
clusterDTOs
=
restTemplate
.
getForObject
(
"{host}/apps/{appId}/clusters"
,
ClusterDTO
[].
class
,
getAdminServiceHost
(
env
),
appId
);
return
Arrays
.
asList
(
clusterDTOs
);
}
}
...
...
@@ -142,29 +137,31 @@ public class AdminServiceAPI {
public
ReleaseDTO
loadLatestRelease
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespace
)
{
ReleaseDTO
releaseDTO
=
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
String
.
format
(
"apps/%s/clusters/%s/namespaces/%s/releases/latest"
,
appId
,
clusterName
,
namespace
),
ReleaseDTO
.
class
);
ReleaseDTO
releaseDTO
=
restTemplate
.
getForObject
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/latest"
,
ReleaseDTO
.
class
,
getAdminServiceHost
(
env
),
appId
,
clusterName
,
namespace
);
return
releaseDTO
;
}
public
ReleaseDTO
release
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespace
,
String
releaseBy
,
String
comment
)
{
String
releaseBy
,
String
comment
,
String
operator
)
{
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_FORM_URLENCODED
);
MultiValueMap
<
String
,
String
>
parameters
=
new
LinkedMultiValueMap
<
String
,
String
>();
parameters
.
add
(
"name"
,
releaseBy
);
parameters
.
add
(
"comment"
,
comment
);
parameters
.
add
(
"operator"
,
operator
);
HttpEntity
<
MultiValueMap
<
String
,
String
>>
entity
=
new
HttpEntity
<
MultiValueMap
<
String
,
String
>>(
parameters
,
headers
);
ResponseEntity
<
ReleaseDTO
>
response
=
restTemplate
.
postForEntity
(
getAdminServiceHost
(
env
)
+
String
.
format
(
"apps/%s/clusters/%s/namespaces/%s/releases"
,
appId
,
clusterName
,
namespace
),
entity
,
ReleaseDTO
.
class
);
.
postForEntity
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases"
,
entity
,
ReleaseDTO
.
class
,
getAdminServiceHost
(
env
),
appId
,
clusterName
,
namespace
);
return
response
.
getBody
();
}
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalAppService.java
浏览文件 @
ea20fad0
...
...
@@ -17,6 +17,7 @@ import com.ctrip.framework.apollo.core.exception.BadRequestException;
import
com.ctrip.framework.apollo.core.exception.ServiceException
;
import
com.ctrip.framework.apollo.portal.PortalSettings
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.framework.apollo.portal.auth.UserInfoHolder
;
import
com.ctrip.framework.apollo.portal.entity.vo.EnvClusterInfo
;
@Service
...
...
@@ -24,6 +25,9 @@ public class PortalAppService {
private
Logger
logger
=
LoggerFactory
.
getLogger
(
PortalAppService
.
class
);
@Autowired
private
UserInfoHolder
userInfoHolder
;
@Autowired
private
PortalClusterService
clusterService
;
...
...
@@ -71,6 +75,7 @@ public class PortalAppService {
}
public
void
createAppInAllEnvs
(
AppDTO
app
)
{
enrichUserInfo
(
app
);
List
<
Env
>
envs
=
portalSettings
.
getActiveEnvs
();
for
(
Env
env
:
envs
)
{
try
{
...
...
@@ -83,6 +88,7 @@ public class PortalAppService {
}
public
void
createApp
(
Env
env
,
AppDTO
app
)
{
enrichUserInfo
(
app
);
try
{
appAPI
.
createApp
(
env
,
app
);
}
catch
(
HttpStatusCodeException
e
)
{
...
...
@@ -91,6 +97,12 @@ public class PortalAppService {
}
}
private
void
enrichUserInfo
(
AppDTO
app
){
String
username
=
userInfoHolder
.
getUser
().
getUsername
();
app
.
setDataChangeCreatedBy
(
username
);
app
.
setDataChangeLastModifiedBy
(
username
);
}
public
EnvClusterInfo
createEnvNavNode
(
Env
env
,
String
appId
){
EnvClusterInfo
node
=
new
EnvClusterInfo
(
env
);
node
.
setClusters
(
clusterService
.
findClusters
(
env
,
appId
));
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalConfigService.java
浏览文件 @
ea20fad0
...
...
@@ -17,7 +17,9 @@ import com.ctrip.framework.apollo.core.dto.ReleaseDTO;
import
com.ctrip.framework.apollo.core.exception.BadRequestException
;
import
com.ctrip.framework.apollo.core.exception.NotFoundException
;
import
com.ctrip.framework.apollo.core.exception.ServiceException
;
import
com.ctrip.framework.apollo.core.utils.StringUtils
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.framework.apollo.portal.auth.UserInfoHolder
;
import
com.ctrip.framework.apollo.portal.entity.vo.ItemDiffs
;
import
com.ctrip.framework.apollo.portal.entity.vo.NamespaceIdentifer
;
import
com.ctrip.framework.apollo.portal.entity.form.NamespaceTextModel
;
...
...
@@ -33,13 +35,14 @@ public class PortalConfigService {
private
Logger
logger
=
LoggerFactory
.
getLogger
(
PortalConfigService
.
class
);
@Autowired
private
UserInfoHolder
userInfoHolder
;
@Autowired
private
AdminServiceAPI
.
NamespaceAPI
namespaceAPI
;
@Autowired
private
AdminServiceAPI
.
ItemAPI
itemAPI
;
@Autowired
private
AdminServiceAPI
.
ReleaseAPI
releaseAPI
;
@Autowired
private
ConfigTextResolver
resolver
;
...
...
@@ -62,7 +65,9 @@ public class PortalConfigService {
if
(
changeSets
.
isEmpty
())
{
return
;
}
try
{
changeSets
.
setDataChangeLastModifiedBy
(
userInfoHolder
.
getUser
().
getUsername
());
itemAPI
.
updateItems
(
appId
,
env
,
clusterName
,
namespaceName
,
changeSets
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"itemAPI.updateItems error. appId{},env:{},clusterName:{},namespaceName:{}"
,
appId
,
env
,
clusterName
,
...
...
@@ -72,41 +77,49 @@ public class PortalConfigService {
}
public
ItemDTO
createOrUpdateItem
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespaceName
,
ItemDTO
item
){
public
ItemDTO
createOrUpdateItem
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespaceName
,
ItemDTO
item
)
{
NamespaceDTO
namespace
=
namespaceAPI
.
loadNamespace
(
appId
,
env
,
clusterName
,
namespaceName
);
if
(
namespace
==
null
){
if
(
namespace
==
null
)
{
throw
new
BadRequestException
(
"namespace:"
+
namespaceName
+
" not exist in env:"
+
env
+
", cluster:"
+
clusterName
);
}
String
username
=
userInfoHolder
.
getUser
().
getUsername
();
if
(
StringUtils
.
isEmpty
(
item
.
getDataChangeCreatedBy
()))
{
item
.
setDataChangeCreatedBy
(
username
);
}
item
.
setDataChangeLastModifiedBy
(
username
);
item
.
setNamespaceId
(
namespace
.
getId
());
return
itemAPI
.
createOrUpdateItem
(
appId
,
env
,
clusterName
,
namespaceName
,
item
);
}
public
void
deleteItem
(
Env
env
,
long
itemId
){
itemAPI
.
deleteItem
(
env
,
itemId
);
public
void
deleteItem
(
Env
env
,
long
itemId
)
{
itemAPI
.
deleteItem
(
env
,
itemId
,
userInfoHolder
.
getUser
().
getUsername
()
);
}
/**
* createRelease config items
*/
public
ReleaseDTO
createRelease
(
NamespaceReleaseModel
model
)
{
return
releaseAPI
.
release
(
model
.
getAppId
(),
model
.
getEnv
(),
model
.
getClusterName
(),
model
.
getNamespaceName
(),
model
.
getReleaseBy
(),
model
.
getReleaseComment
());
model
.
getNamespaceName
(),
model
.
getReleaseBy
(),
model
.
getReleaseComment
()
,
userInfoHolder
.
getUser
().
getUsername
());
}
public
List
<
ItemDTO
>
findItems
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespaceName
)
{
return
itemAPI
.
findItems
(
appId
,
env
,
clusterName
,
namespaceName
);
}
public
void
syncItems
(
List
<
NamespaceIdentifer
>
comparedNamespaces
,
List
<
ItemDTO
>
sourceItems
){
public
void
syncItems
(
List
<
NamespaceIdentifer
>
comparedNamespaces
,
List
<
ItemDTO
>
sourceItems
)
{
List
<
ItemDiffs
>
itemDiffs
=
compare
(
comparedNamespaces
,
sourceItems
);
for
(
ItemDiffs
itemDiff
:
itemDiffs
)
{
for
(
ItemDiffs
itemDiff
:
itemDiffs
)
{
NamespaceIdentifer
namespaceIdentifer
=
itemDiff
.
getNamespace
();
ItemChangeSets
changeSets
=
itemDiff
.
getDiffs
();
changeSets
.
setDataChangeLastModifiedBy
(
userInfoHolder
.
getUser
().
getUsername
());
try
{
itemAPI
.
updateItems
(
namespaceIdentifer
.
getAppId
(),
namespaceIdentifer
.
getEnv
(),
namespaceIdentifer
.
getClusterName
(),
namespaceIdentifer
.
getNamespaceName
(),
itemDiff
.
getDiffs
()
);
namespaceIdentifer
.
getNamespaceName
(),
changeSets
);
}
catch
(
HttpClientErrorException
e
)
{
logger
.
error
(
"sync items error. namespace:{}"
,
namespaceIdentifer
);
throw
new
ServiceException
(
String
.
format
(
"sync item error. env:%s, clusterName:%s"
,
namespaceIdentifer
.
getEnv
(),
...
...
@@ -147,7 +160,7 @@ public class PortalConfigService {
return
namespaceDTO
.
getId
();
}
private
ItemChangeSets
parseChangeSets
(
NamespaceIdentifer
namespace
,
List
<
ItemDTO
>
sourceItems
){
private
ItemChangeSets
parseChangeSets
(
NamespaceIdentifer
namespace
,
List
<
ItemDTO
>
sourceItems
)
{
ItemChangeSets
changeSets
=
new
ItemChangeSets
();
List
<
ItemDTO
>
targetItems
=
...
...
@@ -175,8 +188,7 @@ public class PortalConfigService {
changeSets
.
addCreateItem
(
buildItem
(
namespaceId
,
++
maxLineNum
,
sourceItem
));
}
else
if
(!
sourceValue
.
equals
(
targetItem
.
getValue
())
||
!
sourceComment
.
equals
(
targetItem
.
getComment
()))
{
//modified items
}
else
if
(
isModified
(
sourceValue
,
targetItem
.
getValue
(),
sourceComment
,
targetItem
.
getComment
()))
{
//modified items
targetItem
.
setValue
(
sourceValue
);
targetItem
.
setComment
(
sourceComment
);
changeSets
.
addUpdateItem
(
targetItem
);
...
...
@@ -194,4 +206,19 @@ public class PortalConfigService {
createdItem
.
setNamespaceId
(
namespaceId
);
return
createdItem
;
}
private
boolean
isModified
(
String
sourceValue
,
String
targetValue
,
String
sourceComment
,
String
targetComment
)
{
if
(!
sourceValue
.
equals
(
targetValue
))
{
return
true
;
}
if
(
sourceComment
==
null
)
{
return
!
StringUtils
.
isEmpty
(
targetComment
);
}
else
if
(
targetComment
!=
null
)
{
return
!
sourceComment
.
equals
(
targetComment
);
}
else
{
return
false
;
}
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalNamespaceService.java
浏览文件 @
ea20fad0
...
...
@@ -8,10 +8,10 @@ import com.ctrip.framework.apollo.core.dto.ItemDTO;
import
com.ctrip.framework.apollo.core.dto.NamespaceDTO
;
import
com.ctrip.framework.apollo.core.dto.ReleaseDTO
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.exception.NotFoundException
;
import
com.ctrip.framework.apollo.core.utils.StringUtils
;
import
com.ctrip.framework.apollo.portal.PortalSettings
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.framework.apollo.portal.auth.UserInfoHolder
;
import
com.ctrip.framework.apollo.portal.entity.vo.NamespaceVO
;
import
org.slf4j.Logger
;
...
...
@@ -33,15 +33,14 @@ public class PortalNamespaceService {
private
Logger
logger
=
LoggerFactory
.
getLogger
(
PortalNamespaceService
.
class
);
@Autowired
private
UserInfoHolder
userInfoHolder
;
@Autowired
private
AdminServiceAPI
.
ItemAPI
itemAPI
;
@Autowired
private
AdminServiceAPI
.
ReleaseAPI
releaseAPI
;
@Autowired
private
AdminServiceAPI
.
NamespaceAPI
namespaceAPI
;
@Autowired
private
PortalSettings
portalSettings
;
...
...
@@ -53,13 +52,22 @@ public class PortalNamespaceService {
}
public
NamespaceDTO
createNamespace
(
Env
env
,
NamespaceDTO
namespace
)
{
if
(
StringUtils
.
isEmpty
(
namespace
.
getDataChangeCreatedBy
())){
namespace
.
setDataChangeCreatedBy
(
userInfoHolder
.
getUser
().
getUsername
());
}
namespace
.
setDataChangeLastModifiedBy
(
userInfoHolder
.
getUser
().
getUsername
());
return
namespaceAPI
.
createNamespace
(
env
,
namespace
);
}
public
void
createAppNamespace
(
AppNamespaceDTO
appNamespace
)
{
String
operator
=
userInfoHolder
.
getUser
().
getUsername
();
if
(
StringUtils
.
isEmpty
(
appNamespace
.
getDataChangeCreatedBy
())){
appNamespace
.
setDataChangeCreatedBy
(
operator
);
}
appNamespace
.
setDataChangeLastModifiedBy
(
operator
);
for
(
Env
env
:
portalSettings
.
getActiveEnvs
())
{
try
{
namespaceAPI
.
create
AppNamespac
e
(
env
,
appNamespace
);
namespaceAPI
.
create
OrUpdat
e
(
env
,
appNamespace
);
}
catch
(
HttpStatusCodeException
e
)
{
logger
.
error
(
ExceptionUtils
.
toString
(
e
));
throw
e
;
...
...
apollo-portal/src/main/resources/static/config.html
浏览文件 @
ea20fad0
...
...
@@ -278,7 +278,7 @@
<span
class=
"glyphicon glyphicon-eye-open"
aria-hidden=
"true"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"查看"
data-toggle=
"modal"
data-target=
"#itemModal"
ng-click=
"retrieveItem(config.item, config.oldValue)"
>
ng-click=
"retrieveItem(
namespace,
config.item, config.oldValue)"
>
</span>
<span
class=
"glyphicon glyphicon-edit"
aria-hidden=
"true"
...
...
apollo-portal/src/main/resources/static/config/sync.html
浏览文件 @
ea20fad0
...
...
@@ -128,7 +128,7 @@
</div>
<div
class=
"row"
style=
"margin-top: 10px;"
ng-show=
"diff.diffs.updateItems.length > 0"
>
<div
class=
"form-horizontal"
>
<label
class=
"col-sm-2 control-label"
>
更新
的配置
</label>
<label
class=
"col-sm-2 control-label"
>
修改
的配置
</label>
<div
class=
"col-sm-9"
>
<table
class=
"table table-bordered table-striped table-hover"
>
<thead>
...
...
@@ -169,6 +169,9 @@
<div
ng-include=
"'../views/common/footer.html'"
></div>
<!-- jquery.js -->
<script
src=
"../vendor/jquery.min.js"
type=
"text/javascript"
></script>
<!--angular-->
<script
src=
"../vendor/angular/angular.min.js"
></script>
<script
src=
"../vendor/angular/angular-route.min.js"
></script>
...
...
@@ -176,8 +179,7 @@
<script
src=
"../vendor/angular/angular-toastr-1.4.1.tpls.min.js"
></script>
<script
src=
"../vendor/angular/loading-bar.min.js"
></script>
<!-- jquery.js -->
<script
src=
"vendor/jquery.min.js"
type=
"text/javascript"
></script>
<!-- bootstrap.js -->
<script
src=
"../vendor/bootstrap/js/bootstrap.min.js"
type=
"text/javascript"
></script>
...
...
apollo-portal/src/main/resources/static/scripts/controller/app/ConfigNamespaceController.js
浏览文件 @
ea20fad0
...
...
@@ -170,10 +170,11 @@ application_module.controller("ConfigNamespaceController",
$scope
.
tableViewOperType
=
''
,
$scope
.
item
=
{};
//查看配置
$scope
.
retrieveItem
=
function
(
item
,
oldValue
)
{
$scope
.
retrieveItem
=
function
(
namespace
,
item
,
oldValue
)
{
switchTableViewOperType
(
TABLE_VIEW_OPER_TYPE
.
RETRIEVE
);
$scope
.
item
=
item
;
$scope
.
item
.
oldValue
=
oldValue
;
toOperationNamespaceName
=
namespace
.
namespace
.
namespaceName
;
};
var
toDeleteItemId
=
0
;
...
...
@@ -234,8 +235,8 @@ application_module.controller("ConfigNamespaceController",
toOperationNamespaceName
,
$scope
.
item
).
then
(
function
(
result
)
{
toastr
.
success
(
"
[
"
+
cluster
.
env
+
"
,
"
+
cluster
.
name
+
"
]
"
,
"
创建
成功
"
);
toastr
.
success
(
cluster
.
env
+
"
,
"
+
$scope
.
item
.
key
,
"
添加
成功
"
);
itemModal
.
modal
(
'
hide
'
);
$rootScope
.
refreshNamespaces
(
namespace_view_type
.
TABLE
);
},
function
(
result
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录