Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
miria-project-test
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
张征龙
miria-project-test
Commits
da5a1619
Commit
da5a1619
authored
Mar 28, 2018
by
张征龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始化项目导入
parents
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
341 additions
and
0 deletions
+341
-0
.gitignore
.gitignore
+26
-0
README.md
README.md
+1
-0
build.gradle
build.gradle
+149
-0
settings.gradle
settings.gradle
+1
-0
Application.java
...ain/java/cn/com/duiba/miria/project/test/Application.java
+20
-0
SwaggerConfig.java
...cn/com/duiba/miria/project/test/config/SwaggerConfig.java
+43
-0
MonitorController.java
...uiba/miria/project/test/controller/MonitorController.java
+29
-0
application.properties
src/main/resources/application.properties
+11
-0
bootstrap.properties
src/main/resources/bootstrap.properties
+6
-0
logback.xml
src/main/resources/logback.xml
+6
-0
default.xml
src/main/resources/logback/default.xml
+34
-0
BaseTest.java
src/test/java/cn/com/duiba/miria/project/test/BaseTest.java
+15
-0
No files found.
.gitignore
0 → 100644
View file @
da5a1619
.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/
README.md
0 → 100644
View file @
da5a1619
# readme
build.gradle
0 → 100644
View file @
da5a1619
description
=
'miria-project-test'
apply
plugin:
'org.sonarqube'
buildscript
{
ext
{
springBootVersion
=
'1.5.9.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:
'maven'
apply
plugin:
'java'
apply
plugin:
'idea'
apply
plugin:
'eclipse'
apply
plugin:
'jacoco'
apply
plugin:
"io.spring.dependency-management"
apply
plugin:
'org.springframework.boot'
apply
plugin:
'propdeps'
test
{
ignoreFailures
=
true
}
group
=
'cn.com.duiba'
version
=
'0.0.1-SNAPSHOT'
sourceCompatibility
=
1.8
targetCompatibility
=
1.8
jar
{
baseName
=
'miria-project-test'
version
=
''
}
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
}
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
()
}
dependencyManagement
{
dependencies
{
imports
{
mavenBom
'cn.com.duiba.boot:spring-boot-ext-dependencies:1.2.112'
mavenBom
"org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
mavenBom
'org.springframework.cloud:spring-cloud-dependencies:Edgware.RELEASE'
}
}
}
dependencies
{
compile
'cn.com.duiba.boot:spring-boot-starter-perftest'
compile
'cn.com.duiba.boot:spring-boot-starter-cat'
compile
'cn.com.duiba.boot:spring-boot-starter-xss'
compile
'org.springframework.boot:spring-boot-starter-web'
compile
'org.springframework.boot:spring-boot-starter-actuator'
compile
'org.springframework.boot:spring-boot-starter-freemarker'
compile
'org.springframework.cloud:spring-cloud-starter-config'
compile
'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
compile
'org.springframework.cloud:spring-cloud-starter-netflix-hystrix'
compile
'org.springframework.cloud:spring-cloud-starter-netflix-ribbon'
compile
'org.springframework.cloud:spring-cloud-starter-openfeign'
compile
'javax.validation:validation-api:1.1.0.Final'
compile
'io.springfox:springfox-swagger-ui:2.5.0'
compile
'io.springfox:springfox-swagger2:2.5.0'
compile
'com.google.guava:guava:18.0'
compile
'com.alibaba:fastjson:1.2.29'
compile
(
'org.projectlombok:lombok:1.16.18'
)
testCompile
'org.springframework.boot:spring-boot-starter-test'
}
install
{
//
enabled
=
false
}
uploadArchives
{
//
enabled
=
false
}
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
listJars
(
description:
'Display all compile jars.'
)
<<
{
configurations
.
compile
.
each
{
File
file
->
println
file
.
name
}
}
settings.gradle
0 → 100644
View file @
da5a1619
rootProject
.
name
=
'miria-project-test'
src/main/java/cn/com/duiba/miria/project/test/Application.java
0 → 100644
View file @
da5a1619
package
cn
.
com
.
duiba
.
miria
.
project
.
test
;
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
;
@SpringBootApplication
@EnableDiscoveryClient
@EnableCircuitBreaker
@EnableDuibaFeignClients
(
basePackages
=
{
"cn.com.duiba"
})
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
sa
=
new
SpringApplication
(
Application
.
class
);
sa
.
run
(
args
);
}
}
src/main/java/cn/com/duiba/miria/project/test/config/SwaggerConfig.java
0 → 100644
View file @
da5a1619
package
cn
.
com
.
duiba
.
miria
.
project
.
test
.
config
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@Configuration
@EnableSwagger2
public
class
SwaggerConfig
{
@Value
(
"${miria.project.test.swagger.enable}"
)
private
Boolean
swaggerEnable
;
/**
* swaggger配置方法
*/
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
enable
(
swaggerEnable
)
.
apiInfo
(
apiInfo
())
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.com.duiba"
))
.
paths
(
PathSelectors
.
any
())
.
build
();
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"miria-project-test"
)
.
description
(
"miria-project-test"
)
.
termsOfServiceUrl
(
""
)
.
version
(
"1.0"
)
.
build
();
}
}
src/main/java/cn/com/duiba/miria/project/test/controller/MonitorController.java
0 → 100644
View file @
da5a1619
package
cn
.
com
.
duiba
.
miria
.
project
.
test
.
controller
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
@Slf4j
@Controller
@RequestMapping
(
"/monitor"
)
public
class
MonitorController
{
@RequestMapping
(
value
=
"check"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
String
check
(){
String
res
=
"ok"
;
return
res
;
}
@RequestMapping
(
value
=
"test"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
String
test
(){
String
res
=
"ok"
;
log
.
info
(
"连接{}"
,
res
);
return
res
;
}
}
src/main/resources/application.properties
0 → 100644
View file @
da5a1619
#tomcat
server.port
=
1112
server.tomcat.access-log-enabled
=
false
server.tomcat.uri-encoding
=
UTF-8
#logging
logging.path
=
${user.home}/logs/miria-project-test
#swagger
miria.project.test.swagger.enable
=
true
\ No newline at end of file
src/main/resources/bootstrap.properties
0 → 100644
View file @
da5a1619
spring.application.name
=
miria-project-test
spring.cloud.config.uri
=
http://configserver.dui88.com
spring.cloud.config.fail-fast
=
true
spring.profiles.active
=
dev
spring.devtools.restart.enabled
=
true
src/main/resources/logback.xml
0 → 100644
View file @
da5a1619
<?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
src/main/resources/logback/default.xml
0 → 100644
View file @
da5a1619
<?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=
"cn.com.duiba"
level=
"INFO"
/>
<root
level=
"WARN"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"FILE"
/>
</root>
</included>
src/test/java/cn/com/duiba/miria/project/test/BaseTest.java
0 → 100644
View file @
da5a1619
package
cn
.
com
.
duiba
.
miria
.
project
.
test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
,
classes
=
Application
.
class
)
@AutoConfigureMockMvc
public
abstract
class
BaseTest
{
}
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