Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
2108daae
Commit
2108daae
authored
Mar 12, 2016
by
Yiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add m2 database dependency
parent
0138e78f
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
138 additions
and
3 deletions
+138
-3
pom.xml
apollo-configserver/pom.xml
+14
-0
application.properties
...lo-configserver/src/test/resources/application.properties
+3
-0
data.sql
apollo-configserver/src/test/resources/data.sql
+0
-0
schema.sql
apollo-configserver/src/test/resources/schema.sql
+0
-0
pom.xml
apollo-portal/pom.xml
+13
-0
AppController.java
...ava/com/ctrip/apollo/portal/controller/AppController.java
+32
-0
SampleController.java
.../com/ctrip/apollo/portal/controller/SampleController.java
+2
-1
App.java
...l/src/main/java/com/ctrip/apollo/portal/entities/App.java
+41
-0
AppRepository.java
...ava/com/ctrip/apollo/portal/repository/AppRepository.java
+12
-0
application.properties
apollo-portal/src/main/resources/application.properties
+4
-0
application.properties
apollo-portal/src/test/resources/application.properties
+6
-0
data.sql
apollo-portal/src/test/resources/data.sql
+0
-0
schema.sql
apollo-portal/src/test/resources/schema.sql
+0
-0
pom.xml
pom.xml
+11
-2
No files found.
apollo-configserver/pom.xml
View file @
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
View file @
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
View file @
2108daae
apollo-configserver/src/test/resources/schema.sql
0 → 100644
View file @
2108daae
apollo-portal/pom.xml
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
View file @
2108daae
apollo-portal/src/test/resources/schema.sql
0 → 100644
View file @
2108daae
pom.xml
View file @
2108daae
...
...
@@ -57,7 +57,6 @@
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<version>
1.4.191
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</dependencyManagement>
...
...
@@ -65,13 +64,23 @@
<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>
<version>
1.3.3.RELEASE
</version>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment