Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
project-template
Project
Project
Details
Activity
Releases
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
郭燕飞
project-template
Commits
00f74245
Commit
00f74245
authored
Jan 31, 2018
by
郭燕飞
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
service模板
parents
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
300 additions
and
0 deletions
+300
-0
.gitignore
service-template/.gitignore
+26
-0
README.md
service-template/README.md
+1
-0
build.gradle
service-template/api/build.gradle
+8
-0
package-info.java
service-template/api/package-info.java
+4
-0
Application.java
service-template/biz/Application.java
+22
-0
application.properties
service-template/biz/application.properties
+7
-0
bootstrap.properties
service-template/biz/bootstrap.properties
+6
-0
build.gradle
service-template/biz/build.gradle
+41
-0
default.xml
service-template/biz/default.xml
+34
-0
logback.xml
service-template/biz/logback.xml
+6
-0
spring-config.xml
service-template/biz/spring-config.xml
+7
-0
sqlMapConfig.xml
service-template/biz/sqlMapConfig.xml
+10
-0
build.gradle
service-template/build.gradle
+125
-0
settings.gradle
service-template/settings.gradle
+3
-0
No files found.
service-template/.gitignore
0 → 100644
View file @
00f74245
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
### IntelliJ IDEA ###
*/out/
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
service-template/README.md
0 → 100644
View file @
00f74245
# readme
service-template/api/build.gradle
0 → 100644
View file @
00f74245
description
=
'{artifactId}-api'
apply
plugin:
'java'
apply
plugin:
'maven'
dependencies
{
provided
(
'cn.com.duiba:wolf'
)
provided
(
'cn.com.duiba.boot:spring-boot-ext-api'
)
}
service-template/api/package-info.java
0 → 100644
View file @
00f74245
@AdvancedFeignClient
(
"{artifactId}"
)
package
{
groupId
}.{
artifactIdPackage
}.
api
.
remoteservice
;
import
cn.com.duiba.boot.netflix.feign.AdvancedFeignClient
;
service-template/biz/Application.java
0 → 100644
View file @
00f74245
package
{
groupId
}.{
artifactIdPackage
}.
biz
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.netflix.feign.EnableDuibaFeignClients
;
import
org.springframework.context.annotation.ImportResource
;
@SpringBootApplication
@ImportResource
({
"classpath:/spring/spring-config.xml"
})
@EnableDiscoveryClient
@EnableCircuitBreaker
@EnableDuibaFeignClients
(
basePackages
=
{
"{groupId}"
})
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
sa
=
new
SpringApplication
(
Application
.
class
);
sa
.
run
(
args
);
}
}
service-template/biz/application.properties
0 → 100644
View file @
00f74245
#tomcat
server.port
=
1111
server.tomcat.access-log-enabled
=
false
server.tomcat.uri-encoding
=
UTF-8
#logging
logging.path
=
${user.home}/logs/{artifactId}
service-template/biz/bootstrap.properties
0 → 100644
View file @
00f74245
spring.application.name
=
{artifactId}
spring.cloud.config.uri
=
http://configserver.dui88.com
spring.cloud.config.fail-fast
=
true
spring.profiles.active
=
dev
spring.devtools.restart.enabled
=
true
service-template/biz/build.gradle
0 → 100644
View file @
00f74245
apply
plugin:
'org.springframework.boot'
jar
{
baseName
=
'{artifactId}'
version
=
''
}
description
=
'{artifactId}-biz'
dependencies
{
compile
project
(
':{artifactId}-api'
)
compile
'cn.com.duiba.boot:spring-boot-starter-perftest'
compile
'cn.com.duiba.boot:spring-boot-starter-mybatis'
compile
'cn.com.duiba.boot:spring-boot-starter-logger'
compile
'cn.com.duiba.boot:spring-boot-starter-cat'
compile
'org.springframework.boot:spring-boot-starter-web'
compile
'org.springframework.boot:spring-boot-starter-actuator'
compile
'org.springframework.boot:spring-boot-starter-jdbc'
compile
'org.springframework.cloud:spring-cloud-starter-config'
compile
'org.springframework.cloud:spring-cloud-starter-eureka'
compile
'org.springframework.cloud:spring-cloud-starter-hystrix'
compile
'org.springframework.cloud:spring-cloud-starter-ribbon'
compile
'org.springframework.cloud:spring-cloud-starter-feign'
compile
'org.apache.commons:commons-dbcp2'
compile
'mysql:mysql-connector-java'
compile
'javax.validation:validation-api'
testCompile
'org.springframework.boot:spring-boot-starter-test'
}
install
{
//
enabled
=
false
}
uploadArchives
{
//
enabled
=
false
}
service-template/biz/default.xml
0 → 100644
View file @
00f74245
<?xml version="1.0" encoding="UTF-8"?>
<included>
<property
name=
"logpath"
value=
"${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}"
/>
<property
name=
"logPattern"
value=
"%d{HH:mm:ss.SSS} %-5level [%thread] %logger{32}[%file:%line] -> %msg%n"
/>
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${logPattern}
</pattern>
<charset
class=
"java.nio.charset.Charset"
>
utf8
</charset>
</encoder>
</appender>
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<File>
${logpath}/application.log
</File>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<FileNamePattern>
${logpath}/application_%d{yyyy-MM-dd}.log
</FileNamePattern>
<maxHistory>
10
</maxHistory>
</rollingPolicy>
<encoder>
<pattern>
${logPattern}
</pattern>
</encoder>
</appender>
<!-- 需要记录日志的包 -->
<logger
name=
"cn.com.duiba"
level=
"INFO"
/>
<logger
name=
"{artifactId}"
level=
"INFO"
/>
<root
level=
"WARN"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"FILE"
/>
</root>
</included>
service-template/biz/logback.xml
0 → 100644
View file @
00f74245
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include
resource=
"org/springframework/boot/logging/logback/defaults.xml"
/>
<include
resource=
"logback/default.xml"
/>
</configuration>
\ No newline at end of file
service-template/biz/spring-config.xml
0 → 100644
View file @
00f74245
<?xml version="1.0" encoding="UTF-8" ?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
>
</beans>
service-template/biz/sqlMapConfig.xml
0 → 100644
View file @
00f74245
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting
name=
"mapUnderscoreToCamelCase"
value=
"true"
/>
</settings>
</configuration>
\ No newline at end of file
service-template/build.gradle
0 → 100644
View file @
00f74245
buildscript
{
ext
{
springBootVersion
=
'1.5.8.RELEASE'
}
repositories
{
mavenLocal
()
maven
{
url
"http://nexus.dui88.com:8081/nexus/content/groups/public/"
}
maven
{
url
"https://plugins.gradle.org/m2/"
}
//sonarqube
maven
{
url
'http://repo.spring.io/plugins-release'
}
mavenCentral
()
}
dependencies
{
classpath
"io.spring.gradle:dependency-management-plugin:0.6.1.RELEASE"
classpath
'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5'
//sonarqube
classpath
(
"org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
)
classpath
'org.springframework.build.gradle:propdeps-plugin:0.0.7'
}
}
apply
plugin:
'org.sonarqube'
allprojects
{
apply
plugin:
'maven'
apply
plugin:
'java'
apply
plugin:
'idea'
apply
plugin:
'eclipse'
apply
plugin:
'jacoco'
apply
plugin:
"io.spring.dependency-management"
apply
plugin:
'propdeps'
test
{
ignoreFailures
=
true
}
group
=
'{groupId}'
version
=
'0.0.1-SNAPSHOT'
}
subprojects
{
sourceCompatibility
=
1.8
targetCompatibility
=
1.8
configurations
{
all
*.
exclude
group:
'log4j'
,
module:
'log4j'
all
*.
exclude
group:
'org.slf4j'
,
module:
'slf4j-log4j12'
all
*.
exclude
group:
'javax.servlet'
,
module:
'servlet-api'
//servlet 2.5
}
dependencyManagement
{
dependencies
{
imports
{
mavenBom
'cn.com.duiba.boot:spring-boot-ext-dependencies:1.2.72'
mavenBom
'org.springframework.cloud:spring-cloud-dependencies:Dalston.SR4'
}
dependency
'cn.com.duiba:wolf:2.2.7'
dependency
'com.alibaba:fastjson:1.2.29'
dependency
'mysql:mysql-connector-java:5.1.9'
dependency
'javax.validation:validation-api:1.1.0.Final'
}
}
repositories
{
mavenLocal
()
maven
{
url
"http://nexus.dui88.com:8081/nexus/content/groups/public/"
}
mavenCentral
()
}
uploadArchives
{
repositories
{
mavenDeployer
{
snapshotRepository
(
url:
"http://nexus.dui88.com:8081/nexus/content/repositories/snapshots/"
)
{
authentication
(
userName:
"admin"
,
password:
"admin123"
)
}
repository
(
url:
"http://nexus.dui88.com:8081/nexus/content/repositories/releases/"
)
{
authentication
(
userName:
"admin"
,
password:
"admin123"
)
}
pom
.
project
{
name
project
.
name
packaging
'jar'
description
project
.
name
url
'www.duiba.com.cn'
scm
{
url
''
connection
''
developerConnection
''
}
licenses
{
license
{
name
'No License'
url
'http://www.duiba.com.cn'
distribution
'repo'
}
}
developers
{
developer
{
id
'xuhengfei'
name
'Hengfei Xu'
}
}
}
}
}
}
task
sourcesJar
(
type:
Jar
,
dependsOn:
classes
)
{
classifier
=
'sources'
from
sourceSets
.
main
.
allSource
}
artifacts
{
archives
sourcesJar
}
task
listJars
(
description:
'Display all compile jars.'
)
<<
{
configurations
.
compile
.
each
{
File
file
->
println
file
.
name
}
}
}
service-template/settings.gradle
0 → 100644
View file @
00f74245
rootProject
.
name
=
'{artifactId}'
include
':{artifactId}-biz'
include
':{artifactId}-api'
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