Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wrr-cat
apollo
提交
b2f24cb1
apollo
项目概览
wrr-cat
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
未验证
提交
b2f24cb1
编写于
12月 16, 2017
作者:
J
Jason Song
提交者:
GitHub
12月 16, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into keepalive
上级
8d31e511
d0bbf0da
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
75 addition
and
18 deletion
+75
-18
README.md
README.md
+2
-0
apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/App.java
...in/java/com/ctrip/framework/apollo/common/entity/App.java
+49
-0
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/AppController.java
...rip/framework/apollo/portal/controller/AppController.java
+8
-8
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ClusterController.java
...framework/apollo/portal/controller/ClusterController.java
+3
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConsumerController.java
...ramework/apollo/portal/controller/ConsumerController.java
+1
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java
...ip/framework/apollo/portal/controller/ItemController.java
+4
-3
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ReleaseController.java
...framework/apollo/portal/controller/ReleaseController.java
+4
-3
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ServerConfigController.java
...work/apollo/portal/controller/ServerConfigController.java
+4
-2
doc/images/known-users/263mobile.png
doc/images/known-users/263mobile.png
+0
-0
doc/images/known-users/juneyaoair.png
doc/images/known-users/juneyaoair.png
+0
-0
未找到文件。
README.md
浏览文件 @
b2f24cb1
...
@@ -137,3 +137,5 @@ The project is licensed under the [Apache 2 license](https://github.com/ctripcor
...
@@ -137,3 +137,5 @@ The project is licensed under the [Apache 2 license](https://github.com/ctripcor
![
现金巴士
](
https://github.com/ctripcorp/apollo/blob/master/doc/images/known-users/cash-bus.png
)
![
现金巴士
](
https://github.com/ctripcorp/apollo/blob/master/doc/images/known-users/cash-bus.png
)
![
锤子科技
](
https://github.com/ctripcorp/apollo/blob/master/doc/images/known-users/smartisan.png
)
![
锤子科技
](
https://github.com/ctripcorp/apollo/blob/master/doc/images/known-users/smartisan.png
)
![
头等仓
](
https://github.com/ctripcorp/apollo/blob/master/doc/images/known-users/toodc.png
)
![
头等仓
](
https://github.com/ctripcorp/apollo/blob/master/doc/images/known-users/toodc.png
)
![
吉祥航空
](
https://github.com/ctripcorp/apollo/blob/master/doc/images/known-users/juneyaoair.png
)
![
263移动通信
](
https://github.com/ctripcorp/apollo/blob/master/doc/images/known-users/263mobile.png
)
apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/App.java
浏览文件 @
b2f24cb1
...
@@ -86,4 +86,53 @@ public class App extends BaseEntity {
...
@@ -86,4 +86,53 @@ public class App extends BaseEntity {
.
add
(
"ownerName"
,
ownerName
)
.
add
(
"ownerName"
,
ownerName
)
.
add
(
"ownerEmail"
,
ownerEmail
).
toString
();
.
add
(
"ownerEmail"
,
ownerEmail
).
toString
();
}
}
public
static
class
Builder
{
public
Builder
()
{
}
private
App
app
=
new
App
();
public
Builder
name
(
String
name
)
{
app
.
setName
(
name
);
return
this
;
}
public
Builder
appId
(
String
appId
)
{
app
.
setAppId
(
appId
);
return
this
;
}
public
Builder
orgId
(
String
orgId
)
{
app
.
setOrgId
(
orgId
);
return
this
;
}
public
Builder
orgName
(
String
orgName
)
{
app
.
setOrgName
(
orgName
);
return
this
;
}
public
Builder
ownerName
(
String
ownerName
)
{
app
.
setOrgName
(
ownerName
);
return
this
;
}
public
Builder
ownerEmail
(
String
ownerEmail
)
{
app
.
setOwnerEmail
(
ownerEmail
);
return
this
;
}
public
App
build
()
{
return
app
;
}
}
public
static
Builder
builder
()
{
return
new
Builder
();
}
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/AppController.java
浏览文件 @
b2f24cb1
...
@@ -178,13 +178,13 @@ public class AppController {
...
@@ -178,13 +178,13 @@ public class AppController {
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
app
=
new
App
();
return
App
.
builder
()
app
.
setAppId
(
appId
);
.
appId
(
appId
)
app
.
setName
(
appName
);
.
name
(
appName
)
app
.
setOwnerName
(
ownerName
);
.
ownerName
(
ownerName
)
app
.
setOrgId
(
orgId
);
.
orgId
(
orgId
)
app
.
setOrgName
(
orgName
);
.
orgName
(
orgName
)
.
build
();
return
app
;
}
}
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ClusterController.java
浏览文件 @
b2f24cb1
...
@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Objects
;
import
static
com
.
ctrip
.
framework
.
apollo
.
common
.
utils
.
RequestPrecondition
.
checkModel
;
import
static
com
.
ctrip
.
framework
.
apollo
.
common
.
utils
.
RequestPrecondition
.
checkModel
;
@RestController
@RestController
...
@@ -32,7 +34,7 @@ public class ClusterController {
...
@@ -32,7 +34,7 @@ public class ClusterController {
public
ClusterDTO
createCluster
(
@PathVariable
String
appId
,
@PathVariable
String
env
,
public
ClusterDTO
createCluster
(
@PathVariable
String
appId
,
@PathVariable
String
env
,
@RequestBody
ClusterDTO
cluster
)
{
@RequestBody
ClusterDTO
cluster
)
{
checkModel
(
cluster
!=
null
);
checkModel
(
Objects
.
nonNull
(
cluster
)
);
RequestPrecondition
.
checkArgumentsNotEmpty
(
cluster
.
getAppId
(),
cluster
.
getName
());
RequestPrecondition
.
checkArgumentsNotEmpty
(
cluster
.
getAppId
(),
cluster
.
getName
());
if
(!
InputValidator
.
isValidClusterNamespace
(
cluster
.
getName
()))
{
if
(!
InputValidator
.
isValidClusterNamespace
(
cluster
.
getName
()))
{
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConsumerController.java
浏览文件 @
b2f24cb1
...
@@ -53,7 +53,7 @@ public class ConsumerController {
...
@@ -53,7 +53,7 @@ public class ConsumerController {
Consumer
createdConsumer
=
consumerService
.
createConsumer
(
consumer
);
Consumer
createdConsumer
=
consumerService
.
createConsumer
(
consumer
);
if
(
expires
==
null
)
{
if
(
Objects
.
isNull
(
expires
)
)
{
expires
=
DEFAULT_EXPIRES
;
expires
=
DEFAULT_EXPIRES
;
}
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java
浏览文件 @
b2f24cb1
...
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
static
com
.
ctrip
.
framework
.
apollo
.
common
.
utils
.
RequestPrecondition
.
checkModel
;
import
static
com
.
ctrip
.
framework
.
apollo
.
common
.
utils
.
RequestPrecondition
.
checkModel
;
...
@@ -128,7 +129,7 @@ public class ItemController {
...
@@ -128,7 +129,7 @@ public class ItemController {
@RequestMapping
(
value
=
"/namespaces/{namespaceName}/diff"
,
method
=
RequestMethod
.
POST
,
consumes
=
{
@RequestMapping
(
value
=
"/namespaces/{namespaceName}/diff"
,
method
=
RequestMethod
.
POST
,
consumes
=
{
"application/json"
})
"application/json"
})
public
List
<
ItemDiffs
>
diff
(
@RequestBody
NamespaceSyncModel
model
)
{
public
List
<
ItemDiffs
>
diff
(
@RequestBody
NamespaceSyncModel
model
)
{
checkModel
(
model
!=
null
&&
!
model
.
isInvalid
());
checkModel
(
Objects
.
nonNull
(
model
)
&&
!
model
.
isInvalid
());
return
configService
.
compare
(
model
.
getSyncToNamespaces
(),
model
.
getSyncItems
());
return
configService
.
compare
(
model
.
getSyncToNamespaces
(),
model
.
getSyncItems
());
}
}
...
@@ -138,14 +139,14 @@ public class ItemController {
...
@@ -138,14 +139,14 @@ public class ItemController {
"application/json"
})
"application/json"
})
public
ResponseEntity
<
Void
>
update
(
@PathVariable
String
appId
,
@PathVariable
String
namespaceName
,
public
ResponseEntity
<
Void
>
update
(
@PathVariable
String
appId
,
@PathVariable
String
namespaceName
,
@RequestBody
NamespaceSyncModel
model
)
{
@RequestBody
NamespaceSyncModel
model
)
{
checkModel
(
model
!=
null
&&
!
model
.
isInvalid
());
checkModel
(
Objects
.
nonNull
(
model
)
&&
!
model
.
isInvalid
());
configService
.
syncItems
(
model
.
getSyncToNamespaces
(),
model
.
getSyncItems
());
configService
.
syncItems
(
model
.
getSyncToNamespaces
(),
model
.
getSyncItems
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
build
();
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
build
();
}
}
private
boolean
isValidItem
(
ItemDTO
item
)
{
private
boolean
isValidItem
(
ItemDTO
item
)
{
return
item
!=
null
&&
!
StringUtils
.
isContainEmpty
(
item
.
getKey
());
return
Objects
.
nonNull
(
item
)
&&
!
StringUtils
.
isContainEmpty
(
item
.
getKey
());
}
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ReleaseController.java
浏览文件 @
b2f24cb1
...
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
static
com
.
ctrip
.
framework
.
apollo
.
common
.
utils
.
RequestPrecondition
.
checkModel
;
import
static
com
.
ctrip
.
framework
.
apollo
.
common
.
utils
.
RequestPrecondition
.
checkModel
;
...
@@ -41,7 +42,7 @@ public class ReleaseController {
...
@@ -41,7 +42,7 @@ public class ReleaseController {
@PathVariable
String
env
,
@PathVariable
String
clusterName
,
@PathVariable
String
env
,
@PathVariable
String
clusterName
,
@PathVariable
String
namespaceName
,
@RequestBody
NamespaceReleaseModel
model
)
{
@PathVariable
String
namespaceName
,
@RequestBody
NamespaceReleaseModel
model
)
{
checkModel
(
model
!=
null
);
checkModel
(
Objects
.
nonNull
(
model
)
);
model
.
setAppId
(
appId
);
model
.
setAppId
(
appId
);
model
.
setEnv
(
env
);
model
.
setEnv
(
env
);
model
.
setClusterName
(
clusterName
);
model
.
setClusterName
(
clusterName
);
...
@@ -74,7 +75,7 @@ public class ReleaseController {
...
@@ -74,7 +75,7 @@ public class ReleaseController {
@PathVariable
String
namespaceName
,
@PathVariable
String
branchName
,
@PathVariable
String
namespaceName
,
@PathVariable
String
branchName
,
@RequestBody
NamespaceReleaseModel
model
)
{
@RequestBody
NamespaceReleaseModel
model
)
{
checkModel
(
model
!=
null
);
checkModel
(
Objects
.
nonNull
(
model
)
);
model
.
setAppId
(
appId
);
model
.
setAppId
(
appId
);
model
.
setEnv
(
env
);
model
.
setEnv
(
env
);
model
.
setClusterName
(
branchName
);
model
.
setClusterName
(
branchName
);
...
@@ -142,7 +143,7 @@ public class ReleaseController {
...
@@ -142,7 +143,7 @@ public class ReleaseController {
@PathVariable
long
releaseId
)
{
@PathVariable
long
releaseId
)
{
releaseService
.
rollback
(
Env
.
valueOf
(
env
),
releaseId
);
releaseService
.
rollback
(
Env
.
valueOf
(
env
),
releaseId
);
ReleaseDTO
release
=
releaseService
.
findReleaseById
(
Env
.
valueOf
(
env
),
releaseId
);
ReleaseDTO
release
=
releaseService
.
findReleaseById
(
Env
.
valueOf
(
env
),
releaseId
);
if
(
release
==
null
)
{
if
(
Objects
.
isNull
(
release
)
)
{
return
;
return
;
}
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ServerConfigController.java
浏览文件 @
b2f24cb1
...
@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Objects
;
import
static
com
.
ctrip
.
framework
.
apollo
.
common
.
utils
.
RequestPrecondition
.
checkModel
;
import
static
com
.
ctrip
.
framework
.
apollo
.
common
.
utils
.
RequestPrecondition
.
checkModel
;
/**
/**
...
@@ -31,14 +33,14 @@ public class ServerConfigController {
...
@@ -31,14 +33,14 @@ public class ServerConfigController {
@RequestMapping
(
value
=
"/server/config"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/server/config"
,
method
=
RequestMethod
.
POST
)
public
ServerConfig
createOrUpdate
(
@RequestBody
ServerConfig
serverConfig
)
{
public
ServerConfig
createOrUpdate
(
@RequestBody
ServerConfig
serverConfig
)
{
checkModel
(
serverConfig
!=
null
);
checkModel
(
Objects
.
nonNull
(
serverConfig
)
);
RequestPrecondition
.
checkArgumentsNotEmpty
(
serverConfig
.
getKey
(),
serverConfig
.
getValue
());
RequestPrecondition
.
checkArgumentsNotEmpty
(
serverConfig
.
getKey
(),
serverConfig
.
getValue
());
String
modifiedBy
=
userInfoHolder
.
getUser
().
getUserId
();
String
modifiedBy
=
userInfoHolder
.
getUser
().
getUserId
();
ServerConfig
storedConfig
=
serverConfigRepository
.
findByKey
(
serverConfig
.
getKey
());
ServerConfig
storedConfig
=
serverConfigRepository
.
findByKey
(
serverConfig
.
getKey
());
if
(
storedConfig
==
null
)
{
//create
if
(
Objects
.
isNull
(
storedConfig
)
)
{
//create
serverConfig
.
setDataChangeCreatedBy
(
modifiedBy
);
serverConfig
.
setDataChangeCreatedBy
(
modifiedBy
);
serverConfig
.
setDataChangeLastModifiedBy
(
modifiedBy
);
serverConfig
.
setDataChangeLastModifiedBy
(
modifiedBy
);
return
serverConfigRepository
.
save
(
serverConfig
);
return
serverConfigRepository
.
save
(
serverConfig
);
...
...
doc/images/known-users/263mobile.png
0 → 100644
浏览文件 @
b2f24cb1
5.3 KB
doc/images/known-users/juneyaoair.png
0 → 100644
浏览文件 @
b2f24cb1
11.6 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录