Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zhangjian1949
apollo
提交
2108daae
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,发现更多精彩内容 >>
提交
2108daae
编写于
3月 12, 2016
作者:
Y
Yiming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add m2 database dependency
上级
0138e78f
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
137 addition
and
3 deletion
+137
-3
apollo-configserver/pom.xml
apollo-configserver/pom.xml
+14
-0
apollo-configserver/src/test/resources/application.properties
...lo-configserver/src/test/resources/application.properties
+3
-0
apollo-configserver/src/test/resources/data.sql
apollo-configserver/src/test/resources/data.sql
+0
-0
apollo-configserver/src/test/resources/schema.sql
apollo-configserver/src/test/resources/schema.sql
+0
-0
apollo-portal/pom.xml
apollo-portal/pom.xml
+13
-0
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/AppController.java
...ava/com/ctrip/apollo/portal/controller/AppController.java
+32
-0
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/SampleController.java
.../com/ctrip/apollo/portal/controller/SampleController.java
+2
-1
apollo-portal/src/main/java/com/ctrip/apollo/portal/entities/App.java
...l/src/main/java/com/ctrip/apollo/portal/entities/App.java
+41
-0
apollo-portal/src/main/java/com/ctrip/apollo/portal/repository/AppRepository.java
...ava/com/ctrip/apollo/portal/repository/AppRepository.java
+12
-0
apollo-portal/src/main/resources/application.properties
apollo-portal/src/main/resources/application.properties
+4
-0
apollo-portal/src/test/resources/application.properties
apollo-portal/src/test/resources/application.properties
+5
-0
apollo-portal/src/test/resources/data.sql
apollo-portal/src/test/resources/data.sql
+0
-0
apollo-portal/src/test/resources/schema.sql
apollo-portal/src/test/resources/schema.sql
+0
-0
pom.xml
pom.xml
+11
-2
未找到文件。
apollo-configserver/pom.xml
浏览文件 @
2108daae
...
...
@@ -24,5 +24,19 @@
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<scope>
runtime
</scope>
</dependency>
</dependencies>
</project>
apollo-configserver/src/test/resources/application.properties
0 → 100644
浏览文件 @
2108daae
spring.datasource.url
=
jdbc:h2:file:~/fxapolloconfigdb
spring.datasource.username
=
sa
spring.datasource.password
=
sa
apollo-configserver/src/test/resources/data.sql
0 → 100644
浏览文件 @
2108daae
apollo-configserver/src/test/resources/schema.sql
0 → 100644
浏览文件 @
2108daae
apollo-portal/pom.xml
浏览文件 @
2108daae
...
...
@@ -24,5 +24,18 @@
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<scope>
runtime
</scope>
</dependency>
</dependencies>
</project>
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/AppController.java
0 → 100644
浏览文件 @
2108daae
package
com.ctrip.apollo.portal.controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ctrip.apollo.portal.entities.App
;
import
com.ctrip.apollo.portal.repository.AppRepository
;
@RestController
@RequestMapping
(
"/apps"
)
public
class
AppController
{
@Autowired
private
AppRepository
appRepository
;
@RequestMapping
(
""
)
public
Page
<
App
>
list
()
{
Pageable
pageable
=
new
PageRequest
(
0
,
10
);
return
appRepository
.
findAll
(
pageable
);
}
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
public
App
create
()
{
App
ramdomApp
=
new
App
();
return
appRepository
.
save
(
ramdomApp
);
}
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/controller/SampleController.java
浏览文件 @
2108daae
...
...
@@ -4,9 +4,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/"
)
public
class
SampleController
{
@RequestMapping
(
"
/
"
)
@RequestMapping
(
""
)
public
String
home
()
{
return
"Hello World!"
;
}
...
...
apollo-portal/src/main/java/com/ctrip/apollo/portal/entities/App.java
0 → 100644
浏览文件 @
2108daae
package
com.ctrip.apollo.portal.entities
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
lombok.Data
;
@Entity
@Data
public
class
App
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
7348554309210401557L
;
@Id
private
String
id
;
@Column
(
nullable
=
false
)
private
String
name
;
@Column
(
nullable
=
false
)
private
String
owner
;
@Column
private
String
ownerPhone
;
@Column
private
String
ownerMail
;
@Column
private
Date
createTimestamp
;
@Column
private
Date
lastUpdatedTimestamp
;
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/repository/AppRepository.java
0 → 100644
浏览文件 @
2108daae
package
com.ctrip.apollo.portal.repository
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.repository.CrudRepository
;
import
com.ctrip.apollo.portal.entities.App
;
public
interface
AppRepository
extends
CrudRepository
<
App
,
String
>
{
Page
<
App
>
findAll
(
Pageable
pageable
);
}
apollo-portal/src/main/resources/application.properties
0 → 100644
浏览文件 @
2108daae
spring.datasource.url
=
jdbc:h2:file:~/fxapolloportaldb
spring.datasource.username
=
sa
spring.datasource.password
=
sa
spring.datasource.driver-class-name
=
org.h2.Driver
apollo-portal/src/test/resources/application.properties
0 → 100644
浏览文件 @
2108daae
spring.datasource.url
=
jdbc:h2:file:~/fxapolloportaldb
spring.datasource.username
=
sa
spring.datasource.password
=
sa
spring.h2.console.enabled
=
true
\ No newline at end of file
apollo-portal/src/test/resources/data.sql
0 → 100644
浏览文件 @
2108daae
apollo-portal/src/test/resources/schema.sql
0 → 100644
浏览文件 @
2108daae
pom.xml
浏览文件 @
2108daae
...
...
@@ -57,7 +57,6 @@
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<version>
1.4.191
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</dependencyManagement>
...
...
@@ -65,12 +64,22 @@
<plugins>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.5.1
</version>
<configuration>
<source>
${java.source}
</source>
<target>
${java.target}
</target>
</configuration>
</plugin>
<plugin>
<artifactId>
maven-source-plugin
</artifactId>
<executions>
<execution>
<id>
attach-sources
</id>
<goals>
<goal>
jar
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录