Commit 694925e9 by KingBoy

添加自动配置模块

parent 850ce06d
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'
} }
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;
}
}
package com.king.common.utils.apiresult; package com.kingboy.common.utils.apiresult;
import lombok.Data; import lombok.Data;
......
package com.king.common.utils.apiresult; package com.kingboy.common.utils.apiresult;
import lombok.Data; import lombok.Data;
......
package com.king.common.utils.apiresult; package com.kingboy.common.utils.apiresult;
import lombok.Data; import lombok.Data;
......
package com.king.common.utils.date; package com.kingboy.common.utils.date;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
......
package com.king.common.utils.json; package com.kingboy.common.utils.json;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
......
package com.king.common.utils.mapper; package com.kingboy.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;
......
package com.king.common.utils.md5; package com.kingboy.common.utils.md5;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
......
package com.king.common.utils.page; package com.kingboy.common.utils.page;
/** /**
* @author kingboy--KingBoyWorld@163.com * @author kingboy--KingBoyWorld@163.com
......
package com.king.common.utils.page; package com.kingboy.common.utils.page;
import lombok.Getter; import lombok.Getter;
......
package com.king.common.utils.page; package com.kingboy.common.utils.page;
import com.king.common.utils.mapper.MapperUtils; import com.kingboy.common.utils.mapper.MapperUtils;
import java.util.List; import java.util.List;
import java.util.function.Function; import java.util.function.Function;
......
package com.king.common.utils.random; package com.kingboy.common.utils.random;
import java.util.Random; import java.util.Random;
......
package com.king.common.utils.regex; package com.kingboy.common.utils.regex;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
......
package com.king.common.utils.uuid; package com.kingboy.common.utils.uuid;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.UUID; import java.util.UUID;
......
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.kingboy.common.utils.CommonAutoConfiguration
\ No newline at end of file
page.enabled=true
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment