Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
superrain51
apollo
提交
88b4069b
apollo
项目概览
superrain51
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
88b4069b
编写于
4月 15, 2016
作者:
Y
Yiming Liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Extract common module
上级
d1c7c2a2
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
45 addition
and
92 deletion
+45
-92
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/AppController.java
...m/ctrip/apollo/adminservice/controller/AppController.java
+1
-1
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/ClusterController.java
...rip/apollo/adminservice/controller/ClusterController.java
+1
-1
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/GlobalDefaultExceptionHandler.java
...dminservice/controller/GlobalDefaultExceptionHandler.java
+0
-71
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/ItemController.java
.../ctrip/apollo/adminservice/controller/ItemController.java
+1
-1
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/NamespaceController.java
...p/apollo/adminservice/controller/NamespaceController.java
+1
-1
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/ReleaseController.java
...rip/apollo/adminservice/controller/ReleaseController.java
+1
-1
apollo-adminservice/src/test/java/com/ctrip/apollo/adminservice/controller/AppControllerTest.java
...rip/apollo/adminservice/controller/AppControllerTest.java
+1
-1
apollo-biz/pom.xml
apollo-biz/pom.xml
+1
-1
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/AppService.java
...rc/main/java/com/ctrip/apollo/biz/service/AppService.java
+1
-1
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ClusterService.java
...ain/java/com/ctrip/apollo/biz/service/ClusterService.java
+1
-1
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ItemService.java
...c/main/java/com/ctrip/apollo/biz/service/ItemService.java
+1
-1
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ItemSetService.java
...ain/java/com/ctrip/apollo/biz/service/ItemSetService.java
+1
-1
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/NamespaceService.java
...n/java/com/ctrip/apollo/biz/service/NamespaceService.java
+1
-1
apollo-common/pom.xml
apollo-common/pom.xml
+23
-0
apollo-common/src/main/java/com/ctrip/apollo/common/controller/GlobalDefaultExceptionHandler.java
...ollo/common/controller/GlobalDefaultExceptionHandler.java
+1
-1
apollo-common/src/main/java/com/ctrip/apollo/common/utils/BeanUtils.java
...rc/main/java/com/ctrip/apollo/common/utils/BeanUtils.java
+1
-1
apollo-portal/pom.xml
apollo-portal/pom.xml
+1
-5
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/AppController.java
...ava/com/ctrip/apollo/portal/controller/AppController.java
+1
-2
pom.xml
pom.xml
+6
-0
未找到文件。
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/AppController.java
浏览文件 @
88b4069b
...
...
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.ctrip.apollo.biz.entity.App
;
import
com.ctrip.apollo.biz.service.AdminService
;
import
com.ctrip.apollo.biz.service.AppService
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
import
com.ctrip.apollo.core.dto.AppDTO
;
import
com.ctrip.apollo.core.exception.NotFoundException
;
import
com.ctrip.apollo.core.utils.StringUtils
;
...
...
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/ClusterController.java
浏览文件 @
88b4069b
...
...
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.ctrip.apollo.biz.entity.Cluster
;
import
com.ctrip.apollo.biz.service.ClusterService
;
import
com.ctrip.apollo.biz.service.ViewService
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
import
com.ctrip.apollo.core.dto.ClusterDTO
;
import
com.ctrip.apollo.core.exception.NotFoundException
;
...
...
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/GlobalDefaultExceptionHandler.java
已删除
100644 → 0
浏览文件 @
d1c7c2a2
package
com.ctrip.apollo.adminservice.controller
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.HttpMediaTypeException
;
import
org.springframework.web.HttpRequestMethodNotSupportedException
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseStatus
;
import
com.ctrip.apollo.core.exception.NotFoundException
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
static
org
.
springframework
.
http
.
HttpStatus
.
BAD_REQUEST
;
import
static
org
.
springframework
.
http
.
HttpStatus
.
INTERNAL_SERVER_ERROR
;
import
static
org
.
springframework
.
http
.
HttpStatus
.
NOT_FOUND
;
import
static
org
.
springframework
.
http
.
MediaType
.
APPLICATION_JSON
;
@ControllerAdvice
public
class
GlobalDefaultExceptionHandler
{
@ExceptionHandler
(
Exception
.
class
)
public
ResponseEntity
<
Map
<
String
,
Object
>>
exception
(
HttpServletRequest
request
,
Exception
ex
)
{
return
handleError
(
request
,
INTERNAL_SERVER_ERROR
,
ex
);
}
private
ResponseEntity
<
Map
<
String
,
Object
>>
handleError
(
HttpServletRequest
request
,
HttpStatus
status
,
Throwable
ex
)
{
return
handleError
(
request
,
status
,
ex
,
ex
.
getMessage
());
}
private
ResponseEntity
<
Map
<
String
,
Object
>>
handleError
(
HttpServletRequest
request
,
HttpStatus
status
,
Throwable
ex
,
String
message
)
{
ex
=
resolveError
(
ex
);
Map
<
String
,
Object
>
errorAttributes
=
new
LinkedHashMap
<>();
errorAttributes
.
put
(
"status"
,
status
.
value
());
errorAttributes
.
put
(
"message"
,
message
);
errorAttributes
.
put
(
"timestamp"
,
LocalDateTime
.
now
().
format
(
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
));
errorAttributes
.
put
(
"exception"
,
resolveError
(
ex
).
getClass
().
getName
());
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
APPLICATION_JSON
);
return
new
ResponseEntity
<>(
errorAttributes
,
headers
,
status
);
}
@ExceptionHandler
({
HttpRequestMethodNotSupportedException
.
class
,
HttpMediaTypeException
.
class
})
public
ResponseEntity
<
Map
<
String
,
Object
>>
methodNotSupportedException
(
HttpServletRequest
request
,
ServletException
ex
)
{
return
handleError
(
request
,
BAD_REQUEST
,
ex
);
}
@ExceptionHandler
(
NotFoundException
.
class
)
@ResponseStatus
(
value
=
NOT_FOUND
)
public
void
notFound
(
HttpServletRequest
req
,
NotFoundException
ex
)
{
}
private
Throwable
resolveError
(
Throwable
ex
)
{
while
(
ex
instanceof
ServletException
&&
ex
.
getCause
()
!=
null
)
{
ex
=
((
ServletException
)
ex
).
getCause
();
}
return
ex
;
}
}
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/ItemController.java
浏览文件 @
88b4069b
...
...
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.ctrip.apollo.biz.entity.Item
;
import
com.ctrip.apollo.biz.service.ItemService
;
import
com.ctrip.apollo.biz.service.ViewService
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
import
com.ctrip.apollo.core.dto.ItemDTO
;
import
com.ctrip.apollo.core.exception.NotFoundException
;
...
...
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/NamespaceController.java
浏览文件 @
88b4069b
...
...
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.ctrip.apollo.biz.entity.Namespace
;
import
com.ctrip.apollo.biz.service.NamespaceService
;
import
com.ctrip.apollo.biz.service.ViewService
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
import
com.ctrip.apollo.core.dto.NamespaceDTO
;
import
com.ctrip.apollo.core.exception.NotFoundException
;
...
...
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/ReleaseController.java
浏览文件 @
88b4069b
...
...
@@ -13,7 +13,7 @@ import com.ctrip.apollo.biz.entity.Release;
import
com.ctrip.apollo.biz.service.ConfigService
;
import
com.ctrip.apollo.biz.service.ReleaseService
;
import
com.ctrip.apollo.biz.service.ViewService
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
import
com.ctrip.apollo.core.dto.ReleaseDTO
;
import
com.ctrip.apollo.core.exception.NotFoundException
;
...
...
apollo-adminservice/src/test/java/com/ctrip/apollo/adminservice/controller/AppControllerTest.java
浏览文件 @
88b4069b
...
...
@@ -10,7 +10,7 @@ import org.springframework.test.context.jdbc.Sql.ExecutionPhase;
import
com.ctrip.apollo.biz.entity.App
;
import
com.ctrip.apollo.biz.repository.AppRepository
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
import
com.ctrip.apollo.core.dto.AppDTO
;
public
class
AppControllerTest
extends
AbstractControllerTest
{
...
...
apollo-biz/pom.xml
浏览文件 @
88b4069b
...
...
@@ -14,7 +14,7 @@
<dependencies>
<dependency>
<groupId>
com.ctrip.apollo
</groupId>
<artifactId>
apollo-co
re
</artifactId>
<artifactId>
apollo-co
mmon
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/AppService.java
浏览文件 @
88b4069b
...
...
@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
import
com.ctrip.apollo.biz.entity.App
;
import
com.ctrip.apollo.biz.repository.AppRepository
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
@Service
public
class
AppService
{
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ClusterService.java
浏览文件 @
88b4069b
...
...
@@ -5,7 +5,7 @@ import org.springframework.stereotype.Service;
import
com.ctrip.apollo.biz.entity.Cluster
;
import
com.ctrip.apollo.biz.repository.ClusterRepository
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
@Service
public
class
ClusterService
{
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ItemService.java
浏览文件 @
88b4069b
...
...
@@ -5,7 +5,7 @@ import org.springframework.stereotype.Service;
import
com.ctrip.apollo.biz.entity.Item
;
import
com.ctrip.apollo.biz.repository.ItemRepository
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
@Service
public
class
ItemService
{
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ItemSetService.java
浏览文件 @
88b4069b
...
...
@@ -5,7 +5,7 @@ import org.springframework.stereotype.Service;
import
com.ctrip.apollo.biz.entity.Item
;
import
com.ctrip.apollo.biz.repository.ItemRepository
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
import
com.ctrip.apollo.core.dto.ItemChangeSets
;
import
com.ctrip.apollo.core.dto.ItemDTO
;
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/NamespaceService.java
浏览文件 @
88b4069b
...
...
@@ -5,7 +5,7 @@ import org.springframework.stereotype.Service;
import
com.ctrip.apollo.biz.entity.Namespace
;
import
com.ctrip.apollo.biz.repository.NamespaceRepository
;
import
com.ctrip.apollo.
biz
.utils.BeanUtils
;
import
com.ctrip.apollo.
common
.utils.BeanUtils
;
@Service
public
class
NamespaceService
{
...
...
apollo-common/pom.xml
0 → 100644
浏览文件 @
88b4069b
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<parent>
<groupId>
com.ctrip.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-common
</artifactId>
<name>
Apollo Common
</name>
<dependencies>
<dependency>
<groupId>
com.ctrip.apollo
</groupId>
<artifactId>
apollo-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
</dependencies>
</project>
apollo-
portal/src/main/java/com/ctrip/apollo/portal
/controller/GlobalDefaultExceptionHandler.java
→
apollo-
common/src/main/java/com/ctrip/apollo/common
/controller/GlobalDefaultExceptionHandler.java
浏览文件 @
88b4069b
package
com.ctrip.apollo.
portal
.controller
;
package
com.ctrip.apollo.
common
.controller
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
...
...
apollo-
biz/src/main/java/com/ctrip/apollo/biz
/utils/BeanUtils.java
→
apollo-
common/src/main/java/com/ctrip/apollo/common
/utils/BeanUtils.java
浏览文件 @
88b4069b
package
com.ctrip.apollo.
biz
.utils
;
package
com.ctrip.apollo.
common
.utils
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
...
...
apollo-portal/pom.xml
浏览文件 @
88b4069b
...
...
@@ -13,11 +13,7 @@
<dependencies>
<dependency>
<groupId>
com.ctrip.apollo
</groupId>
<artifactId>
apollo-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<artifactId>
apollo-common
</artifactId>
</dependency>
</dependencies>
<build>
...
...
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/AppController.java
浏览文件 @
88b4069b
...
...
@@ -12,7 +12,6 @@ import com.ctrip.apollo.core.exception.BadRequestException;
import
com.ctrip.apollo.core.utils.StringUtils
;
import
com.ctrip.apollo.portal.entity.ClusterNavTree
;
import
com.ctrip.apollo.portal.service.AppService
;
import
com.google.common.base.Strings
;
@RestController
@RequestMapping
(
"/apps"
)
...
...
@@ -23,7 +22,7 @@ public class AppController {
@RequestMapping
(
"/{appId}/navtree"
)
public
ClusterNavTree
nav
(
@PathVariable
String
appId
)
{
if
(
String
s
.
isNullOr
Empty
(
appId
))
{
if
(
String
Utils
.
is
Empty
(
appId
))
{
throw
new
BadRequestException
(
"app id can not be empty."
);
}
...
...
pom.xml
浏览文件 @
88b4069b
...
...
@@ -90,6 +90,7 @@
<module>
apollo-core
</module>
<module>
apollo-client
</module>
<module>
apollo-biz
</module>
<module>
apollo-common
</module>
<module>
apollo-configservice
</module>
<module>
apollo-adminservice
</module>
<module>
apollo-portal
</module>
...
...
@@ -108,6 +109,11 @@
<artifactId>
apollo-biz
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
com.ctrip.apollo
</groupId>
<artifactId>
apollo-common
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
com.ctrip.framework
</groupId>
<artifactId>
framework-foundation
</artifactId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录