Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zhangjian1949
apollo
提交
04383980
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,发现更多精彩内容 >>
提交
04383980
编写于
6月 15, 2016
作者:
L
lepdou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
4db23ba8
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
26 addition
and
20 deletion
+26
-20
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/AdminServiceApplication.java
...ramework/apollo/adminservice/AdminServiceApplication.java
+0
-1
apollo-portal/pom.xml
apollo-portal/pom.xml
+0
-5
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/PortalApplication.java
.../com/ctrip/framework/apollo/portal/PortalApplication.java
+5
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/AppController.java
...rip/framework/apollo/portal/controller/AppController.java
+9
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/NamespaceController.java
...amework/apollo/portal/controller/NamespaceController.java
+2
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/repository/AppRepository.java
...rip/framework/apollo/portal/repository/AppRepository.java
+0
-6
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppService.java
...com/ctrip/framework/apollo/portal/service/AppService.java
+7
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java
...rip/framework/apollo/portal/service/NamespaceService.java
+2
-2
apollo-portal/src/main/resources/static/scripts/app.js
apollo-portal/src/main/resources/static/scripts/app.js
+1
-1
未找到文件。
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/AdminServiceApplication.java
浏览文件 @
04383980
...
...
@@ -14,7 +14,6 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
@EnableAspectJAutoProxy
@EnableEurekaClient
@Configuration
...
...
apollo-portal/pom.xml
浏览文件 @
04383980
...
...
@@ -28,11 +28,6 @@
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-hateoas
</artifactId>
<version>
1.3.5.RELEASE
</version>
</dependency>
</dependencies>
<build>
<plugins>
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/PortalApplication.java
浏览文件 @
04383980
...
...
@@ -9,10 +9,14 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
@EnableA
utoConfiguration
@EnableA
spectJAutoProxy
@Configuration
@EnableAutoConfiguration
@EnableTransactionManagement
@PropertySource
(
value
=
{
"classpath:portal.properties"
})
@ComponentScan
(
basePackageClasses
=
{
ApolloCommonConfig
.
class
,
PortalApplication
.
class
})
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/AppController.java
浏览文件 @
04383980
...
...
@@ -2,6 +2,7 @@ package com.ctrip.framework.apollo.portal.controller;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -17,6 +18,7 @@ import com.ctrip.framework.apollo.common.http.RichResponseEntity;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.portal.PortalSettings
;
import
com.ctrip.framework.apollo.portal.entity.vo.EnvClusterInfo
;
import
com.ctrip.framework.apollo.portal.listener.AppCreationEvent
;
import
com.ctrip.framework.apollo.portal.service.AppService
;
import
java.util.List
;
...
...
@@ -33,6 +35,9 @@ public class AppController {
@Autowired
private
PortalSettings
portalSettings
;
@Autowired
private
ApplicationEventPublisher
publisher
;
@RequestMapping
(
""
)
public
List
<
App
>
findAllApp
()
{
return
appService
.
findAll
();
...
...
@@ -60,7 +65,10 @@ public class AppController {
checkArgument
(
app
.
getName
(),
app
.
getAppId
(),
app
.
getOwnerEmail
(),
app
.
getOwnerName
());
appService
.
createApp
(
app
);
appService
.
enrichUserInfo
(
app
);
App
createdApp
=
appService
.
createOrUpdateAppInLocal
(
app
);
publisher
.
publishEvent
(
new
AppCreationEvent
(
createdApp
));
return
ResponseEntity
.
ok
().
build
();
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/NamespaceController.java
浏览文件 @
04383980
package
com.ctrip.framework.apollo.portal.controller
;
import
com.ctrip.framework.apollo.common.entity.AppNamespace
;
import
com.ctrip.framework.apollo.core.dto.AppNamespaceDTO
;
import
com.ctrip.framework.apollo.core.dto.NamespaceDTO
;
import
com.ctrip.framework.apollo.core.enums.Env
;
...
...
@@ -25,7 +26,7 @@ public class NamespaceController {
private
NamespaceService
namespaceService
;
@RequestMapping
(
"/appnamespaces/public"
)
public
List
<
AppNamespace
DTO
>
findPublicAppNamespaces
()
{
public
List
<
AppNamespace
>
findPublicAppNamespaces
()
{
return
namespaceService
.
findPublicAppNamespaces
();
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/repository/AppRepository.java
浏览文件 @
04383980
...
...
@@ -2,17 +2,11 @@ package com.ctrip.framework.apollo.portal.repository;
import
com.ctrip.framework.apollo.common.entity.App
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.data.repository.query.Param
;
import
java.util.List
;
public
interface
AppRepository
extends
PagingAndSortingRepository
<
App
,
Long
>
{
@Query
(
"SELECT a from App a WHERE a.name LIKE %:name%"
)
List
<
App
>
findByName
(
@Param
(
"name"
)
String
name
);
App
findByAppId
(
String
appId
);
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppService.java
浏览文件 @
04383980
...
...
@@ -92,21 +92,26 @@ public class AppService {
}
}
p
rivate
void
enrichUserInfo
(
App
app
)
{
p
ublic
void
enrichUserInfo
(
App
app
)
{
String
username
=
userInfoHolder
.
getUser
().
getUserId
();
app
.
setDataChangeCreatedBy
(
username
);
app
.
setDataChangeLastModifiedBy
(
username
);
}
@Transactional
p
rivate
App
createOrUpdateAppInLocal
(
App
app
)
{
p
ublic
App
createOrUpdateAppInLocal
(
App
app
)
{
String
appId
=
app
.
getAppId
();
App
managedApp
=
appRepository
.
findByAppId
(
appId
);
if
(
managedApp
!=
null
)
{
BeanUtils
.
copyEntityProperties
(
app
,
managedApp
);
return
appRepository
.
save
(
managedApp
);
}
else
{
App
createdApp
=
appRepository
.
save
(
app
);
if
(
app
.
getName
().
equals
(
"xx"
)){
throw
new
RuntimeException
(
"xxxx"
);
}
namespaceService
.
createDefaultAppNamespace
(
appId
);
//role
roleInitializationService
.
initAppRoles
(
createdApp
);
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java
浏览文件 @
04383980
...
...
@@ -58,8 +58,8 @@ public class NamespaceService {
private
Gson
gson
=
new
Gson
();
public
List
<
AppNamespace
DTO
>
findPublicAppNamespaces
()
{
return
namespaceAPI
.
findPublicAppNamespaces
(
portalSettings
.
getFirstAliveEnv
()
);
public
List
<
AppNamespace
>
findPublicAppNamespaces
()
{
return
appNamespaceRepository
.
findByNameNot
(
ConfigConsts
.
NAMESPACE_APPLICATION
);
}
public
NamespaceDTO
createNamespace
(
Env
env
,
NamespaceDTO
namespace
)
{
...
...
apollo-portal/src/main/resources/static/scripts/app.js
浏览文件 @
04383980
...
...
@@ -20,7 +20,7 @@ var sync_item_module = angular.module('sync_item', ['app.service', 'apollo.direc
var
namespace_module
=
angular
.
module
(
'
namespace
'
,
[
'
app.service
'
,
'
apollo.directive
'
,
'
app.util
'
,
'
toastr
'
,
'
angular-loading-bar
'
]);
//server config
var
server_config_module
=
angular
.
module
(
'
server_config
'
,
[
'
app.service
'
,
'
apollo.directive
'
,
'
app.util
'
,
'
toastr
'
,
'
angular-loading-bar
'
]);
//
namespace
role
//role
var
role_module
=
angular
.
module
(
'
role
'
,
[
'
app.service
'
,
'
apollo.directive
'
,
'
app.util
'
,
'
toastr
'
,
'
angular-loading-bar
'
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录