Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
cloud-phantom
/
common
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
694925e9
authored
Nov 20, 2017
by
KingBoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加自动配置模块
parent
850ce06d
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
62 additions
and
17 deletions
+62
-17
build.gradle
+17
-3
src/main/java/com/kingboy/common/utils/CommonAutoConfiguration.java
+26
-0
src/main/java/com/kingboy/common/utils/apiresult/AbstractApiResult.java
+1
-1
src/main/java/com/kingboy/common/utils/apiresult/ErrorApiResult.java
+1
-1
src/main/java/com/kingboy/common/utils/apiresult/SuccessApiResult.java
+1
-1
src/main/java/com/kingboy/common/utils/date/LocalDateTimeUtils.java
+1
-1
src/main/java/com/kingboy/common/utils/json/JsonUtils.java
+1
-1
src/main/java/com/kingboy/common/utils/mapper/MapperUtils.java
+1
-1
src/main/java/com/kingboy/common/utils/md5/MD5Utils.java
+1
-1
src/main/java/com/kingboy/common/utils/page/PageParam.java
+1
-1
src/main/java/com/kingboy/common/utils/page/PageResult.java
+1
-1
src/main/java/com/kingboy/common/utils/page/PageResultFactory.java
+2
-2
src/main/java/com/kingboy/common/utils/random/RandomUtils.java
+1
-1
src/main/java/com/kingboy/common/utils/regex/RegexUtils.java
+1
-1
src/main/java/com/kingboy/common/utils/uuid/UUIDUtils.java
+1
-1
src/main/java/resources/META-INF/spring.factories
+3
-0
src/main/java/resources/application.properties
+2
-0
No files found.
build.gradle
View file @
694925e9
group
'com.king'
buildscript
{
version
'1.0-SNAPSHOT'
ext
{
springBootVersion
=
'1.5.8.RELEASE'
}
repositories
{
mavenCentral
()
}
dependencies
{
classpath
(
"org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
)
}
}
apply
plugin:
'java'
apply
plugin:
'java'
apply
plugin:
'eclipse'
apply
plugin:
'org.springframework.boot'
group
=
'com.kingboy'
version
=
'0.0.1-SNAPSHOT'
sourceCompatibility
=
1.8
sourceCompatibility
=
1.8
repositories
{
repositories
{
mavenCentral
()
mavenCentral
()
}
}
ext
{
ext
{
orikaVersion
=
'1.5.2'
orikaVersion
=
'1.5.2'
fastJsonVersion
=
'1.2.41'
fastJsonVersion
=
'1.2.41'
...
@@ -16,8 +30,8 @@ ext {
...
@@ -16,8 +30,8 @@ ext {
}
}
dependencies
{
dependencies
{
compile
(
"org.springframework.boot:spring-boot-autoconfigure"
)
compile
(
"ma.glasnost.orika:orika-core:$orikaVersion"
)
compile
(
"ma.glasnost.orika:orika-core:$orikaVersion"
)
compile
(
"org.projectlombok:lombok:$lombokVersion"
)
compile
(
"org.projectlombok:lombok:$lombokVersion"
)
compile
(
"com.alibaba:fastjson:$fastJsonVersion"
)
compile
(
"com.alibaba:fastjson:$fastJsonVersion"
)
testCompile
group:
'junit'
,
name:
'junit'
,
version:
'4.11'
}
}
src/main/java/com/kingboy/common/utils/CommonAutoConfiguration.java
0 → 100644
View file @
694925e9
package
com
.
kingboy
.
common
.
utils
;
import
com.kingboy.common.utils.page.PageResultFactory
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
* @author kingboy--KingBoyWorld@163.com
* @date 2017/11/20 下午6:04
* @desc 公共模块自动配置累.
*/
@Configuration
@ConditionalOnClass
({
PageResultFactory
.
class
})
public
class
CommonAutoConfiguration
{
@Bean
@ConditionalOnMissingBean
(
PageResultFactory
.
class
)
@ConditionalOnProperty
(
name
=
"page.enabled"
,
matchIfMissing
=
true
)
public
PageResultFactory
authorResolver
()
{
PageResultFactory
pageResultFactory
=
new
PageResultFactory
();
return
pageResultFactory
;
}
}
src/main/java/com/king/common/utils/apiresult/AbstractApiResult.java
→
src/main/java/com/king
boy
/common/utils/apiresult/AbstractApiResult.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
apiresult
;
package
com
.
king
boy
.
common
.
utils
.
apiresult
;
import
lombok.Data
;
import
lombok.Data
;
...
...
src/main/java/com/king/common/utils/apiresult/ErrorApiResult.java
→
src/main/java/com/king
boy
/common/utils/apiresult/ErrorApiResult.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
apiresult
;
package
com
.
king
boy
.
common
.
utils
.
apiresult
;
import
lombok.Data
;
import
lombok.Data
;
...
...
src/main/java/com/king/common/utils/apiresult/SuccessApiResult.java
→
src/main/java/com/king
boy
/common/utils/apiresult/SuccessApiResult.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
apiresult
;
package
com
.
king
boy
.
common
.
utils
.
apiresult
;
import
lombok.Data
;
import
lombok.Data
;
...
...
src/main/java/com/king/common/utils/date/LocalDateTimeUtils.java
→
src/main/java/com/king
boy
/common/utils/date/LocalDateTimeUtils.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
date
;
package
com
.
king
boy
.
common
.
utils
.
date
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
...
src/main/java/com/king/common/utils/json/JsonUtils.java
→
src/main/java/com/king
boy
/common/utils/json/JsonUtils.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
json
;
package
com
.
king
boy
.
common
.
utils
.
json
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
...
src/main/java/com/king/common/utils/mapper/MapperUtils.java
→
src/main/java/com/king
boy
/common/utils/mapper/MapperUtils.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
mapper
;
package
com
.
king
boy
.
common
.
utils
.
mapper
;
import
ma.glasnost.orika.MapperFactory
;
import
ma.glasnost.orika.MapperFactory
;
import
ma.glasnost.orika.impl.DefaultMapperFactory
;
import
ma.glasnost.orika.impl.DefaultMapperFactory
;
...
...
src/main/java/com/king/common/utils/md5/MD5Utils.java
→
src/main/java/com/king
boy
/common/utils/md5/MD5Utils.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
md5
;
package
com
.
king
boy
.
common
.
utils
.
md5
;
import
java.security.MessageDigest
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.security.NoSuchAlgorithmException
;
...
...
src/main/java/com/king/common/utils/page/PageParam.java
→
src/main/java/com/king
boy
/common/utils/page/PageParam.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
page
;
package
com
.
king
boy
.
common
.
utils
.
page
;
/**
/**
* @author kingboy--KingBoyWorld@163.com
* @author kingboy--KingBoyWorld@163.com
...
...
src/main/java/com/king/common/utils/page/PageResult.java
→
src/main/java/com/king
boy
/common/utils/page/PageResult.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
page
;
package
com
.
king
boy
.
common
.
utils
.
page
;
import
lombok.Getter
;
import
lombok.Getter
;
...
...
src/main/java/com/king/common/utils/page/PageResultFactory.java
→
src/main/java/com/king
boy
/common/utils/page/PageResultFactory.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
page
;
package
com
.
king
boy
.
common
.
utils
.
page
;
import
com.king.common.utils.mapper.MapperUtils
;
import
com.king
boy
.common.utils.mapper.MapperUtils
;
import
java.util.List
;
import
java.util.List
;
import
java.util.function.Function
;
import
java.util.function.Function
;
...
...
src/main/java/com/king/common/utils/random/RandomUtils.java
→
src/main/java/com/king
boy
/common/utils/random/RandomUtils.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
random
;
package
com
.
king
boy
.
common
.
utils
.
random
;
import
java.util.Random
;
import
java.util.Random
;
...
...
src/main/java/com/king/common/utils/regex/RegexUtils.java
→
src/main/java/com/king
boy
/common/utils/regex/RegexUtils.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
regex
;
package
com
.
king
boy
.
common
.
utils
.
regex
;
import
java.util.regex.Matcher
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
...
src/main/java/com/king/common/utils/uuid/UUIDUtils.java
→
src/main/java/com/king
boy
/common/utils/uuid/UUIDUtils.java
View file @
694925e9
package
com
.
king
.
common
.
utils
.
uuid
;
package
com
.
king
boy
.
common
.
utils
.
uuid
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.UUID
;
import
java.util.UUID
;
...
...
src/main/java/resources/META-INF/spring.factories
0 → 100644
View file @
694925e9
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.kingboy.common.utils.CommonAutoConfiguration
\ No newline at end of file
src/main/java/resources/application.properties
0 → 100644
View file @
694925e9
page.enabled
=
true
\ No newline at end of file
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