├── .babelrc ├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── deploy.yml ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── assets └── spring-boot-reference.pdf ├── codes ├── core │ ├── README.md │ ├── pom.xml │ ├── spring-boot-actuator │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── SpringBootActuatorApplication.java │ │ │ │ │ └── WelcomeController.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ └── templates │ │ │ │ ├── error.ftl │ │ │ │ └── home.ftl │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── SpringBootActuatorApplicationPortTests.java │ │ │ └── SpringBootActuatorApplicationTests.java │ ├── spring-boot-aop │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── SpringBootAopApplication.java │ │ │ │ │ ├── aop │ │ │ │ │ ├── LogRecord.java │ │ │ │ │ ├── LogRecordDao.java │ │ │ │ │ ├── LogRecordDaoImpl.java │ │ │ │ │ ├── MethodLog.java │ │ │ │ │ └── MethodLogAspect.java │ │ │ │ │ ├── monitor │ │ │ │ │ └── ServiceAspect.java │ │ │ │ │ └── service │ │ │ │ │ └── WelcomeService.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ └── sql │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── SpringBootAopApplicationTests.java │ ├── spring-boot-async │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── AppRunner.java │ │ │ │ ├── SpringBootAsyncApplication.java │ │ │ │ └── service │ │ │ │ ├── GitHubLookupService.java │ │ │ │ └── User.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ └── logback.xml │ ├── spring-boot-banner │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── SpringBootBannerApplication.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── banner.txt │ ├── spring-boot-bean │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── BeanUtil.java │ │ │ │ │ ├── SpringBootBeanApplication.java │ │ │ │ │ └── bean │ │ │ │ │ ├── Company.java │ │ │ │ │ ├── InfoDTO.java │ │ │ │ │ ├── Person.java │ │ │ │ │ ├── UserDO.java │ │ │ │ │ └── UserDTO.java │ │ │ └── resources │ │ │ │ ├── banner.txt │ │ │ │ ├── dozer-mapping.xml │ │ │ │ └── logback.xml │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── SpringBootBeanApplicationTests.java │ ├── spring-boot-profile │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── SpringBootProfileApplication.java │ │ │ │ │ └── service │ │ │ │ │ ├── MessageService.java │ │ │ │ │ └── impl │ │ │ │ │ ├── DevMessageServiceImpl.java │ │ │ │ │ ├── ProdMessageServiceImpl.java │ │ │ │ │ └── TestMessageServiceImpl.java │ │ │ └── resources │ │ │ │ ├── application-dev.properties │ │ │ │ ├── application-prod.properties │ │ │ │ ├── application-test.properties │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ └── logback.xml │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── SpringBootProfileApplicationTests.java │ └── spring-boot-property │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── SpringBootPropertyApplication.java │ │ │ │ ├── annotation │ │ │ │ ├── IsMobile.java │ │ │ │ └── RegexValid.java │ │ │ │ ├── config │ │ │ │ ├── CustomConfig.java │ │ │ │ ├── DunwuProperties.java │ │ │ │ ├── DunwuRandomProperties.java │ │ │ │ ├── GenderEnum.java │ │ │ │ ├── ValidatedProperties.java │ │ │ │ └── ValidatedPropertiesValidator.java │ │ │ │ └── validator │ │ │ │ ├── MobileValidator.java │ │ │ │ └── RegexValidator.java │ │ └── resources │ │ │ ├── application-prop.properties │ │ │ ├── application-yaml.yaml │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ └── prop │ │ │ ├── custom.properties │ │ │ ├── random.properties │ │ │ └── validator.properties │ │ └── test │ │ └── java │ │ └── io │ │ └── github │ │ └── dunwu │ │ └── springboot │ │ └── SpringBootPropertyApplicationTest.java ├── data │ ├── README.md │ ├── pom.xml │ ├── spring-boot-data-cache-j2cache │ │ ├── pom.xml │ │ ├── readme.md │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ └── data │ │ │ │ │ ├── SpringBootDataCacheJ2cacheApplication.java │ │ │ │ │ ├── config │ │ │ │ │ ├── J2CacheAutoConfiguration.java │ │ │ │ │ ├── J2CacheProperties.java │ │ │ │ │ ├── J2CacheSpringCacheAutoConfiguration.java │ │ │ │ │ └── J2CacheSpringRedisAutoConfiguration.java │ │ │ │ │ └── support │ │ │ │ │ ├── J2CacheCache.java │ │ │ │ │ ├── J2CacheCacheManger.java │ │ │ │ │ ├── redis │ │ │ │ │ ├── ConfigureNotifyKeyspaceEventsAction.java │ │ │ │ │ ├── SpringRedisActiveMessageListener.java │ │ │ │ │ ├── SpringRedisCache.java │ │ │ │ │ ├── SpringRedisGenericCache.java │ │ │ │ │ ├── SpringRedisMessageListener.java │ │ │ │ │ ├── SpringRedisProvider.java │ │ │ │ │ └── SpringRedisPubSubPolicy.java │ │ │ │ │ └── util │ │ │ │ │ ├── J2CacheSerializer.java │ │ │ │ │ ├── SpringJ2CacheConfigUtil.java │ │ │ │ │ └── SpringUtil.java │ │ │ └── resources │ │ │ │ ├── META-INF │ │ │ │ ├── spring-configuration-metadata.json │ │ │ │ └── spring.factories │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── j2cache.properties │ │ │ │ └── logback.xml │ │ │ └── test │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── SpringBootDataCacheJ2cacheApplicationTests.java │ │ │ │ ├── bean │ │ │ │ └── TestBean.java │ │ │ │ └── service │ │ │ │ └── TestService.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── j2cache-test.properties │ ├── spring-boot-data-cache-jetcache │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── data │ │ │ │ ├── SpringBootDataCacheJetcacheApplication.java │ │ │ │ ├── config │ │ │ │ └── CacheAutoConfiguration.java │ │ │ │ ├── entity │ │ │ │ └── User.java │ │ │ │ └── mapper │ │ │ │ ├── UserDao.java │ │ │ │ └── UserDaoImpl.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ └── sql │ │ │ ├── data.sql │ │ │ └── schema.sql │ ├── spring-boot-data-cache │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── data │ │ │ │ ├── SpringBootDataCacheApplication.java │ │ │ │ ├── User.java │ │ │ │ ├── UserDao.java │ │ │ │ └── UserDaoImpl.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ └── sql │ │ │ ├── data.sql │ │ │ └── schema.sql │ ├── spring-boot-data-druid │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ └── data │ │ │ │ │ ├── SpringBootDataDruidApplication.java │ │ │ │ │ ├── User.java │ │ │ │ │ ├── UserDao.java │ │ │ │ │ ├── UserDaoExecutor.java │ │ │ │ │ └── UserDaoImpl.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ └── sql │ │ │ │ ├── data.sql │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── data │ │ │ └── SpringBootDataDruidApplicationTest.java │ ├── spring-boot-data-elasticsearch-jest │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── SpringBootDataElasticsearchApplication.java │ │ │ │ │ └── data │ │ │ │ │ ├── constant │ │ │ │ │ ├── NamingStrategy.java │ │ │ │ │ ├── OrderType.java │ │ │ │ │ ├── QueryJudgeType.java │ │ │ │ │ └── QueryLogicType.java │ │ │ │ │ ├── elasticsearch │ │ │ │ │ ├── ElasticSearchUtil.java │ │ │ │ │ ├── QueryDocument.java │ │ │ │ │ └── QueryField.java │ │ │ │ │ ├── entities │ │ │ │ │ ├── Article.java │ │ │ │ │ ├── ArticleBuilder.java │ │ │ │ │ ├── Author.java │ │ │ │ │ ├── Book.java │ │ │ │ │ ├── Car.java │ │ │ │ │ ├── GirlFriend.java │ │ │ │ │ ├── Operation.java │ │ │ │ │ ├── Person.java │ │ │ │ │ ├── PersonMultipleLevelNested.java │ │ │ │ │ ├── Product.java │ │ │ │ │ ├── Sector.java │ │ │ │ │ ├── User.java │ │ │ │ │ └── UserQuery.java │ │ │ │ │ └── repositories │ │ │ │ │ ├── ArticleRepository.java │ │ │ │ │ ├── BookRepository.java │ │ │ │ │ ├── OperationRepository.java │ │ │ │ │ ├── ProductRepository.java │ │ │ │ │ └── UserRepository.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ └── logback.xml │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── data │ │ │ ├── entities │ │ │ ├── Contact.java │ │ │ ├── Manuscript.java │ │ │ └── Role.java │ │ │ └── repositories │ │ │ ├── ArticleRepositoryTest.java │ │ │ ├── BookRepositoryTest.java │ │ │ ├── ElasticsearchFacetTests.java │ │ │ ├── ElasticsearchPerformanceTest.java │ │ │ ├── NestedObjectTests.java │ │ │ ├── OperationRepositoryTest.java │ │ │ ├── ProductRepositoryTest.java │ │ │ └── UserRepositoryTest.java │ ├── spring-boot-data-elasticsearch │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── JestClientDemo.java │ │ │ │ │ ├── SpringBootDataElasticsearchApplication.java │ │ │ │ │ └── data │ │ │ │ │ ├── annotation │ │ │ │ │ ├── QueryDocument.java │ │ │ │ │ └── QueryField.java │ │ │ │ │ ├── constant │ │ │ │ │ ├── NamingStrategy.java │ │ │ │ │ ├── OrderType.java │ │ │ │ │ ├── QueryJudgeType.java │ │ │ │ │ └── QueryLogicType.java │ │ │ │ │ ├── entities │ │ │ │ │ ├── Article.java │ │ │ │ │ ├── ArticleBuilder.java │ │ │ │ │ ├── Author.java │ │ │ │ │ ├── Book.java │ │ │ │ │ ├── Car.java │ │ │ │ │ ├── GirlFriend.java │ │ │ │ │ ├── Operation.java │ │ │ │ │ ├── Person.java │ │ │ │ │ ├── PersonMultipleLevelNested.java │ │ │ │ │ ├── Product.java │ │ │ │ │ ├── Sector.java │ │ │ │ │ ├── User.java │ │ │ │ │ └── UserQuery.java │ │ │ │ │ ├── repositories │ │ │ │ │ ├── ArticleRepository.java │ │ │ │ │ ├── BookRepository.java │ │ │ │ │ ├── OperationRepository.java │ │ │ │ │ ├── ProductRepository.java │ │ │ │ │ └── UserRepository.java │ │ │ │ │ └── util │ │ │ │ │ ├── ElasticSearchUtil.java │ │ │ │ │ └── QueryFeildToQueryBuilderUtil.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ └── logback.xml │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── data │ │ │ ├── entities │ │ │ ├── Contact.java │ │ │ ├── Manuscript.java │ │ │ └── Role.java │ │ │ └── repositories │ │ │ ├── ArticleRepositoryTest.java │ │ │ ├── BookRepositoryTest.java │ │ │ ├── ElasticsearchFacetTests.java │ │ │ ├── ElasticsearchPerformanceTest.java │ │ │ ├── NestedObjectTests.java │ │ │ ├── OperationRepositoryTest.java │ │ │ ├── ProductRepositoryTest.java │ │ │ └── UserRepositoryTest.java │ ├── spring-boot-data-flyway │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ └── data │ │ │ │ │ ├── SpringBootDataFlywayApplication.java │ │ │ │ │ ├── User.java │ │ │ │ │ ├── UserDao.java │ │ │ │ │ └── UserDaoImpl.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ └── sql │ │ │ │ ├── V1__Create_table_user.sql │ │ │ │ └── V2__Add_user.sql │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── data │ │ │ └── SpringBootDataFlywayApplicationTests.java │ ├── spring-boot-data-hdfs │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ ├── data │ │ │ │ └── hdfs │ │ │ │ │ ├── HdfsConfig.java │ │ │ │ │ ├── HdfsFactory.java │ │ │ │ │ ├── HdfsPool.java │ │ │ │ │ └── HdfsUtil.java │ │ │ │ └── springboot │ │ │ │ ├── HdfsConfiguration.java │ │ │ │ ├── HdfsProperties.java │ │ │ │ └── SpringBootDataHdfsApplication.java │ │ │ └── resources │ │ │ └── application.properties │ ├── spring-boot-data-jdbc-multi-datasource │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ └── data │ │ │ │ │ ├── DataSourceConfig.java │ │ │ │ │ ├── H2UserDaoImpl.java │ │ │ │ │ ├── MysqlUserDaoImpl.java │ │ │ │ │ ├── SpringBootDataJdbcMultiDataSourceApplication.java │ │ │ │ │ ├── User.java │ │ │ │ │ └── UserDao.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ └── sql │ │ │ │ ├── data.sql │ │ │ │ ├── schema-h2.sql │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── data │ │ │ ├── DataJdbcH2DataSourceTest.java │ │ │ └── DataJdbcMysqlDataSourceTest.java │ ├── spring-boot-data-jdbc │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ └── data │ │ │ │ │ ├── SpringBootDataJdbcApplication.java │ │ │ │ │ ├── User.java │ │ │ │ │ ├── UserDao.java │ │ │ │ │ ├── UserDaoExecutor.java │ │ │ │ │ └── UserDaoImpl.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ └── sql │ │ │ │ ├── data.sql │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── data │ │ │ └── SpringBootDataJdbcTest.java │ ├── spring-boot-data-jpa │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ └── data │ │ │ │ │ ├── SpringBootDataJpaApplication.java │ │ │ │ │ ├── User.java │ │ │ │ │ └── UserRepository.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ └── sql │ │ │ │ ├── data.sql │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── SpringBootJpaRestTest.java │ │ │ │ └── SpringBootJpaTest.java │ │ │ └── resources │ │ │ ├── application-test.properties │ │ │ └── sql │ │ │ ├── data-h2.sql │ │ │ └── schema-h2.sql │ ├── spring-boot-data-mongodb │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── SpringBootDataMongodbApplication.java │ │ │ │ │ └── mongodb │ │ │ │ │ ├── CustomerRepository.java │ │ │ │ │ ├── Person.java │ │ │ │ │ ├── advanced │ │ │ │ │ ├── AdvancedRepository.java │ │ │ │ │ └── ApplicationConfiguration.java │ │ │ │ │ ├── customer │ │ │ │ │ ├── Address.java │ │ │ │ │ ├── ApplicationConfiguration.java │ │ │ │ │ ├── Customer.java │ │ │ │ │ └── CustomerRepository.java │ │ │ │ │ ├── immutable │ │ │ │ │ ├── ApplicationConfiguration.java │ │ │ │ │ └── ImmutablePerson.java │ │ │ │ │ └── projections │ │ │ │ │ ├── Customer.java │ │ │ │ │ ├── CustomerDto.java │ │ │ │ │ ├── CustomerProjection.java │ │ │ │ │ ├── CustomerRepository.java │ │ │ │ │ └── CustomerSummary.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ └── logback.xml │ │ │ └── test │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── mongodb │ │ │ │ ├── PersonRepositoryTests.java │ │ │ │ ├── advanced │ │ │ │ ├── AdvancedIntegrationTests.java │ │ │ │ ├── ServersideScriptTests.java │ │ │ │ └── package-info.java │ │ │ │ ├── customer │ │ │ │ ├── CustomerRepositoryIntegrationTest.java │ │ │ │ └── package-info.java │ │ │ │ ├── immutable │ │ │ │ └── ImmutableEntityIntegrationTest.java │ │ │ │ └── projections │ │ │ │ └── CustomerRepositoryIntegrationTest.java │ │ │ └── resources │ │ │ └── application.properties │ ├── spring-boot-data-mybatis-multi-datasource │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── SpringBootDataMybatisMultiDataSourceApplication.java │ │ │ │ │ └── data │ │ │ │ │ ├── entity │ │ │ │ │ └── User.java │ │ │ │ │ └── mapper │ │ │ │ │ ├── Db1UserMapper.java │ │ │ │ │ └── Db2UserMapper.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ └── sql │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── SpringBootDataMybatisMultiDataSourceApplicationTests.java │ ├── spring-boot-data-mybatis-plus │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ └── data │ │ │ │ │ ├── SpringBootDataMybatisPlusApplication.java │ │ │ │ │ ├── entity │ │ │ │ │ └── User.java │ │ │ │ │ └── mapper │ │ │ │ │ └── UserMapper.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ └── sql │ │ │ │ ├── data.sql │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── data │ │ │ │ └── SpringBootDataMybatisPlusApplicationTest.java │ │ │ └── resources │ │ │ ├── application-test.properties │ │ │ └── sql │ │ │ ├── data-h2.sql │ │ │ └── schema-h2.sql │ ├── spring-boot-data-mybatis-sharding │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── SpringBootDataMybatisShardingApplication.java │ │ │ │ │ └── data │ │ │ │ │ ├── entity │ │ │ │ │ └── User.java │ │ │ │ │ └── mapper │ │ │ │ │ └── UserMapper.java │ │ │ └── resources │ │ │ │ ├── application-master-slave.properties │ │ │ │ ├── application-sharding-databases-tables.properties │ │ │ │ ├── application-sharding-databases.properties │ │ │ │ ├── application-sharding-master-slave.properties │ │ │ │ ├── application-sharding-tables.properties │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ └── sql │ │ │ │ ├── clear.sql │ │ │ │ ├── master_slave.sql │ │ │ │ ├── sharding_databases.sql │ │ │ │ ├── sharding_databases_tables.sql │ │ │ │ └── sharding_tables.sql │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── MasterSlaveTests.java │ │ │ ├── ShardingDatabasesTablesTests.java │ │ │ ├── ShardingDatabasesTests.java │ │ │ └── ShardingTablesTests.java │ ├── spring-boot-data-redis-cluster │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── CustomRedisAutoConfiguration.java │ │ │ │ ├── SpringBootDataRedisClusterApplication.java │ │ │ │ └── data │ │ │ │ ├── User.java │ │ │ │ ├── UserService.java │ │ │ │ └── UserServiceImpl.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ └── logback.xml │ ├── spring-boot-data-redis │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── RedisAutoConfiguration.java │ │ │ │ ├── SpringBootDataRedisApplication.java │ │ │ │ └── data │ │ │ │ ├── User.java │ │ │ │ ├── UserService.java │ │ │ │ └── UserServiceImpl.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ └── logback.xml │ └── spring-boot-data-tx │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── data │ │ │ ├── SpringTxFailedApplication.java │ │ │ ├── UserEntity.java │ │ │ ├── UserRepository.java │ │ │ ├── propagation │ │ │ ├── SubUserService.java │ │ │ ├── TransactionPropagationController.java │ │ │ └── UserService.java │ │ │ ├── proxyfailed │ │ │ ├── TransactionProxyFailedController.java │ │ │ └── UserService.java │ │ │ └── rollbackfailed │ │ │ ├── TransactionRollbackFailedController.java │ │ │ └── UserService.java │ │ └── resources │ │ ├── application.properties │ │ ├── applicationContext.xml │ │ ├── data │ │ ├── spring-druid.xml │ │ ├── spring-h2.xml │ │ └── spring-mysql.xml │ │ ├── logback.xml │ │ ├── news.csv │ │ ├── properties │ │ ├── h2.properties │ │ └── mysql.properties │ │ ├── sql │ │ ├── h2 │ │ │ └── ddl.sql │ │ └── mysql │ │ │ └── ddl.sql │ │ └── templates │ │ ├── index.html │ │ └── xss.html ├── distributed │ ├── spring-boot-dubbo │ │ ├── README.md │ │ ├── pom.xml │ │ ├── spring-boot-dubbo-api │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── dubbo │ │ │ │ └── api │ │ │ │ ├── DemoService.java │ │ │ │ ├── InfoDto.java │ │ │ │ └── InfoService.java │ │ ├── spring-boot-dubbo-autoconfig-consumer │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ └── dubbo │ │ │ │ │ └── consumer │ │ │ │ │ └── DubboAutoConfigurationConsumerBootstrap.java │ │ │ │ └── resources │ │ │ │ └── application.properties │ │ ├── spring-boot-dubbo-autoconfig-provider │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ └── dubbo │ │ │ │ │ └── provider │ │ │ │ │ ├── bootstrap │ │ │ │ │ └── DubboAutoConfigurationProviderBootstrap.java │ │ │ │ │ └── service │ │ │ │ │ └── DefaultDemoService.java │ │ │ │ └── resources │ │ │ │ └── application.properties │ │ ├── spring-boot-dubbo-zookeeper-consumer │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ └── dubbo │ │ │ │ │ └── consumer │ │ │ │ │ └── DubboRegistryZooKeeperConsumerBootstrap.java │ │ │ │ └── resources │ │ │ │ └── application.properties │ │ └── spring-boot-dubbo-zookeeper-provider │ │ │ ├── pom.xml │ │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── dubbo │ │ │ │ └── provider │ │ │ │ ├── bootstrap │ │ │ │ ├── DubboRegistryZooKeeperProviderBootstrap.java │ │ │ │ └── EmbeddedZooKeeper.java │ │ │ │ └── service │ │ │ │ └── DefaultDemoService.java │ │ │ └── resources │ │ │ └── application.properties │ └── spring-boot-zookeeper │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── SpringBootZooKeeperApplication.java │ │ │ └── ZooKeeperTemplate.java │ │ └── resources │ │ ├── application.properties │ │ ├── banner.txt │ │ └── logback.xml ├── integration │ ├── spring-boot-docker │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── boot.sh │ │ ├── docker-entrypoint.sh │ │ ├── env.sh │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── SpringBootDockerApplication.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ └── logback.xml │ ├── spring-boot-logging │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── SpringBootLoggingApplication.java │ │ │ │ │ ├── aspect │ │ │ │ │ └── WebLogAspect.java │ │ │ │ │ └── web │ │ │ │ │ └── HelloController.java │ │ │ └── resources │ │ │ │ ├── application-log4j.properties │ │ │ │ ├── application-log4j2.properties │ │ │ │ ├── application-logback.properties │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── log4j.xml │ │ │ │ ├── log4j2.xml │ │ │ │ └── logback.xml │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── AopLogTests.java │ │ │ └── ProfileLogConfigTests.java │ ├── spring-boot-mail │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── MailDTO.java │ │ │ │ │ ├── MailProperties.java │ │ │ │ │ ├── MailService.java │ │ │ │ │ └── SpringBootMailApplication.java │ │ │ └── resources │ │ │ │ ├── application-163.properties │ │ │ │ ├── application-qq.properties │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ └── logback.xml │ │ │ └── test │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── MailServiceTests.java │ │ │ └── resources │ │ │ ├── icon-man.png │ │ │ └── moon.png │ ├── spring-boot-scheduler-quartz │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── QuartzController.java │ │ │ │ ├── SampleJob.java │ │ │ │ └── SpringBootSchedulerQuartzApplication.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ └── sql │ │ │ └── schema.sql │ ├── spring-boot-scheduler │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── ScheduledTask.java │ │ │ │ └── SpringBootSchedulerApplication.java │ │ │ └── resources │ │ │ ├── banner.txt │ │ │ └── logback.xml │ ├── spring-boot-shell │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── shell │ │ │ ├── DateCommand.java │ │ │ ├── JsonCommand.java │ │ │ └── SpringShellApplication.java │ ├── spring-boot-statemachine │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── Events.java │ │ │ │ ├── SpringBootStateMachineApplication.java │ │ │ │ ├── StateMachineConfig.java │ │ │ │ └── States.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ └── logback.xml │ ├── spring-boot-swagger │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── SpringBootSwaggerApplication.java │ │ │ │ ├── data │ │ │ │ ├── User.java │ │ │ │ └── UserRepository.java │ │ │ │ └── web │ │ │ │ ├── ResponseDTO.java │ │ │ │ └── UserController.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ └── sql │ │ │ ├── data-h2.sql │ │ │ └── schema-h2.sql │ └── spring-boot-test-junit5 │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── HelloController.java │ │ │ │ ├── HelloService.java │ │ │ │ └── TestJunit5Application.java │ │ └── resources │ │ │ ├── banner.txt │ │ │ └── logback.xml │ │ └── test │ │ └── java │ │ └── io │ │ └── github │ │ └── dunwu │ │ └── springboot │ │ ├── AssertionsDemo.java │ │ ├── AssumptionsDemo.java │ │ ├── DisabledClassDemo.java │ │ ├── DisabledTestsDemo.java │ │ ├── JavaVersionTestsDemo.java │ │ ├── Junit5StandardTests.java │ │ ├── JunitDisplayNameDemo.java │ │ ├── OSEnvDemo.java │ │ ├── ParameterizedTestDemo.java │ │ ├── RepeatedTestsDemo.java │ │ ├── ServiceTestsDemo.java │ │ ├── SystemPropertyTestsDemo.java │ │ ├── TestJunit5ApplicationTests.java │ │ ├── TestOnWindows.java │ │ ├── TestingAStackDemo.java │ │ └── bean │ │ └── Person.java ├── mq │ ├── spring-boot-mq-activemq │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── Consumer.java │ │ │ │ │ ├── MsgActivemqApplication.java │ │ │ │ │ └── Producer.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ └── logback.xml │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── MsgActivemqApplicationTests.java │ ├── spring-boot-mq-kafka │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── KafkaProducerController.java │ │ │ │ │ ├── SpringBootMsgKafkaApplication.java │ │ │ │ │ ├── config │ │ │ │ │ └── DunwuKafkaConfig.java │ │ │ │ │ └── msg │ │ │ │ │ └── StringStringKafkaConsumer.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ └── logback.xml │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── KafkaProducerTest.java │ │ │ ├── KafkaTestBean.java │ │ │ └── SpringKafkaTest.java │ ├── spring-boot-mq-rabbitmq │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── RabbitConfiguration.java │ │ │ │ ├── RabbitConsumer.java │ │ │ │ ├── RabbitMqApplication.java │ │ │ │ └── RabbitProducer.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ └── logback.xml │ └── spring-boot-mq-redis │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── MsgRedisApplication.java │ │ │ └── Receiver.java │ │ └── resources │ │ ├── application.properties │ │ ├── banner.txt │ │ └── logback.xml ├── security │ ├── spring-boot-security-authentication │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── SpringBootAuthSecurityApplication.java │ │ │ │ └── security │ │ │ │ ├── config │ │ │ │ └── SecurityConfiguration.java │ │ │ │ ├── controller │ │ │ │ ├── IndexController.java │ │ │ │ └── UnAuthorizedController.java │ │ │ │ ├── domain │ │ │ │ └── MyUser.java │ │ │ │ └── handler │ │ │ │ ├── CustomAuthenticationFailureHandler.java │ │ │ │ └── CustomAuthenticationSuccessHandler.java │ │ │ └── resources │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ └── static │ │ │ ├── auth │ │ │ ├── forgot.html │ │ │ ├── login.html │ │ │ ├── register.html │ │ │ └── reset.html │ │ │ ├── css │ │ │ ├── index.css │ │ │ └── theme.css │ │ │ └── index.html │ ├── spring-boot-security-checkcode │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── AuthCheckCodeSecurityApplication.java │ │ │ │ └── security │ │ │ │ ├── config │ │ │ │ ├── DunwuSecurityConfiguration.java │ │ │ │ ├── DunwuSecurityProperties.java │ │ │ │ └── UserDetailsManagerImpl.java │ │ │ │ ├── controller │ │ │ │ ├── CheckCodeController.java │ │ │ │ ├── IndexController.java │ │ │ │ └── LoginController.java │ │ │ │ ├── domain │ │ │ │ └── User.java │ │ │ │ ├── filter │ │ │ │ ├── DunwuSecurityException.java │ │ │ │ └── ValidateCodeFilter.java │ │ │ │ ├── handler │ │ │ │ ├── DunwuAuthenticationFailureHandler.java │ │ │ │ └── DunwuAuthenticationSucessHandler.java │ │ │ │ ├── mapper │ │ │ │ └── UserMapper.java │ │ │ │ └── util │ │ │ │ ├── CheckCodeUtils.java │ │ │ │ └── ImageUtil.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ ├── sql │ │ │ ├── data.sql │ │ │ └── schema.sql │ │ │ └── static │ │ │ ├── auth │ │ │ ├── forgot.html │ │ │ ├── login.html │ │ │ ├── register.html │ │ │ └── reset.html │ │ │ ├── css │ │ │ ├── index.css │ │ │ └── theme.css │ │ │ └── index.html │ ├── spring-boot-security-ldap │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── SpringBootLdapAuthApplication.java │ │ │ │ └── security │ │ │ │ ├── config │ │ │ │ └── SecurityConfiguration.java │ │ │ │ ├── controller │ │ │ │ ├── IndexController.java │ │ │ │ └── UnAuthorizedController.java │ │ │ │ ├── handler │ │ │ │ ├── CustomAuthenticationFailureHandler.java │ │ │ │ └── CustomAuthenticationSuccessHandler.java │ │ │ │ └── service │ │ │ │ ├── LdapUtil.java │ │ │ │ └── MyLdapUserDetailsMapper.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ └── static │ │ │ ├── auth │ │ │ ├── forgot.html │ │ │ ├── login.html │ │ │ ├── register.html │ │ │ └── reset.html │ │ │ ├── css │ │ │ ├── index.css │ │ │ └── theme.css │ │ │ └── index.html │ ├── spring-boot-security-session │ │ ├── README.md │ │ ├── pom.xml │ │ ├── scripts │ │ │ ├── start.sh │ │ │ └── stop.sh │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── SpringBootWebSessionApplication.java │ │ │ │ └── security │ │ │ │ ├── config │ │ │ │ ├── DunwuSecurityConfig.java │ │ │ │ ├── DunwuSecurityProperties.java │ │ │ │ └── UserDetailsManagerImpl.java │ │ │ │ ├── controller │ │ │ │ ├── CheckCodeController.java │ │ │ │ ├── IndexController.java │ │ │ │ └── LoginController.java │ │ │ │ ├── domain │ │ │ │ └── User.java │ │ │ │ ├── filter │ │ │ │ ├── DunwuSecurityException.java │ │ │ │ └── ValidateCodeFilter.java │ │ │ │ ├── handler │ │ │ │ ├── DunwuAuthenticationFailureHandler.java │ │ │ │ └── DunwuAuthenticationSucessHandler.java │ │ │ │ ├── mapper │ │ │ │ └── UserMapper.java │ │ │ │ └── util │ │ │ │ ├── CheckCodeUtils.java │ │ │ │ └── ImageUtil.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ ├── sql │ │ │ ├── data.sql │ │ │ └── schema.sql │ │ │ └── static │ │ │ ├── auth │ │ │ ├── forgot.html │ │ │ ├── login.html │ │ │ ├── register.html │ │ │ └── reset.html │ │ │ ├── css │ │ │ ├── index.css │ │ │ └── theme.css │ │ │ └── index.html │ └── spring-boot-security-shiro │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── security │ │ │ │ ├── ShiroApplication.java │ │ │ │ ├── config │ │ │ │ ├── ShiroConfiguration.java │ │ │ │ └── ShiroProperties.java │ │ │ │ └── system │ │ │ │ ├── controller │ │ │ │ ├── DeptController.java │ │ │ │ ├── LoginController.java │ │ │ │ ├── MenuController.java │ │ │ │ ├── RoleController.java │ │ │ │ ├── UserController.java │ │ │ │ └── ViewController.java │ │ │ │ ├── entity │ │ │ │ ├── Dept.java │ │ │ │ ├── Menu.java │ │ │ │ ├── Role.java │ │ │ │ ├── RoleMenu.java │ │ │ │ ├── Test.java │ │ │ │ ├── User.java │ │ │ │ └── UserRole.java │ │ │ │ ├── mapper │ │ │ │ ├── DeptMapper.java │ │ │ │ ├── MenuMapper.java │ │ │ │ ├── RoleMapper.java │ │ │ │ ├── RoleMenuMapper.java │ │ │ │ ├── UserMapper.java │ │ │ │ └── UserRoleMapper.java │ │ │ │ └── service │ │ │ │ ├── IDeptService.java │ │ │ │ ├── IMenuService.java │ │ │ │ ├── IRoleMenuService.java │ │ │ │ ├── IRoleService.java │ │ │ │ ├── IUserRoleService.java │ │ │ │ ├── IUserService.java │ │ │ │ └── impl │ │ │ │ ├── DeptServiceImpl.java │ │ │ │ ├── MenuServiceImpl.java │ │ │ │ ├── RoleMenuServiceImpl.java │ │ │ │ ├── RoleServiceImpl.java │ │ │ │ ├── UserRoleServiceImpl.java │ │ │ │ └── UserServiceImpl.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── db │ │ │ └── schema.sql │ │ │ └── mapper │ │ │ └── system │ │ │ ├── LoginLogMapper.xml │ │ │ ├── MenuMapper.xml │ │ │ ├── RoleMapper.xml │ │ │ └── UserMapper.xml │ │ └── test │ │ └── java │ │ └── io │ │ └── github │ │ └── dunwu │ │ └── springboot │ │ └── security │ │ ├── BaseShiroTest.java │ │ └── MyShiroRealmTest.java ├── template │ ├── spring-boot-tmpl-freemark │ │ ├── pom.xml │ │ ├── sql │ │ │ └── init.sql │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── FreemarkHelper.java │ │ │ │ │ ├── SpringBootTmplFreemarkApplication.java │ │ │ │ │ ├── data │ │ │ │ │ ├── User.java │ │ │ │ │ ├── UserDAO.java │ │ │ │ │ └── UserDAOImpl.java │ │ │ │ │ └── web │ │ │ │ │ ├── FreemarkController.java │ │ │ │ │ ├── IndexController.java │ │ │ │ │ └── SqlFreemarkController.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ ├── static │ │ │ │ └── css │ │ │ │ │ └── bootstrap.min.css │ │ │ │ └── templates │ │ │ │ ├── spring │ │ │ │ ├── exception.ftl │ │ │ │ └── index.ftl │ │ │ │ ├── sql │ │ │ │ ├── create_table.ftl │ │ │ │ ├── drop_table.ftl │ │ │ │ ├── sql_clear.ftl │ │ │ │ ├── sql_create.ftl │ │ │ │ ├── sql_delete.ftl │ │ │ │ └── sql_select.ftl │ │ │ │ └── web │ │ │ │ ├── exception.ftl │ │ │ │ └── index.ftl │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── SpringBootTmplFreemarkApplicationTests.java │ ├── spring-boot-tmpl-jsp │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── SpringBootWebJspApplication.java │ │ │ │ └── web │ │ │ │ ├── FailController.java │ │ │ │ ├── IndexController.java │ │ │ │ ├── MessageAdvice.java │ │ │ │ ├── MyException.java │ │ │ │ └── MyRestResponse.java │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ └── static │ │ │ │ └── test.txt │ │ │ └── webapp │ │ │ └── WEB-INF │ │ │ └── jsp │ │ │ ├── error.jsp │ │ │ └── index.jsp │ ├── spring-boot-tmpl-thymeleaf │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── SpringBootTmplThymeleafApplication.java │ │ │ │ │ ├── dto │ │ │ │ │ ├── ErrorDTO.java │ │ │ │ │ └── StudentDTO.java │ │ │ │ │ ├── exception │ │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ │ └── MyException.java │ │ │ │ │ └── web │ │ │ │ │ └── IndexController.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── logback.xml │ │ │ │ └── templates │ │ │ │ ├── error.html │ │ │ │ └── index.html │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── SpringBootTmplThymeleafApplicationTests.java │ └── spring-boot-tmpl-velocity │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── VelocitySampleBootstrap.java │ │ │ ├── controller │ │ │ ├── BaseController.java │ │ │ ├── IndexController.java │ │ │ └── VelocityLayoutController.java │ │ │ ├── mail │ │ │ ├── MailDTO.java │ │ │ ├── MailProperties.java │ │ │ └── MailService.java │ │ │ ├── tools │ │ │ └── EchoTool.java │ │ │ ├── tools2 │ │ │ └── Echo2Tool.java │ │ │ └── util │ │ │ └── VelocityUtil.java │ │ └── resources │ │ ├── application.properties │ │ ├── banner.txt │ │ ├── layout │ │ ├── default.vm │ │ ├── layout.vm │ │ └── layout2.vm │ │ ├── logback.xml │ │ ├── templates │ │ └── velocity │ │ │ └── default │ │ │ ├── footer.vm │ │ │ ├── header.vm │ │ │ ├── index.vm │ │ │ ├── mail.vm │ │ │ └── tools.vm │ │ ├── toolbox │ │ └── tools.xml │ │ └── velocity.properties └── web │ ├── pom.xml │ ├── spring-boot-web-fastjson │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── SpringBootWebFastjsonApplication.java │ │ │ ├── dto │ │ │ ├── BaseResponse.java │ │ │ ├── CodeEn.java │ │ │ ├── InfoDTO.java │ │ │ └── TypeException.java │ │ │ └── web │ │ │ ├── AppException.java │ │ │ ├── DateJsonConvert.java │ │ │ ├── JsonController.java │ │ │ └── WebMvcConfig.java │ │ └── test │ │ └── java │ │ └── io │ │ └── github │ │ └── dunwu │ │ └── springboot │ │ ├── DemoTest.java │ │ └── SpringBootWebFastjsonApplicationTests.java │ ├── spring-boot-web-form │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── Greeting.java │ │ │ │ ├── PersonForm.java │ │ │ │ ├── SpringBootWebFormApplication.java │ │ │ │ └── WebController.java │ │ └── resources │ │ │ ├── banner.txt │ │ │ └── logback.xml │ │ └── test │ │ └── java │ │ └── io │ │ └── github │ │ └── dunwu │ │ └── springboot │ │ └── SpringBootWebFormApplicationTests.java │ ├── spring-boot-web-helloworld │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── HelloController.java │ │ │ │ ├── SpringBootHelloWorldApplication.java │ │ │ │ └── config │ │ │ │ └── CustomConfig.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ └── logback.xml │ │ └── test │ │ └── java │ │ └── io │ │ └── github │ │ └── dunwu │ │ └── springboot │ │ └── SpringBootHelloWorldApplicationTest.java │ ├── spring-boot-web-https │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── CustomConfig.java │ │ │ ├── HelloController.java │ │ │ ├── SpringBootHttpsApplication.java │ │ │ ├── WeatherService.java │ │ │ └── bean │ │ │ ├── CityInfo.java │ │ │ ├── CoreWeatherInfo.java │ │ │ ├── Weather.java │ │ │ └── WeatherData.java │ │ └── resources │ │ ├── application.properties │ │ ├── banner.txt │ │ ├── keystore.p12 │ │ └── logback.xml │ ├── spring-boot-web-multi-connectors │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── HelloController.java │ │ │ │ └── SpringBootWebTwoConnectorsApplication.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ └── sample.jks │ │ └── test │ │ └── java │ │ └── io │ │ └── github │ │ └── dunwu │ │ └── springboot │ │ └── SpringBootWebTwoConnectorsApplicationTests.java │ ├── spring-boot-web-ui │ ├── pom.xml │ ├── spring-boot-web-ui-bootstrap │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── InMemoryMessageRepository.java │ │ │ │ │ ├── Message.java │ │ │ │ │ ├── MessageController.java │ │ │ │ │ ├── MessageRepository.java │ │ │ │ │ └── SpringBootWebUIBootstrapApplication.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── logback.xml │ │ │ │ ├── messages.properties │ │ │ │ ├── static │ │ │ │ ├── css │ │ │ │ │ └── bootstrap.min.css │ │ │ │ └── favicon.ico │ │ │ │ └── templates │ │ │ │ ├── fragments.html │ │ │ │ └── messages │ │ │ │ ├── form.html │ │ │ │ ├── list.html │ │ │ │ └── view.html │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── MessageControllerWebTests.java │ │ │ └── SampleWebUiApplicationTests.java │ ├── spring-boot-web-ui-easyui │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── IndexController.java │ │ │ │ ├── ResponseDTO.java │ │ │ │ ├── SpringBootWebUIEasyuiApplication.java │ │ │ │ ├── User.java │ │ │ │ ├── UserController.java │ │ │ │ └── UserRepository.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── static │ │ │ ├── json │ │ │ └── datagrid_data1.json │ │ │ ├── lib │ │ │ └── easyui │ │ │ │ ├── jquery.easyui.min.js │ │ │ │ ├── jquery.min.js │ │ │ │ ├── locale │ │ │ │ ├── easyui-lang-en.js │ │ │ │ ├── easyui-lang-zh_CN.js │ │ │ │ └── easyui-lang-zh_TW.js │ │ │ │ └── themes │ │ │ │ ├── bootstrap │ │ │ │ ├── accordion.css │ │ │ │ ├── calendar.css │ │ │ │ ├── checkbox.css │ │ │ │ ├── combo.css │ │ │ │ ├── combobox.css │ │ │ │ ├── datagrid.css │ │ │ │ ├── datalist.css │ │ │ │ ├── datebox.css │ │ │ │ ├── dialog.css │ │ │ │ ├── easyui.css │ │ │ │ ├── filebox.css │ │ │ │ ├── images │ │ │ │ │ ├── accordion_arrows.png │ │ │ │ │ ├── blank.gif │ │ │ │ │ ├── calendar_arrows.png │ │ │ │ │ ├── combo_arrow.png │ │ │ │ │ ├── datagrid_icons.png │ │ │ │ │ ├── datebox_arrow.png │ │ │ │ │ ├── layout_arrows.png │ │ │ │ │ ├── linkbutton_bg.png │ │ │ │ │ ├── loading.gif │ │ │ │ │ ├── menu_arrows.png │ │ │ │ │ ├── messager_icons.png │ │ │ │ │ ├── pagination_icons.png │ │ │ │ │ ├── panel_tools.png │ │ │ │ │ ├── passwordbox_close.png │ │ │ │ │ ├── passwordbox_open.png │ │ │ │ │ ├── searchbox_button.png │ │ │ │ │ ├── slider_handle.png │ │ │ │ │ ├── spinner_arrows.png │ │ │ │ │ ├── tabs_icons.png │ │ │ │ │ ├── tagbox_icons.png │ │ │ │ │ ├── tree_icons.png │ │ │ │ │ └── validatebox_warning.png │ │ │ │ ├── layout.css │ │ │ │ ├── linkbutton.css │ │ │ │ ├── menu.css │ │ │ │ ├── menubutton.css │ │ │ │ ├── messager.css │ │ │ │ ├── numberbox.css │ │ │ │ ├── pagination.css │ │ │ │ ├── panel.css │ │ │ │ ├── passwordbox.css │ │ │ │ ├── progressbar.css │ │ │ │ ├── propertygrid.css │ │ │ │ ├── radiobutton.css │ │ │ │ ├── searchbox.css │ │ │ │ ├── sidemenu.css │ │ │ │ ├── slider.css │ │ │ │ ├── spinner.css │ │ │ │ ├── splitbutton.css │ │ │ │ ├── switchbutton.css │ │ │ │ ├── tabs.css │ │ │ │ ├── tagbox.css │ │ │ │ ├── textbox.css │ │ │ │ ├── tooltip.css │ │ │ │ ├── tree.css │ │ │ │ ├── validatebox.css │ │ │ │ └── window.css │ │ │ │ ├── color.css │ │ │ │ ├── icon.css │ │ │ │ └── icons │ │ │ │ ├── back.png │ │ │ │ ├── blank.gif │ │ │ │ ├── cancel.png │ │ │ │ ├── clear.png │ │ │ │ ├── cut.png │ │ │ │ ├── edit_add.png │ │ │ │ ├── edit_remove.png │ │ │ │ ├── filesave.png │ │ │ │ ├── filter.png │ │ │ │ ├── help.png │ │ │ │ ├── large_chart.png │ │ │ │ ├── large_clipart.png │ │ │ │ ├── large_picture.png │ │ │ │ ├── large_shapes.png │ │ │ │ ├── large_smartart.png │ │ │ │ ├── lock.png │ │ │ │ ├── man.png │ │ │ │ ├── mini_add.png │ │ │ │ ├── mini_edit.png │ │ │ │ ├── mini_refresh.png │ │ │ │ ├── more.png │ │ │ │ ├── no.png │ │ │ │ ├── ok.png │ │ │ │ ├── pencil.png │ │ │ │ ├── print.png │ │ │ │ ├── redo.png │ │ │ │ ├── reload.png │ │ │ │ ├── search.png │ │ │ │ ├── sum.png │ │ │ │ ├── tip.png │ │ │ │ └── undo.png │ │ │ ├── plugin │ │ │ └── themes │ │ │ │ └── default │ │ │ │ └── numberbox.css │ │ │ └── views │ │ │ ├── index.html │ │ │ └── user.html │ └── spring-boot-web-ui-react │ │ ├── config │ │ └── nginx.conf │ │ ├── pom.xml │ │ ├── spring-boot-web-ui-react-backend │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── WebHelloworldApplication.java │ │ │ │ ├── config │ │ │ │ └── DunwuWebConfiguration.java │ │ │ │ └── web │ │ │ │ ├── controller │ │ │ │ ├── ApiController.java │ │ │ │ └── IndexController.java │ │ │ │ └── dto │ │ │ │ ├── BaseResponseDTO.java │ │ │ │ └── MenuDTO.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ └── spring-boot-web-ui-react-frontend │ │ ├── .babelrc │ │ ├── .editorconfig │ │ ├── .eslintrc │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── config │ │ ├── app.config.js │ │ ├── webpack.config.base.js │ │ ├── webpack.config.dev.js │ │ └── webpack.config.prod.js │ │ ├── package.json │ │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ │ ├── scripts │ │ └── build.sh │ │ └── src │ │ ├── common │ │ └── apiutils │ │ │ ├── ajaxCommon.js │ │ │ ├── apiCreator.js │ │ │ ├── errorUtils.js │ │ │ ├── fetchAJAX.js │ │ │ ├── index.js │ │ │ └── reqwestAJAX.js │ │ ├── components │ │ ├── index.js │ │ └── layout │ │ │ ├── Breadcrumb │ │ │ ├── Breadcrumb.jsx │ │ │ └── Breadcrumb.less │ │ │ ├── Content │ │ │ ├── Content.jsx │ │ │ └── Content.less │ │ │ ├── Footer │ │ │ ├── Footer.jsx │ │ │ └── index.less │ │ │ ├── Header │ │ │ ├── Header.jsx │ │ │ └── Header.less │ │ │ └── Sidebar │ │ │ ├── Sidebar.jsx │ │ │ ├── Sidebar.less │ │ │ └── antd.svg │ │ ├── containers │ │ ├── Core │ │ │ ├── CoreContainer.jsx │ │ │ ├── CoreContainer.less │ │ │ └── package.json │ │ └── Root │ │ │ ├── ReduxDevTools.jsx │ │ │ ├── RootContainer.dev.jsx │ │ │ ├── RootContainer.jsx │ │ │ └── RootContainer.prod.jsx │ │ ├── index.jsx │ │ ├── redux │ │ ├── actions │ │ │ ├── auth.js │ │ │ └── menu.js │ │ ├── constants │ │ │ ├── authActionType.js │ │ │ ├── commonActionTypes.js │ │ │ └── menuActionType.js │ │ ├── middlewares │ │ │ └── promiseMiddleware.js │ │ ├── reducers │ │ │ ├── auth.js │ │ │ ├── index.js │ │ │ └── menu.js │ │ └── store │ │ │ ├── configureStore.dev.js │ │ │ ├── configureStore.js │ │ │ └── configureStore.prod.js │ │ ├── routes │ │ └── index.jsx │ │ ├── utils │ │ ├── asyncLoadHOC.js │ │ ├── authHOC.jsx │ │ ├── http.js │ │ └── index.jsx │ │ ├── views │ │ └── pages │ │ │ ├── home │ │ │ ├── Home.jsx │ │ │ ├── Home.less │ │ │ └── logo.svg │ │ │ ├── login │ │ │ ├── Login.jsx │ │ │ ├── Login.less │ │ │ ├── bg.jpg │ │ │ └── login-logo.png │ │ │ ├── mail │ │ │ └── Mailbox.jsx │ │ │ └── user │ │ │ ├── User.jsx │ │ │ └── User.less │ │ └── webapi │ │ ├── mock │ │ ├── index.js │ │ ├── menu.js │ │ └── user.js │ │ ├── package.json │ │ └── webapi.js │ ├── spring-boot-web-uploading │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── FileUploadController.java │ │ │ │ ├── SpringBootWebUploadingApplication.java │ │ │ │ └── storage │ │ │ │ ├── FileSystemStorageServiceImpl.java │ │ │ │ ├── StorageException.java │ │ │ │ ├── StorageFileNotFoundException.java │ │ │ │ ├── StorageProperties.java │ │ │ │ └── StorageService.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── logback.xml │ │ │ └── templates │ │ │ └── uploadForm.html │ │ └── test │ │ ├── java │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── FileUploadIntegrationTests.java │ │ │ ├── FileUploadTests.java │ │ │ └── storage │ │ │ └── FileSystemStorageServiceImplTests.java │ │ └── resources │ │ └── io │ │ └── github │ │ └── dunwu │ │ └── springboot │ │ └── testupload.txt │ └── spring-boot-web-websocket │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── SpringBootWebSocketApplication.java │ │ │ ├── client │ │ │ ├── GreetingService.java │ │ │ ├── SimpleClientWebSocketHandler.java │ │ │ └── SimpleGreetingService.java │ │ │ ├── echo │ │ │ ├── DefaultEchoService.java │ │ │ ├── EchoService.java │ │ │ └── EchoWebSocketHandler.java │ │ │ ├── reverse │ │ │ └── ReverseWebSocketEndpoint.java │ │ │ └── snake │ │ │ ├── Direction.java │ │ │ ├── Location.java │ │ │ ├── Snake.java │ │ │ ├── SnakeTimer.java │ │ │ ├── SnakeUtils.java │ │ │ └── SnakeWebSocketHandler.java │ └── resources │ │ ├── banner.txt │ │ ├── logback.xml │ │ └── static │ │ ├── echo.html │ │ ├── index.html │ │ ├── reverse.html │ │ └── snake.html │ └── test │ └── java │ └── io │ └── github │ └── dunwu │ └── springboot │ ├── SpringBootWebSocketApplicationTests.java │ ├── echo │ └── CustomContainerWebSocketsApplicationTests.java │ └── snake │ └── SnakeTimerTests.java ├── docs ├── .vuepress │ ├── config.js │ ├── config │ │ ├── baiduCode.js │ │ └── htmlModules.js │ ├── enhanceApp.js │ ├── plugins │ │ └── love-me │ │ │ ├── index.js │ │ │ └── love-me.js │ ├── public │ │ ├── favicon.ico │ │ ├── img │ │ │ ├── bg.gif │ │ │ ├── dunwu-logo.png │ │ │ ├── favicon.ico │ │ │ ├── more.png │ │ │ └── other.png │ │ └── markmap │ │ │ └── 01.html │ └── styles │ │ ├── index.styl │ │ └── palette.styl ├── 10.Java │ └── 13.框架 │ │ └── 02.SpringBoot │ │ ├── 00.SpringBoot综合 │ │ ├── 01.SpringBoot知识图谱.md │ │ └── 02.SpringBoot基本原理.md │ │ ├── 01.SpringBoot基础 │ │ ├── 01.SpringBoot之快速入门.md │ │ ├── 02.SpringBoot之属性加载.md │ │ └── 03.SpringBoot之Profile.md │ │ ├── 02.SpringBootWeb │ │ └── 01.SpringBoot之应用EasyUI.md │ │ ├── 03.SpringBoot数据 │ │ ├── 01.SpringBoot之JDBC.md │ │ ├── 11.SpringBoot之Mybatis.md │ │ ├── 22.SpringBoot之Elasticsearch.md │ │ └── 23.SpringBoot之MongoDB.md │ │ ├── 04.SpringBootIO │ │ ├── 01.SpringBoot之异步请求.md │ │ ├── 02.SpringBoot之Json.md │ │ └── 03.SpringBoot之邮件.md │ │ ├── 10.SpringBoot安全 │ │ └── 01.SpringBoot之安全快速入门.md │ │ └── 99.SpringBoot其他 │ │ └── 01.SpringBoot之banner定制.md ├── @pages │ ├── archivesPage.md │ ├── categoriesPage.md │ └── tagsPage.md └── README.md ├── package.json ├── pom.xml ├── prettier.config.js ├── scripts ├── build.sh ├── deploy.sh └── version.sh └── utils ├── config.yml ├── editFrontmatter.js └── modules ├── fn.js └── readFileList.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "compact": false 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig 用于在 IDE 中检查代码的基本 Code Style 2 | # @see: https://editorconfig.org/ 3 | 4 | # 配置说明: 5 | # 所有文件换行使用 Unix 风格(LF),*.bat 文件使用 Windows 风格(CRLF) 6 | # java / sh 文件缩进 4 个空格,其他所有文件缩进 2 个空格 7 | 8 | root = true 9 | 10 | [*] 11 | end_of_line = lf 12 | indent_size = 2 13 | indent_style = space 14 | max_line_length = 120 15 | charset = utf-8 16 | trim_trailing_whitespace = true 17 | insert_final_newline = true 18 | 19 | [*.{bat, cmd}] 20 | end_of_line = crlf 21 | 22 | [*.{java, gradle, groovy, kt, sh, xml}] 23 | indent_size = 4 24 | 25 | [*.md] 26 | max_line_length = 0 27 | trim_trailing_whitespace = false 28 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - openjdk8 4 | 5 | sudo: required 6 | 7 | script: bash ./scripts/build.sh package 8 | 9 | branches: 10 | only: 11 | - master 12 | 13 | notifications: 14 | email: 15 | recipients: 16 | - forbreak@163.com 17 | on_success: change # default: change 18 | on_failure: always # default: always 19 | -------------------------------------------------------------------------------- /assets/spring-boot-reference.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/assets/spring-boot-reference.pdf -------------------------------------------------------------------------------- /codes/core/spring-boot-actuator/README.md: -------------------------------------------------------------------------------- 1 | # Spring Boot + 2 | -------------------------------------------------------------------------------- /codes/core/spring-boot-actuator/src/main/java/io/github/dunwu/springboot/SpringBootActuatorApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootActuatorApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootActuatorApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/core/spring-boot-actuator/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | spring.security.user.name = root 3 | spring.security.user.password = root 4 | # 端点信息接口使用的端口,为了和主系统接口使用的端口进行分离 5 | management.server.port = 18080 6 | management.health.diskspace.enabled = true 7 | # 端点健康情况,默认值"never",设置为"always"可以显示硬盘使用情况和线程情况 8 | management.endpoint.health.show-details = always 9 | # 设置端点暴露的哪些内容,默认["health","info"],设置"*"代表暴露所有可访问的端点 10 | management.endpoints.web.exposure.include = * 11 | -------------------------------------------------------------------------------- /codes/core/spring-boot-aop/src/main/java/io/github/dunwu/springboot/aop/MethodLog.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.aop; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 日志注解 10 | *

11 | * {@link MethodLogAspect} 是 {@link MethodLog} 注解的处理器 12 | *

13 | * 被标记的方法被调用时,会将调用信息写入 DB 14 | * @author Zhang Peng 15 | * @since 2020-04-09 16 | */ 17 | @Target(ElementType.METHOD) 18 | @Retention(RetentionPolicy.RUNTIME) 19 | public @interface MethodLog { 20 | 21 | String value() default ""; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /codes/core/spring-boot-aop/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | author.name = Zhang Peng 2 | throw.exception = false 3 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_boot_tutorial?serverTimezone=UTC 4 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 5 | spring.datasource.username = root 6 | spring.datasource.password = root 7 | # 强制每次启动使用 sql 初始化数据,本项目仅为了演示方便,真实环境应避免这种模式 8 | spring.datasource.initialization-mode = ALWAYS 9 | spring.datasource.schema = classpath:sql/schema.sql 10 | -------------------------------------------------------------------------------- /codes/core/spring-boot-aop/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/core/spring-boot-aop/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/spring-boot-async/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.file = spring-boot-asyn.log 2 | logging.pattern.dateformat = yyyy-MM-dd HH:mm:ss 3 | 4 | -------------------------------------------------------------------------------- /codes/core/spring-boot-async/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/core/spring-boot-async/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/spring-boot-banner/src/main/java/io/github/dunwu/springboot/SpringBootBannerApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootBannerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootBannerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/core/spring-boot-banner/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/core/spring-boot-bean/src/main/java/io/github/dunwu/springboot/bean/Company.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.bean; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Lombok 示例 9 | * 10 | * @author Zhang Peng 11 | * @see http://jnb.ociweb.com/jnb/jnbJan2010.html 12 | */ 13 | @Data(staticConstructor = "of") 14 | public class Company { 15 | 16 | private final Person founder; 17 | 18 | protected List employees; 19 | 20 | private String name; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /codes/core/spring-boot-bean/src/main/java/io/github/dunwu/springboot/bean/InfoDTO.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.bean; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | @Data 7 | @ToString 8 | public class InfoDTO { 9 | 10 | private String content; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /codes/core/spring-boot-bean/src/main/java/io/github/dunwu/springboot/bean/Person.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.bean; 2 | 3 | import lombok.*; 4 | 5 | /** 6 | * Lombok 示例 7 | * 8 | * @author Zhang Peng 9 | * @see http://jnb.ociweb.com/jnb/jnbJan2010.html 10 | */ 11 | @Data 12 | @ToString(exclude = "age") 13 | @NoArgsConstructor 14 | @AllArgsConstructor 15 | @EqualsAndHashCode(exclude = { "age", "sex" }) 16 | public class Person { 17 | 18 | private String name; 19 | 20 | private Integer age; 21 | 22 | private String sex; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/core/spring-boot-bean/src/main/java/io/github/dunwu/springboot/bean/UserDO.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import lombok.ToString; 7 | 8 | /** 9 | * @author Zhang Peng 10 | * @since 2018-11-02 11 | */ 12 | @Data 13 | @ToString 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | public class UserDO { 17 | 18 | private Long id; 19 | 20 | private String name; 21 | 22 | private String info; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/core/spring-boot-bean/src/main/java/io/github/dunwu/springboot/bean/UserDTO.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.bean; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | /** 7 | * @author Zhang Peng 8 | * @since 2018-11-02 9 | */ 10 | @Data 11 | @ToString 12 | public class UserDTO { 13 | 14 | private long id; 15 | 16 | private String name; 17 | 18 | private InfoDTO infoDTO; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /codes/core/spring-boot-bean/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/core/spring-boot-bean/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/spring-boot-profile/src/main/java/io/github/dunwu/springboot/service/MessageService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.service; 2 | 3 | public interface MessageService { 4 | 5 | String getMessage(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/core/spring-boot-profile/src/main/java/io/github/dunwu/springboot/service/impl/TestMessageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.service.impl; 2 | 3 | import io.github.dunwu.springboot.service.MessageService; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Profile; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | @Profile("test") 10 | public class TestMessageServiceImpl implements MessageService { 11 | 12 | @Value("${dunwu.message:Test Begin!}") 13 | private String message; 14 | 15 | @Override 16 | public String getMessage() { 17 | return this.message; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /codes/core/spring-boot-profile/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | dunwu.message = The app is running on profile dev. 2 | -------------------------------------------------------------------------------- /codes/core/spring-boot-profile/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | dunwu.message = The app is running on profile prod. 2 | -------------------------------------------------------------------------------- /codes/core/spring-boot-profile/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | dunwu.message = The app is running on profile test. 2 | -------------------------------------------------------------------------------- /codes/core/spring-boot-profile/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 指定不同的 profile,启动 Application 后会打印不同的信息 2 | #spring.profiles.active = dev 3 | #spring.profiles.active = test 4 | spring.profiles.active = prod 5 | -------------------------------------------------------------------------------- /codes/core/spring-boot-profile/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/core/spring-boot-profile/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/spring-boot-property/src/main/java/io/github/dunwu/springboot/config/GenderEnum.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.config; 2 | 3 | public enum GenderEnum { 4 | 5 | MALE(0, "男"), 6 | FEMALE(1, "女"); 7 | 8 | /** 9 | * 标记数据库存的值是code 10 | */ 11 | private final int key; 12 | 13 | private final String value; 14 | 15 | GenderEnum(int key, String value) { 16 | this.key = key; 17 | this.value = value; 18 | } 19 | 20 | public int getKey() { 21 | return this.key; 22 | } 23 | 24 | public String getValue() { 25 | return this.value; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /codes/core/spring-boot-property/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active = prop 2 | #spring.profiles.active = yaml 3 | -------------------------------------------------------------------------------- /codes/core/spring-boot-property/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/core/spring-boot-property/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/spring-boot-property/src/main/resources/prop/custom.properties: -------------------------------------------------------------------------------- 1 | custom.topic1 = Java 2 | custom.topic2 = [${custom.topic1}] Spring Boot 3 | -------------------------------------------------------------------------------- /codes/core/spring-boot-property/src/main/resources/prop/random.properties: -------------------------------------------------------------------------------- 1 | # 随机属性 2 | # @see @see org.springframework.boot.env.RandomValuePropertySource 3 | # 属性 key 可以使用 '-' '_' 分隔,或驼峰命名、全部大写 4 | dunwu.random.secret = ${random.value} 5 | dunwu.random.number = ${random.int} 6 | dunwu.random.bigNumber = ${random.long} 7 | dunwu.random.uuid = ${random.uuid} 8 | dunwu.random.less-than-ten-num = ${random.int(10)} 9 | dunwu.random.in_range-num = ${random.int[1024,65536]} 10 | -------------------------------------------------------------------------------- /codes/core/spring-boot-property/src/main/resources/prop/validator.properties: -------------------------------------------------------------------------------- 1 | validator.host = 127.0.0.1 2 | validator.port = 8080 3 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache-j2cache/src/main/java/io/github/dunwu/springboot/data/SpringBootDataCacheJ2cacheApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * 启动类 8 | * @author Zhang Peng 9 | * @since 2019-10-14 10 | */ 11 | @SpringBootApplication 12 | public class SpringBootDataCacheJ2cacheApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(SpringBootDataCacheJ2cacheApplication.class, args); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache-j2cache/src/main/resources/META-INF/spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": [ 3 | { 4 | "name": "j2cache.config-location", 5 | "type": "java.lang.String" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache-j2cache/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration = \ 2 | io.github.dunwu.springboot.data.config.J2CacheAutoConfiguration,\ 3 | io.github.dunwu.springboot.data.config.J2CacheSpringCacheAutoConfiguration,\ 4 | io.github.dunwu.springboot.data.config.J2CacheSpringRedisAutoConfiguration 5 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache-j2cache/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | j2cache.config-location = j2cache.properties 2 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache-j2cache/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache-j2cache/src/test/java/io/github/dunwu/springboot/bean/TestBean.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | public class TestBean implements Serializable { 6 | 7 | private static final long serialVersionUID = 1L; 8 | 9 | private Integer num; 10 | 11 | public Integer getNum() { 12 | return num; 13 | } 14 | 15 | public void setNum(Integer num) { 16 | this.num = num; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache-j2cache/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | j2cache.config-location = j2cache-test.properties 2 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache-jetcache/src/main/java/io/github/dunwu/springboot/data/config/CacheAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.config; 2 | 3 | import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation; 4 | import com.alicp.jetcache.anno.config.EnableMethodCache; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * @author Zhang Peng 9 | * @since 2019-10-14 10 | */ 11 | @Configuration 12 | @EnableCreateCacheAnnotation 13 | @EnableMethodCache(basePackages = "io.github.dunwu.springboot.data.mapper") 14 | public class CacheAutoConfiguration { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache-jetcache/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache-jetcache/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO user (name, age, address, email) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-cache/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO user (name, age, address, email) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-druid/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_boot_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8 2 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | # 强制每次启动使用 sql 初始化数据,本项目仅为了演示方便,真实环境应避免这种模式 6 | spring.datasource.initialization-mode = ALWAYS 7 | spring.datasource.schema = classpath:sql/schema.sql 8 | spring.datasource.data = classpath:sql/data.sql 9 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-druid/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-druid/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-druid/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO user (name, age, address, email) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/java/io/github/dunwu/springboot/data/constant/QueryJudgeType.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.constant; 2 | 3 | /** 4 | * @author Zhang Peng 5 | * @since 2019-12-17 6 | */ 7 | public enum QueryJudgeType { 8 | Equals, 9 | NotEquals, 10 | Like, 11 | NotLike, 12 | In, 13 | NotIn, 14 | IsNull, 15 | IsNotNull, 16 | } 17 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/java/io/github/dunwu/springboot/data/constant/QueryLogicType.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.constant; 2 | 3 | /** 4 | * @author Zhang Peng 5 | * @since 2019-12-17 6 | */ 7 | public enum QueryLogicType { 8 | AND, 9 | OR, 10 | NOT 11 | } 12 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/java/io/github/dunwu/springboot/data/entities/Author.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | @Data 7 | @ToString 8 | public class Author { 9 | 10 | private String id; 11 | 12 | private String name; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/java/io/github/dunwu/springboot/data/entities/Car.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | @Data 7 | @ToString 8 | public class Car { 9 | 10 | private String name; 11 | 12 | private String model; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/java/io/github/dunwu/springboot/data/entities/GirlFriend.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | import org.springframework.data.elasticsearch.annotations.Field; 6 | import org.springframework.data.elasticsearch.annotations.FieldType; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @ToString 12 | public class GirlFriend { 13 | 14 | private String name; 15 | 16 | private String type; 17 | 18 | @Field(type = FieldType.Nested) 19 | private List cars; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/java/io/github/dunwu/springboot/data/entities/Sector.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import lombok.ToString; 7 | 8 | @Data 9 | @ToString 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | public class Sector { 13 | 14 | private int id; 15 | 16 | private String sectorName; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/java/io/github/dunwu/springboot/data/repositories/ArticleRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.repositories; 2 | 3 | import io.github.dunwu.springboot.data.entities.Article; 4 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 5 | 6 | public interface ArticleRepository extends ElasticsearchRepository { 7 | } 8 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/java/io/github/dunwu/springboot/data/repositories/OperationRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.repositories; 2 | 3 | import io.github.dunwu.springboot.data.entities.Operation; 4 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 5 | 6 | public interface OperationRepository extends ElasticsearchRepository { 7 | } 8 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/java/io/github/dunwu/springboot/data/repositories/ProductRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.repositories; 2 | 3 | import io.github.dunwu.springboot.data.entities.Product; 4 | import org.springframework.data.domain.Pageable; 5 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 6 | 7 | import java.util.List; 8 | 9 | public interface ProductRepository extends ElasticsearchRepository { 10 | 11 | List findByName(String name); 12 | 13 | List findByName(String name, Pageable pageable); 14 | 15 | List findByNameAndId(String name, String id); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/java/io/github/dunwu/springboot/data/repositories/UserRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.repositories; 2 | 3 | import io.github.dunwu.springboot.data.entities.User; 4 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 5 | 6 | import java.util.List; 7 | 8 | public interface UserRepository extends ElasticsearchRepository { 9 | 10 | List findByUserName(String UserName); 11 | 12 | User findByEmail(String email); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.data.jest.uri = http://127.0.0.1:9200 2 | spring.data.elasticsearch.properties.path.home = target/elastic 3 | spring.data.elasticsearch.properties.transport.tcp.connect_timeout = 120s 4 | elasticsearch.clusterNodes = 127.0.0.1:9200 5 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch-jest/src/test/java/io/github/dunwu/springboot/data/entities/Role.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | @Data 7 | @ToString 8 | public class Role { 9 | 10 | private String name; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/annotation/QueryField.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.annotation; 2 | 3 | import io.github.dunwu.springboot.data.constant.QueryJudgeType; 4 | 5 | import java.lang.annotation.*; 6 | 7 | /** 8 | * @author Zhang Peng 9 | * @since 2019-12-17 10 | */ 11 | @Documented 12 | @Inherited 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Target(ElementType.FIELD) 15 | public @interface QueryField { 16 | 17 | String value() default ""; 18 | 19 | QueryJudgeType judgeType() default QueryJudgeType.Equals; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/constant/QueryJudgeType.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.constant; 2 | 3 | /** 4 | * @author Zhang Peng 5 | * @since 2019-12-17 6 | */ 7 | public enum QueryJudgeType { 8 | Equals, 9 | NotEquals, 10 | Like, 11 | NotLike, 12 | In, 13 | NotIn, 14 | IsNull, 15 | IsNotNull, 16 | } 17 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/constant/QueryLogicType.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.constant; 2 | 3 | /** 4 | * @author Zhang Peng 5 | * @since 2019-12-17 6 | */ 7 | public enum QueryLogicType { 8 | AND, 9 | OR, 10 | NOT 11 | } 12 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/entities/Author.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | @Data 7 | @ToString 8 | public class Author { 9 | 10 | private String id; 11 | 12 | private String name; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/entities/Car.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | @Data 7 | @ToString 8 | public class Car { 9 | 10 | private String name; 11 | 12 | private String model; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/entities/GirlFriend.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | import org.springframework.data.elasticsearch.annotations.Field; 6 | import org.springframework.data.elasticsearch.annotations.FieldType; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @ToString 12 | public class GirlFriend { 13 | 14 | private String name; 15 | 16 | private String type; 17 | 18 | @Field(type = FieldType.Nested) 19 | private List cars; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/entities/Sector.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import lombok.ToString; 7 | 8 | @Data 9 | @ToString 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | public class Sector { 13 | 14 | private int id; 15 | 16 | private String sectorName; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/repositories/ArticleRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.repositories; 2 | 3 | import io.github.dunwu.springboot.data.entities.Article; 4 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 5 | 6 | public interface ArticleRepository extends ElasticsearchRepository { 7 | } 8 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/repositories/OperationRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.repositories; 2 | 3 | import io.github.dunwu.springboot.data.entities.Operation; 4 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 5 | 6 | public interface OperationRepository extends ElasticsearchRepository { 7 | } 8 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/repositories/ProductRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.repositories; 2 | 3 | import io.github.dunwu.springboot.data.entities.Product; 4 | import org.springframework.data.domain.Pageable; 5 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 6 | 7 | import java.util.List; 8 | 9 | public interface ProductRepository extends ElasticsearchRepository { 10 | 11 | List findByName(String name); 12 | 13 | List findByName(String name, Pageable pageable); 14 | 15 | List findByNameAndId(String name, String id); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/java/io/github/dunwu/springboot/data/repositories/UserRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.repositories; 2 | 3 | import io.github.dunwu.springboot.data.entities.User; 4 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 5 | 6 | import java.util.List; 7 | 8 | public interface UserRepository extends ElasticsearchRepository { 9 | 10 | List findByUsername(String username); 11 | 12 | User findByEmail(String email); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/test/java/io/github/dunwu/springboot/data/entities/Manuscript.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | import org.springframework.data.elasticsearch.annotations.Field; 6 | import org.springframework.data.elasticsearch.annotations.FieldType; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @ToString 12 | public class Manuscript { 13 | 14 | private String title; 15 | 16 | private String abstractText; 17 | 18 | @Field(type = FieldType.Text, index = false) 19 | private String status; 20 | 21 | @Field(type = FieldType.Nested) 22 | private List role; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-elasticsearch/src/test/java/io/github/dunwu/springboot/data/entities/Role.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.entities; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | @Data 7 | @ToString 8 | public class Role { 9 | 10 | private String name; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-flyway/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_boot_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false 2 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | # 启用或禁用 flyway 6 | spring.flyway.enabled = true 7 | # 设置 SQL 脚本的目录,多个路径使用逗号分隔, 比如取值为 classpath:db/migration,filesystem:/sql-migrations 8 | spring.flyway.locations = classpath:sql 9 | # 开发环境最好开启 outOfOrder, 生产环境关闭 outOfOrder 10 | spring.flyway.outOfOrder = true 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-flyway/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-flyway/src/main/resources/sql/V2__Add_user.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO user (name, age, address, email) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-hdfs/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 必须使用绝对路径 2 | dunwu.tdh.config = D:/hdfs-config 3 | # ---------------------------------------------------------------- DATA - HDFS 4 | dunwu.data.hdfs.enabled = true 5 | dunwu.data.hdfs.coreSiteXmlPath = ${dunwu.tdh.config}/core-site.xml 6 | dunwu.data.hdfs.hdfsSiteXmlPath = ${dunwu.tdh.config}/hdfs-site.xml 7 | dunwu.data.hdfs.auth.enabled = true 8 | dunwu.data.hdfs.auth.principal = dunwu@TDH 9 | dunwu.data.hdfs.auth.krb5Conf = ${dunwu.tdh.config}/krb5.conf 10 | dunwu.data.hdfs.auth.authKeyTabPath = ${dunwu.tdh.config}/dunwu.keytab 11 | dunwu.data.hdfs.auth.authLoginConfig = ${dunwu.tdh.config}/jaas.conf 12 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jdbc-multi-datasource/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # datasource01 2 | spring.datasource.mysql.jdbc-url = jdbc:mysql://localhost:3306/spring_boot_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false 3 | spring.datasource.mysql.driver-class-name = com.mysql.cj.jdbc.Driver 4 | spring.datasource.mysql.username = root 5 | spring.datasource.mysql.password = root 6 | # datasource02 7 | spring.datasource.h2.jdbc-url = jdbc:h2:mem:test 8 | spring.datasource.h2.driver-class-name = org.h2.Driver 9 | spring.datasource.h2.username = sa 10 | spring.datasource.h2.password = 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jdbc-multi-datasource/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jdbc-multi-datasource/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO user (name, age, address, email) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jdbc/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_boot_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8 2 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | # 强制每次启动使用 sql 初始化数据,本项目仅为了演示方便,真实环境应避免这种模式 6 | spring.datasource.initialization-mode = ALWAYS 7 | spring.datasource.schema = classpath:sql/schema.sql 8 | spring.datasource.data = classpath:sql/data.sql 9 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jdbc/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jdbc/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jdbc/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO user (name, age, address, email) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jpa/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_boot_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false 3 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 4 | spring.datasource.username = root 5 | spring.datasource.password = root 6 | # 强制每次启动使用 sql 初始化数据,本项目仅为了演示方便,真实环境应避免这种模式 7 | spring.datasource.initialization-mode = ALWAYS 8 | spring.datasource.schema = classpath:sql/schema.sql 9 | spring.datasource.data = classpath:sql/data.sql 10 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jpa/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jpa/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jpa/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的 DML 脚本 3 | -- ------------------------------------------- 4 | 5 | INSERT INTO user (name, age, address, email) 6 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 9 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jpa/src/main/resources/sql/schema.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的 DDL 脚本 3 | -- ------------------------------------------- 4 | 5 | -- 创建数据表 user 6 | CREATE TABLE IF NOT EXISTS user ( 7 | id BIGINT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', 8 | name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '用户名', 9 | age TINYINT(3) NOT NULL DEFAULT 0 COMMENT '年龄', 10 | address VARCHAR(255) NOT NULL DEFAULT '' COMMENT '地址', 11 | email VARCHAR(255) NOT NULL DEFAULT '' COMMENT '邮件', 12 | PRIMARY KEY (id) 13 | ) COMMENT = '用户表'; 14 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jpa/src/test/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:h2:mem:test 2 | spring.datasource.driver-class-name = org.h2.Driver 3 | spring.datasource.username = sa 4 | spring.datasource.password = 5 | spring.datasource.schema = classpath:sql/schema-h2.sql 6 | spring.datasource.data = classpath:sql/data-h2.sql 7 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-jpa/src/test/resources/sql/data-h2.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- H2 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/h2 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO user (name, age, address, email) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mongodb/src/main/java/io/github/dunwu/springboot/mongodb/CustomerRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.mongodb; 2 | 3 | import org.springframework.data.mongodb.repository.MongoRepository; 4 | 5 | import java.util.List; 6 | 7 | public interface CustomerRepository extends MongoRepository { 8 | 9 | Person findByFirstName(String firstName); 10 | 11 | List findByLastName(String lastName); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mongodb/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.data.mongodb.host = localhost 2 | spring.data.mongodb.port = 27017 3 | spring.data.mongodb.database = test 4 | #spring.data.mongodb.username = 5 | #spring.data.mongodb.password = 6 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mongodb/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mongodb/src/test/java/io/github/dunwu/springboot/mongodb/advanced/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Package showing usage of Spring Data abstractions for special (advanced) MongoDB operations. 3 | */ 4 | package io.github.dunwu.springboot.mongodb.advanced; 5 | 6 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mongodb/src/test/java/io/github/dunwu/springboot/mongodb/customer/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Package showing basic usage of Spring Data MongoDB Repositories. 3 | */ 4 | package io.github.dunwu.springboot.mongodb.customer; 5 | 6 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mongodb/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Random port for embedded MongoDB 2 | spring.data.mongodb.port = 0 3 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-multi-datasource/src/main/java/io/github/dunwu/springboot/data/mapper/Db1UserMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.mapper; 2 | 3 | import com.baomidou.dynamic.datasource.annotation.DS; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import io.github.dunwu.springboot.data.entity.User; 6 | 7 | @DS("db1") 8 | public interface Db1UserMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-multi-datasource/src/main/java/io/github/dunwu/springboot/data/mapper/Db2UserMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.mapper; 2 | 3 | import com.baomidou.dynamic.datasource.annotation.DS; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import io.github.dunwu.springboot.data.entity.User; 6 | 7 | @DS("db2") 8 | public interface Db2UserMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-multi-datasource/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-multi-datasource/src/main/resources/sql/schema.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的 DDL 脚本 3 | -- ------------------------------------------- 4 | 5 | -- 创建数据表 user 6 | CREATE TABLE IF NOT EXISTS user ( 7 | id BIGINT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', 8 | name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '用户名', 9 | age TINYINT(3) NOT NULL DEFAULT 0 COMMENT '年龄', 10 | address VARCHAR(255) NOT NULL DEFAULT '' COMMENT '地址', 11 | email VARCHAR(255) NOT NULL DEFAULT '' COMMENT '邮件', 12 | PRIMARY KEY (id) 13 | ) COMMENT = '用户表'; 14 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-plus/src/main/java/io/github/dunwu/springboot/data/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import io.github.dunwu.springboot.data.entity.User; 5 | 6 | public interface UserMapper extends BaseMapper { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-plus/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_boot_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false 3 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 4 | spring.datasource.username = root 5 | spring.datasource.password = root 6 | # 强制每次启动使用 sql 初始化数据,本项目仅为了演示方便,真实环境应避免这种模式 7 | spring.datasource.initialization-mode = ALWAYS 8 | spring.datasource.schema = classpath:sql/schema.sql 9 | spring.datasource.data = classpath:sql/data.sql 10 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-plus/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-plus/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的 DML 脚本 3 | -- ------------------------------------------- 4 | 5 | INSERT INTO user (name, age, address, email) 6 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 9 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-plus/src/main/resources/sql/schema.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的 DDL 脚本 3 | -- ------------------------------------------- 4 | 5 | -- 创建数据表 user 6 | CREATE TABLE IF NOT EXISTS user ( 7 | id BIGINT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', 8 | name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '用户名', 9 | age TINYINT(3) NOT NULL DEFAULT 0 COMMENT '年龄', 10 | address VARCHAR(255) NOT NULL DEFAULT '' COMMENT '地址', 11 | email VARCHAR(255) NOT NULL DEFAULT '' COMMENT '邮件', 12 | PRIMARY KEY (id) 13 | ) COMMENT = '用户表'; 14 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-plus/src/test/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:h2:mem:test 2 | spring.datasource.driver-class-name = org.h2.Driver 3 | spring.datasource.username = sa 4 | spring.datasource.password = 5 | spring.datasource.schema = classpath:sql/schema-h2.sql 6 | spring.datasource.data = classpath:sql/data-h2.sql 7 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-plus/src/test/resources/sql/data-h2.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本(H2 SQL) 3 | -- H2 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/h2 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO user (name, age, address, email) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-sharding/src/main/java/io/github/dunwu/springboot/data/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import io.github.dunwu.springboot.data.entity.User; 5 | 6 | public interface UserMapper extends BaseMapper { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-sharding/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | #spring.profiles.active = master-slave 3 | #spring.profiles.active = sharding-databases 4 | #spring.profiles.active = sharding-databases-tables 5 | #spring.profiles.active = sharding-master-slave 6 | spring.profiles.active = sharding-tables 7 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-sharding/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-mybatis-sharding/src/main/resources/sql/clear.sql: -------------------------------------------------------------------------------- 1 | DROP DATABASE IF EXISTS master_databases; 2 | DROP DATABASE IF EXISTS slave_databases_0; 3 | DROP DATABASE IF EXISTS slave_databases_1; 4 | 5 | DROP DATABASE IF EXISTS sharding_databases_0; 6 | DROP DATABASE IF EXISTS sharding_databases_1; 7 | 8 | DROP DATABASE IF EXISTS sharding_databases_tables_0; 9 | DROP DATABASE IF EXISTS sharding_databases_tables_1; 10 | 11 | DROP DATABASE IF EXISTS sharding_tables; 12 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-redis-cluster/src/main/java/io/github/dunwu/springboot/data/UserService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * @author Zhang Peng 7 | * @since 2019-10-14 8 | */ 9 | public interface UserService { 10 | 11 | User getUser(Long id); 12 | 13 | void setUser(User user); 14 | 15 | void batchSetUsers(Map users); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-redis-cluster/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-redis/src/main/java/io/github/dunwu/springboot/data/UserService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data; 2 | 3 | /** 4 | * @author Zhang Peng 5 | * @since 2019-10-14 6 | */ 7 | public interface UserService { 8 | 9 | User getUser(Long id); 10 | 11 | void setUser(User user); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-redis/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.redis.database = 0 2 | spring.redis.host = localhost 3 | spring.redis.port = 6379 4 | spring.redis.password = 5 | spring.redis.jedis.pool.max-active = 8 6 | spring.redis.jedis.pool.max-wait = -1 7 | spring.redis.jedis.pool.max-idle = 8 8 | spring.redis.jedis.pool.min-idle = 0 9 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-redis/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/README.md: -------------------------------------------------------------------------------- 1 | # Spring 事务使用示例 2 | 3 | ## Spring 事务最佳实践 4 | 5 | ### Spring 事务未生效 6 | 7 | - @Transactional 方法必须是 public 8 | - 必须通过 Spring 注入的 Bean 进行调用 9 | 10 | ### 事务虽然生效但未回滚 11 | 12 | @Transactional 方法只有出现 RuntimeException 和 Error 的时候回滚。 13 | 14 | 解决方案: 15 | 16 | - 手动回滚:TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); 17 | - 回滚所有异常:​@Transactional(rollbackFor = Exception.class) 18 | 19 | ### 细化事务传播方式 20 | 21 | @Transactional 注解的 Propagation 属性 22 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/src/main/java/io/github/dunwu/springboot/data/SpringTxFailedApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.transaction.annotation.EnableTransactionManagement; 6 | 7 | @EnableTransactionManagement 8 | @SpringBootApplication 9 | public class SpringTxFailedApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringTxFailedApplication.class, args); 13 | } 14 | 15 | } 16 | 17 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/src/main/java/io/github/dunwu/springboot/data/UserEntity.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data; 2 | 3 | import lombok.Data; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.Id; 8 | 9 | import static javax.persistence.GenerationType.AUTO; 10 | 11 | @Entity 12 | @Data 13 | public class UserEntity { 14 | 15 | @Id 16 | @GeneratedValue(strategy = AUTO) 17 | private Long id; 18 | private String name; 19 | 20 | public UserEntity() { 21 | } 22 | 23 | public UserEntity(String name) { 24 | this.name = name; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/src/main/java/io/github/dunwu/springboot/data/UserRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import java.util.List; 7 | 8 | @Repository 9 | public interface UserRepository extends JpaRepository { 10 | 11 | List findByName(String name); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/src/main/resources/properties/h2.properties: -------------------------------------------------------------------------------- 1 | jdbc.driver = org.h2.Driver 2 | jdbc.url = jdbc:h2:file:~/.h2/quickstart;AUTO_SERVER=TRUE;DB_CLOSE_DELAY=-1 3 | jdbc.username = sa 4 | jdbc.password = 5 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/src/main/resources/properties/mysql.properties: -------------------------------------------------------------------------------- 1 | jdbc.driver = com.mysql.cj.jdbc.Driver 2 | jdbc.url = jdbc:mysql://127.0.0.1:3306/spring-tutorial?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 3 | jdbc.username = root 4 | jdbc.password = root 5 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/src/main/resources/sql/h2/ddl.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE student ( 2 | id INT(11) NOT NULL AUTO_INCREMENT, 3 | name VARCHAR(20) NOT NULL, 4 | age INT(11) NOT NULL, 5 | PRIMARY KEY (id) 6 | ) 7 | ENGINE = InnoDB 8 | AUTO_INCREMENT = 7 9 | DEFAULT CHARSET = utf8; 10 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/src/main/resources/sql/mysql/ddl.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE student ( 2 | id INT(11) NOT NULL AUTO_INCREMENT, 3 | name VARCHAR(20) NOT NULL, 4 | age INT(11) NOT NULL, 5 | PRIMARY KEY (id) 6 | ) 7 | ENGINE = InnoDB 8 | AUTO_INCREMENT = 7 9 | DEFAULT CHARSET = utf8; 10 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

8 |
9 | 10 | 14 | 15 |
18 | 19 | -------------------------------------------------------------------------------- /codes/data/spring-boot-data-tx/src/main/resources/templates/xss.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 |
11 |
12 | 13 |
18 | 19 | -------------------------------------------------------------------------------- /codes/distributed/spring-boot-dubbo/README.md: -------------------------------------------------------------------------------- 1 | # Spring Boot + Dubbo 2 | 3 | > 搬迁 **[ dubbo-spring-boot-project](https://github.com/apache/dubbo-spring-boot-project)** 示例 4 | -------------------------------------------------------------------------------- /codes/distributed/spring-boot-dubbo/spring-boot-dubbo-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | io.github.dunwu.springboot 9 | spring-boot-dubbo 10 | 1.0.0 11 | ../pom.xml 12 | 13 | 14 | spring-boot-dubbo-api 15 | ${project.artifactId} 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/distributed/spring-boot-dubbo/spring-boot-dubbo-api/src/main/java/io/github/dunwu/springboot/dubbo/api/InfoDto.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.dubbo.api; 2 | 3 | /** 4 | * @author peng.zhang 5 | * @date 2020/12/7 6 | */ 7 | public class InfoDto { 8 | 9 | private Integer id; 10 | 11 | public Integer getId() { 12 | return id; 13 | } 14 | 15 | public void setId(Integer id) { 16 | this.id = id; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/distributed/spring-boot-dubbo/spring-boot-dubbo-api/src/main/java/io/github/dunwu/springboot/dubbo/api/InfoService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.dubbo.api; 2 | 3 | /** 4 | * @author peng.zhang 5 | * @date 2020/12/7 6 | */ 7 | public interface InfoService { 8 | } 9 | -------------------------------------------------------------------------------- /codes/distributed/spring-boot-dubbo/spring-boot-dubbo-autoconfig-consumer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Spring boot application 2 | spring.application.name = spring-boot-dubbo-autoconfig-consumer 3 | -------------------------------------------------------------------------------- /codes/distributed/spring-boot-dubbo/spring-boot-dubbo-autoconfig-provider/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Spring boot application 2 | spring.application.name = spring-boot-dubbo-autoconfig-provider 3 | # Base packages to scan Dubbo Component: @org.apache.dubbo.config.annotation.Service 4 | dubbo.scan.base-packages = io.github.dunwu.springboot.dubbo.provider.service 5 | # Dubbo Application 6 | ## The default value of dubbo.application.name is ${spring.application.name} 7 | ## dubbo.application.name=${spring.application.name} 8 | # Dubbo Protocol 9 | dubbo.protocol.name = dubbo 10 | dubbo.protocol.port = 12345 11 | ## Dubbo Registry 12 | dubbo.registry.address = N/A 13 | -------------------------------------------------------------------------------- /codes/distributed/spring-boot-dubbo/spring-boot-dubbo-zookeeper-consumer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name = spring-boot-dubbo-zookeeper-consumer 2 | demo.service.version = 1.0.0 3 | embedded.zookeeper.port = 2181 4 | dubbo.registry.address = zookeeper://127.0.0.1:${embedded.zookeeper.port} 5 | dubbo.registry.file = ${user.home}/dubbo-cache/${spring.application.name}/dubbo.cache 6 | -------------------------------------------------------------------------------- /codes/distributed/spring-boot-zookeeper/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/distributed/spring-boot-zookeeper/src/main/resources/application.properties -------------------------------------------------------------------------------- /codes/distributed/spring-boot-zookeeper/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk-alpine 2 | 3 | ARG NAME 4 | ARG VERSION 5 | ARG JAR_FILE 6 | 7 | LABEL name=$NAME \ 8 | version=$VERSION 9 | 10 | VOLUME /tmp 11 | 12 | ENV TIME_ZONE=Asia/Shanghai 13 | ENV APP_DIR=/home/myapp 14 | 15 | RUN set -eux; \ 16 | ln -snf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime; \ 17 | echo ${TIME_ZONE} > /etc/timezone; \ 18 | mkdir -p ${APP_DIR}/lib ${APP_DIR}/etc ${APP_DIR}/log 19 | 20 | ADD *.sh /usr/local/bin/ 21 | ADD target/${JAR_FILE} ${APP_DIR}/app.jar 22 | 23 | RUN chmod +x /usr/local/bin/*.sh 24 | 25 | CMD [ "startup.sh" ] 26 | ENTRYPOINT [ "docker-entrypoint.sh" ] 27 | 28 | EXPOSE 8080 29 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-docker/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #-e:若指令传回值不等于0,则立即退出shell。 4 | #-u:当执行时使用到未定义过的变量,则显示错误信息。 5 | #-x:执行指令后,会先显示该指令及所下的参数。 6 | set -eux; 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-docker/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-logging/src/main/java/io/github/dunwu/springboot/web/HelloController.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.web; 2 | 3 | import org.springframework.web.bind.annotation.*; 4 | 5 | @RestController 6 | public class HelloController { 7 | 8 | @ResponseBody 9 | @RequestMapping(value = { "/", "/hello" }, method = RequestMethod.GET) 10 | public String hello(@RequestParam String name) { 11 | return "Hello " + name; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-logging/src/main/resources/application-log4j.properties: -------------------------------------------------------------------------------- 1 | logging.config = classpath:log4j.xml 2 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-logging/src/main/resources/application-log4j2.properties: -------------------------------------------------------------------------------- 1 | logging.config = classpath:log4j2.xml 2 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-logging/src/main/resources/application-logback.properties: -------------------------------------------------------------------------------- 1 | logging.config = classpath:logback.xml 2 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-logging/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | spring.profiles.active = logback 3 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/main/java/io/github/dunwu/springboot/MailDTO.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | /** 8 | * @author Zhang Peng 9 | * @since 2019-01-09 10 | */ 11 | @Data 12 | public class MailDTO { 13 | 14 | private String from; 15 | 16 | private String replyTo; 17 | 18 | private String[] to; 19 | 20 | private String[] cc; 21 | 22 | private String[] bcc; 23 | 24 | private Date sentDate; 25 | 26 | private String subject; 27 | 28 | private String text; 29 | 30 | private String[] filenames; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/main/java/io/github/dunwu/springboot/SpringBootMailApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootMailApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootMailApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/main/resources/application-163.properties: -------------------------------------------------------------------------------- 1 | spring.mail.host = smtp.163.com 2 | spring.mail.username = xxxxxx 3 | spring.mail.password = xxxxxx 4 | spring.mail.properties.mail.smtp.auth = true 5 | spring.mail.properties.mail.smtp.starttls.enable = true 6 | spring.mail.properties.mail.smtp.starttls.required = true 7 | spring.mail.default-encoding = UTF-8 8 | mail.domain = 163.com 9 | mail.from = ${spring.mail.username}@${mail.domain} 10 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/main/resources/application-qq.properties: -------------------------------------------------------------------------------- 1 | spring.mail.host = smtp.qq.com 2 | spring.mail.username = xxxxxx 3 | spring.mail.password = xxxxxx 4 | spring.mail.properties.mail.smtp.auth = true 5 | spring.mail.properties.mail.smtp.starttls.enable = true 6 | spring.mail.properties.mail.smtp.starttls.required = true 7 | spring.mail.default-encoding = UTF-8 8 | mail.domain = qq.com 9 | mail.from = ${spring.mail.username}@${mail.domain} 10 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | debug = true 2 | spring.profiles.active = qq 3 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/test/resources/icon-man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/integration/spring-boot-mail/src/test/resources/icon-man.png -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/test/resources/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/integration/spring-boot-mail/src/test/resources/moon.png -------------------------------------------------------------------------------- /codes/integration/spring-boot-scheduler-quartz/src/main/java/io/github/dunwu/springboot/SampleJob.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.quartz.JobExecutionContext; 4 | import org.quartz.JobExecutionException; 5 | import org.springframework.scheduling.quartz.QuartzJobBean; 6 | 7 | public class SampleJob extends QuartzJobBean { 8 | 9 | private String name; 10 | 11 | @Override 12 | protected void executeInternal(JobExecutionContext context) throws JobExecutionException { 13 | System.out.println(String.format("Hello %s!", this.name)); 14 | } 15 | 16 | public void setName(String name) { 17 | this.name = name; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-scheduler-quartz/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_boot_tutorial?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8 2 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | # quartz settings 6 | #spring.quartz.auto-startup = true 7 | spring.quartz.startup-delay = 60 8 | spring.quartz.job-store-type = jdbc 9 | spring.quartz.jdbc.initialize-schema = always 10 | spring.quartz.jdbc.schema = classpath:sql/schema.sql 11 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-scheduler-quartz/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-scheduler/src/main/java/io/github/dunwu/springboot/SpringBootSchedulerApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableScheduling; 6 | 7 | @SpringBootApplication 8 | @EnableScheduling 9 | public class SpringBootSchedulerApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringBootSchedulerApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-scheduler/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-shell/src/main/java/io/github/dunwu/springboot/shell/DateCommand.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.shell; 2 | 3 | import io.github.dunwu.tool.io.AnsiColorUtil; 4 | import org.springframework.shell.standard.ShellComponent; 5 | import org.springframework.shell.standard.ShellMethod; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * @author Zhang Peng 11 | * @since 2020-03-13 12 | */ 13 | @ShellComponent 14 | public class DateCommand { 15 | 16 | @ShellMethod("当前时间") 17 | public void date() { 18 | AnsiColorUtil.BLUE.println(new Date().toString()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-shell/src/main/java/io/github/dunwu/springboot/shell/SpringShellApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.shell; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * @author Zhang Peng 8 | * @since 2020-03-13 9 | */ 10 | @SpringBootApplication 11 | public class SpringShellApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(SpringShellApplication.class); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-statemachine/src/main/java/io/github/dunwu/springboot/Events.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | public enum Events { 4 | E1, 5 | E2 6 | } 7 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-statemachine/src/main/java/io/github/dunwu/springboot/States.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | public enum States { 4 | SI, 5 | S1, 6 | S2 7 | } 8 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-statemachine/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/integration/spring-boot-statemachine/src/main/resources/application.properties -------------------------------------------------------------------------------- /codes/integration/spring-boot-statemachine/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-swagger/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-swagger/src/main/resources/sql/data-h2.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- H2 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/h2 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (username, password, email) 8 | VALUES ('admin', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'admin@xxx.com') ; 9 | 10 | INSERT INTO user (username, password, email) 11 | VALUES ('user', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'user@xxx.com') ; 12 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-swagger/src/main/resources/sql/schema-h2.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DDL 脚本 3 | -- H2 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/h2 5 | -- ------------------------------------------------------------------- 6 | 7 | -- 强制新建用户表 8 | DROP TABLE IF EXISTS user; 9 | CREATE TABLE user ( 10 | id INT(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', 11 | username VARCHAR(30) NOT NULL COMMENT '用户名', 12 | password VARCHAR(60) NOT NULL COMMENT '密码', 13 | email VARCHAR(100) NOT NULL COMMENT '邮箱', 14 | PRIMARY KEY (id), 15 | UNIQUE (username), 16 | UNIQUE (email) 17 | ) 18 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/main/java/io/github/dunwu/springboot/HelloController.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloController { 8 | 9 | private final HelloService helloService; 10 | 11 | public HelloController(HelloService helloService) { 12 | this.helloService = helloService; 13 | } 14 | 15 | @GetMapping("/hello") 16 | public String hello() { 17 | return helloService.hello(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/main/java/io/github/dunwu/springboot/HelloService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | /** 6 | * @author Zhang Peng 7 | * @since 2019-12-13 8 | */ 9 | @Service 10 | public class HelloService { 11 | 12 | public String hello() { 13 | return "Hello World"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/main/java/io/github/dunwu/springboot/TestJunit5Application.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TestJunit5Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TestJunit5Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/test/java/io/github/dunwu/springboot/DisabledClassDemo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.junit.jupiter.api.Disabled; 4 | import org.junit.jupiter.api.Test; 5 | 6 | @Disabled 7 | class DisabledClassDemo { 8 | 9 | @Test 10 | void testWillBeSkipped() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/test/java/io/github/dunwu/springboot/DisabledTestsDemo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.junit.jupiter.api.Disabled; 4 | import org.junit.jupiter.api.Test; 5 | 6 | class DisabledTestsDemo { 7 | 8 | @Test 9 | void testWillBeExecuted() { 10 | } 11 | 12 | @Disabled 13 | @Test 14 | void testWillBeSkipped() { 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/test/java/io/github/dunwu/springboot/JunitDisplayNameDemo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | import org.junit.jupiter.api.Test; 5 | 6 | @DisplayName("A special test case") 7 | class JunitDisplayNameDemo { 8 | 9 | @Test 10 | @DisplayName("😱") 11 | void testWithDisplayNameContainingEmoji() { 12 | } 13 | 14 | @Test 15 | @DisplayName("Custom test name containing spaces") 16 | void testWithDisplayNameContainingSpaces() { 17 | } 18 | 19 | @Test 20 | @DisplayName("╯°□°)╯") 21 | void testWithDisplayNameContainingSpecialCharacters() { 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/test/java/io/github/dunwu/springboot/TestOnWindows.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.junit.jupiter.api.condition.EnabledOnOs; 5 | import org.junit.jupiter.api.condition.OS; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | @Target(ElementType.METHOD) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Test 15 | @EnabledOnOs(OS.WINDOWS) 16 | @interface TestOnWindows { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-activemq/src/main/java/io/github/dunwu/springboot/Consumer.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.jms.annotation.JmsListener; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class Consumer { 10 | 11 | private final Logger log = LoggerFactory.getLogger(this.getClass()); 12 | 13 | @JmsListener(destination = "io.github.dunwu.springboot") 14 | public void receiveQueue(String text) { 15 | log.info("receive message: {}", text); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-activemq/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.activemq.broker-url = tcp://localhost:61616 2 | spring.activemq.user = admin 3 | spring.activemq.password = admin 4 | spring.activemq.in-memory = true 5 | spring.activemq.pool.enabled = false 6 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-activemq/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-kafka/README.md: -------------------------------------------------------------------------------- 1 | # spring-boot-mq-kafka 2 | 3 | > **本项目演示 Spring Boot 访问 Kafka 消息队列。** 4 | > 5 | > 依赖环境: 6 | > 7 | > ![spring-kafka](https://img.shields.io/badge/spring--kafka-2.2.9.RELEASE-blue) ![jdk](https://img.shields.io/badge/jdk-1.8.0__181-blue) ![maven](https://img.shields.io/badge/maven-v3.6.0-blue) 8 | 9 | ## 使用说明 10 | 11 | ### 构建 12 | 13 | 在项目根目录下执行 maven 指令。 14 | 15 | ``` 16 | mvn clean package -DskipTests=true 17 | ``` 18 | 19 | ### 启动 20 | 21 | ``` 22 | cd target 23 | java -jar spring-boot-swagger-1.0.0.jar 24 | ``` 25 | 26 | ## 扩展知识 27 | 28 | - [Kafka 运维指南](https://dunwu.github.io/javatech/#/technology/mq/kafka-ops) 29 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-kafka/src/main/java/io/github/dunwu/springboot/SpringBootMsgKafkaApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootMsgKafkaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootMsgKafkaApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-kafka/src/test/java/io/github/dunwu/springboot/KafkaTestBean.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | import lombok.experimental.Accessors; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * @author Zhang Peng 11 | * @since 2019-11-20 12 | */ 13 | @Data 14 | @ToString 15 | @Accessors(chain = true) 16 | public class KafkaTestBean { 17 | 18 | Date timestamp; 19 | 20 | T data; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-rabbitmq/src/main/java/io/github/dunwu/springboot/RabbitConfiguration.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.amqp.core.Queue; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class RabbitConfiguration { 9 | 10 | private final static String QUEUE_NAME = "test"; 11 | 12 | @Bean 13 | public Queue queue() { 14 | return new Queue(QUEUE_NAME); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-rabbitmq/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.rabbitmq.host = 127.0.0.1 2 | spring.rabbitmq.port = 5672 3 | spring.rabbitmq.username = guest 4 | spring.rabbitmq.password = guest 5 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-rabbitmq/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-redis/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.redis.host = 127.0.0.1 2 | spring.redis.port = 6379 3 | spring.redis.password = 4 | spring.redis.database = 0 5 | -------------------------------------------------------------------------------- /codes/mq/spring-boot-mq-redis/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-authentication/src/main/java/io/github/dunwu/springboot/SpringBootAuthSecurityApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * @author Zhang Peng 8 | * @since 2019-09-25 9 | */ 10 | @SpringBootApplication 11 | public class SpringBootAuthSecurityApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(SpringBootAuthSecurityApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-authentication/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-checkcode/src/main/java/io/github/dunwu/springboot/security/filter/DunwuSecurityException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.filter; 2 | 3 | import org.springframework.security.core.AuthenticationException; 4 | 5 | public class DunwuSecurityException extends AuthenticationException { 6 | 7 | private static final long serialVersionUID = 5022575393500654458L; 8 | 9 | public DunwuSecurityException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-checkcode/src/main/java/io/github/dunwu/springboot/security/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import io.github.dunwu.springboot.security.domain.User; 5 | 6 | /** 7 | *

8 | * 用户表 Mapper 接口 9 | *

10 | * 11 | * @author Zhang Peng 12 | * @since 2019-09-17 13 | */ 14 | public interface UserMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-checkcode/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-checkcode/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | --------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | --------------------------------------------- 4 | 5 | INSERT INTO user (username, password, email) 6 | VALUES ('admin', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'admin@xxx.com') ; 7 | 8 | INSERT INTO user (username, password, email) 9 | VALUES ('user', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'user@xxx.com') ; 10 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-checkcode/src/main/resources/sql/schema.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的初始化 DDL 脚本 3 | -- ------------------------------------------- 4 | 5 | -- 用户表 6 | DROP TABLE IF EXISTS `user`; 7 | CREATE TABLE `user` ( 8 | `id` INT(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', 9 | `username` VARCHAR(30) NOT NULL COMMENT '用户名', 10 | `password` VARCHAR(60) NOT NULL COMMENT '密码', 11 | `email` VARCHAR(100) DEFAULT '' COMMENT '邮箱', 12 | PRIMARY KEY (`id`), 13 | UNIQUE KEY `uk_username`(`username`), 14 | UNIQUE KEY `uk_email`(`email`) 15 | ) ENGINE = INNODB COMMENT ='用户表'; 16 | 17 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-ldap/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.ldap.urls = ldap://172.22.6.12:10389 2 | spring.ldap.base = ou=users,dc=dunwu,dc=github,dc=io 3 | spring.ldap.username = uid=admin,ou=system 4 | spring.ldap.password = secret 5 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-ldap/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/README.md: -------------------------------------------------------------------------------- 1 | # SpringBootTutorial :: Web :: Session 2 | 3 | > 通过 Redis 管理 Session 4 | 5 | ## 引用和引申 6 | 7 | https://docs.spring.io/spring-session/docs/current/reference/html5/guides/boot-redis.html 8 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/src/main/java/io/github/dunwu/springboot/SpringBootWebSessionApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootWebSessionApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootWebSessionApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/src/main/java/io/github/dunwu/springboot/security/filter/DunwuSecurityException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.filter; 2 | 3 | import org.springframework.security.core.AuthenticationException; 4 | 5 | public class DunwuSecurityException extends AuthenticationException { 6 | 7 | private static final long serialVersionUID = 5022575393500654458L; 8 | 9 | public DunwuSecurityException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/src/main/java/io/github/dunwu/springboot/security/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import io.github.dunwu.springboot.security.domain.User; 5 | 6 | /** 7 | *

8 | * 用户表 Mapper 接口 9 | *

10 | * 11 | * @author Zhang Peng 12 | * @since 2019-09-17 13 | */ 14 | public interface UserMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | --------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | --------------------------------------------- 4 | 5 | INSERT INTO user (username, password, email) 6 | VALUES ('admin', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'admin@xxx.com') ; 7 | 8 | INSERT INTO user (username, password, email) 9 | VALUES ('user', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'user@xxx.com') ; 10 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/src/main/resources/sql/schema.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的初始化 DDL 脚本 3 | -- ------------------------------------------- 4 | 5 | -- 用户表 6 | DROP TABLE IF EXISTS `user`; 7 | CREATE TABLE `user` ( 8 | `id` INT(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', 9 | `username` VARCHAR(30) NOT NULL COMMENT '用户名', 10 | `password` VARCHAR(60) NOT NULL COMMENT '密码', 11 | `email` VARCHAR(100) DEFAULT '' COMMENT '邮箱', 12 | PRIMARY KEY (`id`), 13 | UNIQUE KEY `uk_username`(`username`), 14 | UNIQUE KEY `uk_email`(`email`) 15 | ) ENGINE = INNODB COMMENT ='用户表'; 16 | 17 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-shiro/src/main/java/io/github/dunwu/springboot/security/config/ShiroConfiguration.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.config; 2 | 3 | import lombok.RequiredArgsConstructor; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | /** 7 | * Shiro 安全配置 8 | * 9 | * @author Zhang Peng 10 | * @since 2020-03-16 11 | */ 12 | @Configuration 13 | @RequiredArgsConstructor 14 | public class ShiroConfiguration { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-shiro/src/main/java/io/github/dunwu/springboot/security/config/ShiroProperties.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.config; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ShiroProperties { 7 | 8 | private long sessionTimeout; 9 | 10 | private int cookieTimeout; 11 | 12 | private String anonUrl; 13 | 14 | private String loginUrl; 15 | 16 | private String successUrl; 17 | 18 | private String logoutUrl; 19 | 20 | private String unauthorizedUrl; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-shiro/src/main/java/io/github/dunwu/springboot/security/system/entity/Test.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * @author MrBird 10 | */ 11 | @Data 12 | @TableName("t_test") 13 | public class Test implements Serializable { 14 | 15 | private static final long serialVersionUID = -2510534697977648681L; 16 | private String name; 17 | private int age; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-shiro/src/main/java/io/github/dunwu/springboot/security/system/mapper/DeptMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.system.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import io.github.dunwu.springboot.security.system.entity.Dept; 5 | 6 | /** 7 | * @author MrBird 8 | */ 9 | public interface DeptMapper extends BaseMapper { 10 | } 11 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-shiro/src/main/java/io/github/dunwu/springboot/security/system/mapper/RoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.system.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import io.github.dunwu.springboot.security.system.entity.RoleMenu; 5 | 6 | /** 7 | * @author MrBird 8 | */ 9 | public interface RoleMenuMapper extends BaseMapper { 10 | } 11 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-shiro/src/main/java/io/github/dunwu/springboot/security/system/mapper/UserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.system.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import io.github.dunwu.springboot.security.system.entity.UserRole; 5 | 6 | /** 7 | * @author MrBird 8 | */ 9 | public interface UserRoleMapper extends BaseMapper { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/sql/init.sql: -------------------------------------------------------------------------------- 1 | -- 创建数据表 user 2 | CREATE TABLE IF NOT EXISTS user ( 3 | id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', 4 | name VARCHAR(64) NOT NULL DEFAULT 'default' COMMENT '用户名', 5 | age TINYINT(3) NOT NULL DEFAULT 0 COMMENT '年龄', 6 | PRIMARY KEY (id) 7 | ) COMMENT = '用户表'; 8 | 9 | INSERT INTO user (name, age) 10 | VALUES ('Jack', 18); 11 | INSERT INTO user (name, age) 12 | VALUES ('Tom', 19); 13 | INSERT INTO user (name, age) 14 | VALUES ('Jone', 28); 15 | INSERT INTO user (name, age) 16 | VALUES ('Bill', 20); 17 | 18 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/java/io/github/dunwu/springboot/data/UserDAO.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.data; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Zhang Peng 7 | * @since 2018-12-15 8 | */ 9 | public interface UserDAO { 10 | 11 | /** 12 | * 删除所有用户 13 | */ 14 | void clear(); 15 | 16 | /** 17 | * 新增一个用户 18 | */ 19 | void create(String name, Integer age); 20 | 21 | /** 22 | * 根据name删除一个用户高 23 | */ 24 | void deleteByName(String name); 25 | 26 | /** 27 | * 获取用户总量 28 | */ 29 | List list(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_boot_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false 2 | spring.datasource.username = root 3 | spring.datasource.password = root 4 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 5 | application.message = Hello, Freemarker 6 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/create_table.ftl: -------------------------------------------------------------------------------- 1 | CREATE TABLE `${table.database}`.`${table.tableName}` ( 2 | <#list table.columns as item> 3 | `${item.columnName}` ${item.columnType}<#if item?index != table.columns?size - 1>, 4 | 5 | ); 6 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/drop_table.ftl: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `${table.database}`.`${table.tableName}`; 2 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/sql_clear.ftl: -------------------------------------------------------------------------------- 1 | DELETE FROM ${tableName} 2 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/sql_create.ftl: -------------------------------------------------------------------------------- 1 | INSERT INTO ${tableName}(${key1}, ${key2}) VALUES(${value1}, ${value2}) 2 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/sql_delete.ftl: -------------------------------------------------------------------------------- 1 | DELETE FROM ${tableName} WHERE NAME = ${name} 2 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/sql_select.ftl: -------------------------------------------------------------------------------- 1 | SELECT * FROM ${tableName} 2 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/resources/templates/web/exception.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

HTTP Request Status: ${status}

7 |
8 |

导航:

9 | 15 |
16 |

${info}

17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-freemark/src/main/resources/templates/web/index.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FreeMarker 模板引擎 5 | 6 | 7 |
8 |

Hello FreeMarker

9 |
10 |

导航:

11 | 17 |
18 |

Date: ${time?date}

19 |

Time: ${time?time}

20 |

Message: ${message}

21 |
22 | 23 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-jsp/README.md: -------------------------------------------------------------------------------- 1 | # SpringBootTutorial :: Web :: JSP :: Tomcat 2 | 3 | 构建运行 4 | 5 | ```bash 6 | mvn clean package 7 | java -jar target/spring-boot-web-jsp-tomcat*.war 8 | ``` 9 | 10 | 检验 11 | 12 | ``` 13 | curl -i -I http://localhost:8080/ 14 | ``` 15 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-jsp/src/main/java/io/github/dunwu/springboot/SpringBootWebJspApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootWebJspApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootWebJspApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-jsp/src/main/java/io/github/dunwu/springboot/web/MessageAdvice.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.web; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.web.bind.annotation.ControllerAdvice; 5 | import org.springframework.web.bind.annotation.ModelAttribute; 6 | 7 | @ControllerAdvice 8 | public class MessageAdvice { 9 | 10 | @ModelAttribute("message") 11 | public String message(@Value("${application.message:Hello World}") String message) { 12 | return message; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-jsp/src/main/java/io/github/dunwu/springboot/web/MyException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.web; 2 | 3 | public class MyException extends RuntimeException { 4 | 5 | public MyException(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-jsp/src/main/java/io/github/dunwu/springboot/web/MyRestResponse.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.web; 2 | 3 | public class MyRestResponse { 4 | 5 | private String message; 6 | 7 | public MyRestResponse(String message) { 8 | this.message = message; 9 | } 10 | 11 | public String getMessage() { 12 | return this.message; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-jsp/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.view.prefix = /WEB-INF/jsp/ 2 | spring.mvc.view.suffix = .jsp 3 | application.message = Hello World 4 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-jsp/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-jsp/src/main/resources/static/test.txt: -------------------------------------------------------------------------------- 1 | Example - Spring Boot + Jsp 2 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-jsp/src/main/webapp/WEB-INF/jsp/error.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Error

5 | Something went wrong: ${status} ${error} 6 | 7 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-thymeleaf/src/main/java/io/github/dunwu/springboot/SpringBootTmplThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootTmplThymeleafApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootTmplThymeleafApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-thymeleaf/src/main/java/io/github/dunwu/springboot/exception/MyException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.exception; 2 | 3 | public class MyException extends Exception { 4 | 5 | public MyException(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-thymeleaf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache = false 2 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-thymeleaf/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-thymeleaf/src/main/resources/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Thymeleaf 模板引擎 6 | 7 | 8 |

Thymeleaf 模板引擎

9 |

Exception:

10 |
11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-velocity/src/main/java/io/github/dunwu/springboot/mail/MailDTO.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.mail; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | /** 8 | * @author Zhang Peng 9 | * @since 2019-01-09 10 | */ 11 | @Data 12 | public class MailDTO { 13 | 14 | private String from; 15 | 16 | private String replyTo; 17 | 18 | private String[] to; 19 | 20 | private String[] cc; 21 | 22 | private String[] bcc; 23 | 24 | private Date sentDate; 25 | 26 | private String subject; 27 | 28 | private String text; 29 | 30 | private String[] filenames; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-velocity/src/main/resources/layout/default.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | $!pageTitle 4 | 5 | 6 | 7 |
默认布局页面,当前 Layout URL : $!layout_key
8 |

9 | 10 | $body_content 11 | 12 |

13 |

14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-velocity/src/main/resources/layout/layout.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | $!pageTitle 4 | 5 | 6 | 7 |
Layout 页面,当前 Layout URL : $!layout_key
8 |

9 | 10 | $body_content 11 | 12 |

13 |

14 |

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-velocity/src/main/resources/layout/layout2.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | $!pageTitle 4 | 5 | 6 | 7 |
Layout2 页面,当前 Layout URL : $!layout_key
8 |

9 | 10 | $body_content 11 | 12 |

13 |

14 |

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-velocity/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-velocity/src/main/resources/templates/velocity/default/footer.vm: -------------------------------------------------------------------------------- 1 | #set ($company = "Apache") 2 | #set ($year = "2016") 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 |
9 | Copyright $company $year. 保留所有权利。 11 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-velocity/src/main/resources/templates/velocity/default/header.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Velocity 邮件模板 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-velocity/src/main/resources/templates/velocity/default/index.vm: -------------------------------------------------------------------------------- 1 |
Demos:
2 |
3 | 20 | 21 | 中文测试 22 |
23 | 24 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-velocity/src/main/resources/templates/velocity/default/tools.vm: -------------------------------------------------------------------------------- 1 |
\${esc.javascript("http://www.alibaba-inc.com")} : ${esc.javascript("http://www.alibaba-inc.com")}
2 |

3 |

\${esc.xml("http://www.alibaba-inc.com")} : ${esc.xml("http://www.alibaba-inc.com")}
4 |

5 |

\${esc.html("http://www.alibaba-inc.com")} : ${esc.html("http://www.alibaba-inc.com")}
6 |

7 |

\${convert.toDouble("1")} : ${convert.toDouble("1")}
8 | 9 | ${echo.echo("Hello,World")} 10 | ${echo2.echo("Hello,World")} 11 | -------------------------------------------------------------------------------- /codes/template/spring-boot-tmpl-velocity/src/main/resources/velocity.properties: -------------------------------------------------------------------------------- 1 | resource.loader = file 2 | file.resource.loader.path = D:/01_Workspace/Project/zp/java/javaee-tutorial/codes/oss/src/main/resources 3 | input.encoding = utf-8 4 | output.encoding = utf-8 5 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-fastjson/src/main/java/io/github/dunwu/springboot/SpringBootWebFastjsonApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootWebFastjsonApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootWebFastjsonApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-fastjson/src/main/java/io/github/dunwu/springboot/dto/CodeEn.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.dto; 2 | 3 | /** 4 | * @author Zhang Peng 5 | * @since 2018-12-29 6 | */ 7 | public enum CodeEn { 8 | 9 | SUCCESS("200", "成功"), 10 | APP_ERROR("500", "系统内部错误"), 11 | OTHER_ERROR("501", "其他错误"); 12 | 13 | private String code; 14 | 15 | private String message; 16 | 17 | CodeEn(String code, String message) { 18 | this.code = code; 19 | this.message = message; 20 | } 21 | 22 | public String code() { 23 | return code; 24 | } 25 | 26 | public String message() { 27 | return message; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-fastjson/src/main/java/io/github/dunwu/springboot/dto/TypeException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.dto; 2 | 3 | /** 4 | * @author Zhang Peng 5 | * @since 2020-03-18 6 | */ 7 | public class TypeException extends RuntimeException { 8 | 9 | private static final long serialVersionUID = -2732419195634968950L; 10 | 11 | public TypeException(String message) { 12 | super(message); 13 | } 14 | 15 | public TypeException(String message, Throwable cause) { 16 | super(message, cause); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-fastjson/src/main/java/io/github/dunwu/springboot/web/AppException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.web; 2 | 3 | /** 4 | * @author Zhang Peng 5 | * @since 2018-12-29 6 | */ 7 | public class AppException extends RuntimeException { 8 | 9 | public AppException() { 10 | super(); 11 | } 12 | 13 | public AppException(String message) { 14 | super(message); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-form/README.md: -------------------------------------------------------------------------------- 1 | # SpringBootTutorial :: Web :: Form 2 | 3 | ## 引用和引申 4 | 5 | - https://spring.io/guides/gs/handling-form-submission/ 6 | - https://spring.io/guides/gs/validating-form-input/ 7 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-form/src/main/java/io/github/dunwu/springboot/Greeting.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | public class Greeting { 4 | 5 | private long id; 6 | 7 | private String content; 8 | 9 | public long getId() { 10 | return id; 11 | } 12 | 13 | public void setId(long id) { 14 | this.id = id; 15 | } 16 | 17 | public String getContent() { 18 | return content; 19 | } 20 | 21 | public void setContent(String content) { 22 | this.content = content; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-form/src/main/java/io/github/dunwu/springboot/SpringBootWebFormApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootWebFormApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootWebFormApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-form/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-helloworld/src/main/java/io/github/dunwu/springboot/HelloController.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestParam; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class HelloController { 9 | 10 | @GetMapping({ "/", "hello" }) 11 | public String hello(@RequestParam(value = "name", defaultValue = "World") String name) { 12 | return String.format("Hello %s!", name); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-helloworld/src/main/java/io/github/dunwu/springboot/SpringBootHelloWorldApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootHelloWorldApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootHelloWorldApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-helloworld/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | spring.jackson.date-format = yyyy-MM-dd HH:mm:ss 3 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-helloworld/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-https/src/main/java/io/github/dunwu/springboot/bean/CityInfo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.bean; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class CityInfo { 11 | 12 | private String city; 13 | 14 | private String citykey; 15 | 16 | private String parent; 17 | 18 | private String updateTime; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-https/src/main/java/io/github/dunwu/springboot/bean/Weather.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.bean; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class Weather { 11 | 12 | private String message; 13 | 14 | private int status; 15 | 16 | private String date; 17 | 18 | private String time; 19 | 20 | private CityInfo cityInfo; 21 | 22 | private WeatherData data; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-https/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8443 2 | server.ssl.key-store = classpath:keystore.p12 3 | server.ssl.key-alias = tomcat 4 | server.ssl.key-store-password = 123456 5 | spring.jackson.date-format = yyyy-MM-dd HH:mm:ss 6 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-https/src/main/resources/keystore.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-https/src/main/resources/keystore.p12 -------------------------------------------------------------------------------- /codes/web/spring-boot-web-https/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-multi-connectors/src/main/java/io/github/dunwu/springboot/HelloController.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloController { 8 | 9 | @GetMapping({ "/", "/hello" }) 10 | public String helloWorld() { 11 | StringBuilder sb = new StringBuilder(); 12 | sb.append("本服务同时支持 HTTP 和 HTTPS 服务。"); 13 | sb.append("请尝试访问 http://localhost:8080/ 和 https://localhost:8443/"); 14 | return sb.toString(); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-multi-connectors/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8443 2 | server.ssl.key-store = classpath:sample.jks 3 | server.ssl.key-store-password = secret 4 | server.ssl.key-password = password 5 | http.port = 8080 6 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-multi-connectors/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-multi-connectors/src/main/resources/sample.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-multi-connectors/src/main/resources/sample.jks -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-bootstrap/src/main/java/io/github/dunwu/springboot/MessageRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | public interface MessageRepository { 4 | 5 | void deleteMessage(Long id); 6 | 7 | Iterable findAll(); 8 | 9 | Message findMessage(Long id); 10 | 11 | Message save(Message message); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-bootstrap/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Allow Thymeleaf templates to be reloaded at dev time 2 | spring.thymeleaf.cache = false 3 | server.tomcat.accesslog.enabled = true 4 | server.tomcat.basedir = target/tomcat 5 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-bootstrap/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-bootstrap/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | form.message = Message 2 | form.messages = Messages 3 | form.submit = Submit 4 | form.summary = Summary 5 | form.title = Messages : Create 6 | list.create = Create Message 7 | list.table.created = Created 8 | list.table.empty = No messages 9 | list.table.id = Id 10 | list.table.summary = Summary 11 | list.title = Messages : View all 12 | navbar.messages = Messages 13 | navbar.thymeleaf = Thymeleaf 14 | view.delete = delete 15 | view.messages = Messages 16 | view.modify = modify 17 | view.success = Successfully created a new message 18 | view.title = Messages : View 19 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-bootstrap/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-bootstrap/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/java/io/github/dunwu/springboot/IndexController.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | public class IndexController { 8 | 9 | @RequestMapping(value = { "", "/", "index" }) 10 | public String index() { 11 | return "index"; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/java/io/github/dunwu/springboot/UserRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import java.util.List; 6 | 7 | public interface UserRepository extends CrudRepository { 8 | 9 | List findByLastName(String lastName); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.view.prefix = /views/ 2 | spring.mvc.view.suffix = .html 3 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/filebox.css: -------------------------------------------------------------------------------- 1 | .filebox .textbox-value { 2 | vertical-align: top; 3 | position: absolute; 4 | top: 0; 5 | left: -5000px; 6 | } 7 | 8 | .filebox-label { 9 | display: inline-block; 10 | position: absolute; 11 | width: 100%; 12 | height: 100%; 13 | cursor: pointer; 14 | left: 0; 15 | top: 0; 16 | z-index: 10; 17 | background: url('images/blank.gif') no-repeat; 18 | } 19 | 20 | .l-btn-disabled .filebox-label { 21 | cursor: default; 22 | } 23 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/accordion_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/accordion_arrows.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/blank.gif -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/calendar_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/calendar_arrows.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/combo_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/combo_arrow.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/datagrid_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/datagrid_icons.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/datebox_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/datebox_arrow.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/layout_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/layout_arrows.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/linkbutton_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/linkbutton_bg.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/loading.gif -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/menu_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/menu_arrows.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/messager_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/messager_icons.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/pagination_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/pagination_icons.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/panel_tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/panel_tools.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/passwordbox_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/passwordbox_close.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/passwordbox_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/passwordbox_open.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/searchbox_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/searchbox_button.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/slider_handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/slider_handle.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/spinner_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/spinner_arrows.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tabs_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tabs_icons.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tagbox_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tagbox_icons.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tree_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tree_icons.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/validatebox_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/validatebox_warning.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/numberbox.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/numberbox.css -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/passwordbox.css: -------------------------------------------------------------------------------- 1 | .passwordbox-open { 2 | background: url('images/passwordbox_open.png') no-repeat center center; 3 | } 4 | 5 | .passwordbox-close { 6 | background: url('images/passwordbox_close.png') no-repeat center center; 7 | } 8 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/radiobutton.css: -------------------------------------------------------------------------------- 1 | .radiobutton { 2 | position: relative; 3 | border: 2px solid #0070A9; 4 | border-radius: 50%; 5 | } 6 | 7 | .radiobutton-inner { 8 | position: absolute; 9 | left: 0; 10 | top: 0; 11 | width: 100%; 12 | height: 100%; 13 | background: #0070A9; 14 | border-radius: 50%; 15 | transform: scale(.6); 16 | } 17 | 18 | .radiobutton-disabled { 19 | opacity: 0.6; 20 | } 21 | 22 | .radiobutton-value { 23 | position: absolute; 24 | overflow: hidden; 25 | width: 1px; 26 | height: 1px; 27 | left: -999px; 28 | } 29 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/splitbutton.css: -------------------------------------------------------------------------------- 1 | .s-btn:hover .m-btn-line, 2 | .s-btn-active .m-btn-line, 3 | .s-btn-plain-active .m-btn-line { 4 | display: inline-block; 5 | } 6 | 7 | .l-btn:hover .s-btn-downarrow, 8 | .s-btn-active .s-btn-downarrow, 9 | .s-btn-plain-active .s-btn-downarrow { 10 | border-style: solid; 11 | border-color: #BBBBBB; 12 | border-width: 0 0 0 1px; 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/bootstrap/validatebox.css: -------------------------------------------------------------------------------- 1 | .inputbox { 2 | display: inline-block; 3 | vertical-align: middle; 4 | overflow: hidden; 5 | white-space: nowrap; 6 | margin: 0; 7 | padding: 0; 8 | } 9 | 10 | .validatebox-invalid { 11 | border-color: #FFA8A8; 12 | background-color: #FFF3F3; 13 | color: #000000; 14 | } 15 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/back.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/blank.gif -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/cancel.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/clear.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/cut.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/edit_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/edit_add.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/edit_remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/edit_remove.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/filesave.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/filter.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/help.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/large_chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/large_chart.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/large_clipart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/large_clipart.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/large_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/large_picture.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/large_shapes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/large_shapes.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/large_smartart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/large_smartart.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/lock.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/man.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/mini_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/mini_add.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/mini_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/mini_edit.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/mini_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/mini_refresh.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/more.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/no.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/ok.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/pencil.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/print.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/redo.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/reload.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/search.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/sum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/sum.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/tip.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/lib/easyui/themes/icons/undo.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/plugin/themes/default/numberbox.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-easyui/src/main/resources/static/plugin/themes/default/numberbox.css -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | io.github.dunwu.springboot 8 | spring-boot-web-ui-react 9 | spring-boot-web-ui-react 10 | 1.0.0 11 | pom 12 | 13 | 14 | spring-boot-web-ui-react-backend 15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-backend/src/main/java/io/github/dunwu/springboot/WebHelloworldApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class WebHelloworldApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(WebHelloworldApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-backend/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 9527 2 | spring.jackson.default-property-inclusion = non_null 3 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-backend/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) 6 | - %boldBlue(%m%n) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "env", 5 | { 6 | "modules": false 7 | } 8 | ], 9 | "react", 10 | "stage-0" 11 | ], 12 | "plugins": [ 13 | "react-hot-loader/babel", 14 | "syntax-dynamic-import", 15 | "transform-runtime", 16 | [ 17 | "import", 18 | [ 19 | { 20 | "libraryName": "antd", 21 | "style": "css" 22 | } 23 | ] 24 | ] 25 | ], 26 | "env": { 27 | "test": { 28 | "presets": [ 29 | "env", 30 | "react", 31 | "stage-0" 32 | ] 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # project 2 | node_modules 3 | 4 | # build 5 | dist/ 6 | coverage 7 | 8 | # IDE files 9 | .idea/ 10 | *.iml 11 | .ipr 12 | .iws 13 | 14 | # temp and sys 15 | *~ 16 | ~* 17 | *.diff 18 | *.patch 19 | *.bak 20 | .DS_Store 21 | Thumbs.db 22 | *.log 23 | 24 | # other 25 | .project 26 | .*proj 27 | .svn/ 28 | *.swp 29 | *.swo 30 | *.pyc 31 | *.pyo 32 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/config/app.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file app 的全局配置 3 | * @author Zhang Peng 4 | */ 5 | 6 | module.exports = { 7 | 8 | /** 9 | * 打印日志开关 10 | */ 11 | log: true, 12 | 13 | http: { 14 | 15 | /** 16 | * 请求超时时间 17 | */ 18 | timeout: 5000, 19 | 20 | /** 21 | * 服务器的host 22 | */ 23 | baseURL: '/api' 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/public/favicon.ico -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ln -s /app/ck-puck-front/node_modules/ node_modules 4 | nvm use 8.1.0 5 | npm set registry http://192.168.51.44 6 | npm install 7 | npm run build 8 | rm -rf /app/ck-puck-front/dist 9 | mkdir -p /app/ck-puck-front/dist 10 | cp -Rf ./dist /app/ck-puck-front/ 11 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/components/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 本项目二次封装的 UI 组件入口 3 | * @author Zhang Peng 4 | */ 5 | 6 | /****************************** 布局组件 ******************************/ 7 | export {default as Header} from './layout/Header/Header' 8 | export {default as Sidebar} from './layout/Sidebar/Sidebar' 9 | export {default as Content} from './layout/Content/Content' 10 | export {default as Footer} from './layout/Footer/Footer' 11 | export {default as Breadcrumb} from './layout/Breadcrumb/Breadcrumb' 12 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/components/layout/Breadcrumb/Breadcrumb.less: -------------------------------------------------------------------------------- 1 | .ant-layout-breadcrumb { 2 | z-index: 200; 3 | line-height: 64px; 4 | 5 | .ant-breadcrumb-link { 6 | font-size: 16px; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/components/layout/Content/Content.less: -------------------------------------------------------------------------------- 1 | .ant-layout-content { 2 | background: #fff; 3 | padding: 24px; 4 | } 5 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/components/layout/Footer/Footer.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 底部布局组件 3 | * @author Zhang Peng 4 | * @see https://ant.design/components/layout-cn/ 5 | */ 6 | import {Layout} from 'antd' 7 | import React from 'react' 8 | 9 | import './index.less' 10 | 11 | const {Footer} = Layout; 12 | 13 | /** 14 | * 底部布局组件 15 | * @class 16 | */ 17 | class CustomFooter extends React.PureComponent { 18 | render() { 19 | return (
20 | Ant Admin © 2017-2018 https://github.com/dunwu 21 |
) 22 | } 23 | } 24 | 25 | export default CustomFooter 26 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/components/layout/Footer/index.less: -------------------------------------------------------------------------------- 1 | .ant-layout-footer { 2 | height: 64px; 3 | line-height: 32px; 4 | text-align: center; 5 | font-size: 14px; 6 | color: #999; 7 | background: #fff; 8 | border-top: 1px solid #e9e9e9; 9 | width: 100%; 10 | } 11 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/components/layout/Header/Header.less: -------------------------------------------------------------------------------- 1 | .ant-layout-header { 2 | top: 0; 3 | right: 0; 4 | //height: 64px; 5 | //padding: 25px; 6 | z-index: 150; 7 | background: #fff; 8 | box-shadow: 0 0 1px 0 rgba(0, 0, 0, .3), 0 0 6px 2px rgba(0, 0, 0, .15); 9 | } 10 | 11 | .header-icon { 12 | margin: 0 15px; 13 | 14 | i { 15 | font-size: 20px; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/containers/Core/CoreContainer.less: -------------------------------------------------------------------------------- 1 | #root, div[data-reactroot] { 2 | height: 100%; 3 | } 4 | 5 | .ant-layout-has-sider { 6 | height: 100%; 7 | 8 | .ant-layout-container { 9 | padding-top: 30px; 10 | padding-bottom: 30px; 11 | padding-left: 50px; 12 | padding-right: 50px; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/containers/Core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CoreContainer", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./CoreContainer.jsx" 6 | } 7 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/containers/Root/RootContainer.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Root 容器模块是 antd-admin 的根组件 3 | * @author Zhang Peng 4 | * @see http://gaearon.github.io/react-hot-loader/getstarted/ 5 | */ 6 | if (process.env.NODE_ENV === 'development') { 7 | module.exports = require('./RootContainer.dev'); 8 | console.log('[development] Root.dev started.') 9 | } else { 10 | module.exports = require('./RootContainer.prod'); 11 | console.log('[production] Root.prod started.') 12 | } 13 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/redux/actions/menu.js: -------------------------------------------------------------------------------- 1 | const webapi = require('../../webapi'); 2 | import {REFRESH_MENU, REFRESH_NAVPATH} from '../constants/menuActionType' 3 | 4 | export const refreshNavPath = (path, key) => { 5 | return { 6 | type: REFRESH_NAVPATH, payload: { 7 | data: path, key: key 8 | } 9 | } 10 | }; 11 | 12 | export const refreshMenu = () => { 13 | return { 14 | type: REFRESH_MENU, payload: { 15 | promise: webapi.get('/menu') 16 | } 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/redux/constants/menuActionType.js: -------------------------------------------------------------------------------- 1 | export const REFRESH_MENU = 'REFRESH_MENU'; 2 | export const REFRESH_NAVPATH = 'REFRESH_NAVPATH'; 3 | export const REFRESH_MENU_SUCCESS = 'REFRESH_MENU_SUCCESS'; 4 | export const REFRESH_MENU_FAILED = 'REFRESH_MENU_FAILED'; 5 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/redux/reducers/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Zhang Peng on 2017/7/6. 3 | */ 4 | import {combineReducers} from 'redux' 5 | import auth from './auth' 6 | import menu from './menu' 7 | 8 | const rootReducer = combineReducers({ 9 | auth, menu 10 | }); 11 | export default rootReducer 12 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/redux/store/configureStore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Redux 创建Store入口,区分开发、生产环境 3 | * @author Zhang Peng 4 | * @see https://github.com/gaearon/redux-devtools/blob/master/docs/Walkthrough.md 5 | */ 6 | // Use DefinePlugin (Webpack) or loose-envify (Browserify) 7 | // together with Uglify to strip the dev branch in prod build. 8 | if (process.env.NODE_ENV === 'development') { 9 | module.exports = require('./configureStore.dev').default 10 | } else { 11 | module.exports = require('./configureStore.prod').default 12 | } 13 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/utils/index.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 工具类总入口 3 | * @desc 工具类总入口。 4 | *

原则上工具类都要在此注册,然后提供给外部模块

5 | * @author Zhang Peng 6 | */ 7 | 8 | export {default as authHOC} from './authHOC' 9 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/views/pages/home/Home.less: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | min-height: 600px; 4 | } 5 | 6 | .App-logo { 7 | animation: App-logo-spin infinite 20s linear; 8 | height: 80px; 9 | } 10 | 11 | .App-header { 12 | background-color: #ffebcc; 13 | height: 150px; 14 | padding: 20px; 15 | color: white; 16 | } 17 | 18 | .App-title { 19 | font-size: 1.5em; 20 | } 21 | 22 | .App-intro { 23 | font-size: large; 24 | } 25 | 26 | @keyframes App-logo-spin { 27 | from { 28 | transform: rotate(0deg); 29 | } 30 | to { 31 | transform: rotate(360deg); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/views/pages/login/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/views/pages/login/bg.jpg -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/views/pages/login/login-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/views/pages/login/login-logo.png -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/views/pages/user/User.less: -------------------------------------------------------------------------------- 1 | .user-view-row { 2 | padding-bottom: 15px; 3 | } 4 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/webapi/mock/user.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | code: 0, msg: ['成功'], data: {uid: '1', role: 'ADMIN', name: 'admin'} 3 | }; 4 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/webapi/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webapi", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./webapi.js" 6 | } 7 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-ui/spring-boot-web-ui-react/spring-boot-web-ui-react-frontend/src/webapi/webapi.js: -------------------------------------------------------------------------------- 1 | if (process.env.NODE_ENV === 'development') { 2 | module.exports = require('./mock').default 3 | } else { 4 | module.exports = require('../utils/http').default 5 | } 6 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-uploading/README.md: -------------------------------------------------------------------------------- 1 | # SpringBootTutorial :: Web :: Uploading 2 | 3 | > 源自:https://spring.io/guides/gs/uploading-files/ 4 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-uploading/src/main/java/io/github/dunwu/springboot/storage/StorageException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.storage; 2 | 3 | public class StorageException extends RuntimeException { 4 | 5 | public StorageException(String message) { 6 | super(message); 7 | } 8 | 9 | public StorageException(String message, Throwable cause) { 10 | super(message, cause); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-uploading/src/main/java/io/github/dunwu/springboot/storage/StorageFileNotFoundException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.storage; 2 | 3 | public class StorageFileNotFoundException extends StorageException { 4 | 5 | public StorageFileNotFoundException(String message) { 6 | super(message); 7 | } 8 | 9 | public StorageFileNotFoundException(String message, Throwable cause) { 10 | super(message, cause); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-uploading/src/main/java/io/github/dunwu/springboot/storage/StorageProperties.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.storage; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | 5 | @ConfigurationProperties("storage") 6 | public class StorageProperties { 7 | 8 | /** 9 | * Folder location for storing files 10 | */ 11 | private String location = "upload-dir"; 12 | 13 | public String getLocation() { 14 | return location; 15 | } 16 | 17 | public void setLocation(String location) { 18 | this.location = location; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-uploading/src/main/java/io/github/dunwu/springboot/storage/StorageService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.storage; 2 | 3 | import org.springframework.core.io.Resource; 4 | import org.springframework.web.multipart.MultipartFile; 5 | 6 | import java.nio.file.Path; 7 | import java.util.stream.Stream; 8 | 9 | public interface StorageService { 10 | 11 | void deleteAll(); 12 | 13 | void init(); 14 | 15 | Path load(String filename); 16 | 17 | Stream loadAll(); 18 | 19 | Resource loadAsResource(String filename); 20 | 21 | void store(MultipartFile file); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-uploading/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.servlet.multipart.max-file-size = 128KB 2 | spring.servlet.multipart.max-request-size = 128KB 3 | spring.http.multipart.enabled = false 4 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-uploading/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-uploading/src/test/resources/io/github/dunwu/springboot/testupload.txt: -------------------------------------------------------------------------------- 1 | Spring Framework -------------------------------------------------------------------------------- /codes/web/spring-boot-web-websocket/src/main/java/io/github/dunwu/springboot/client/GreetingService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.client; 2 | 3 | public interface GreetingService { 4 | 5 | String getGreeting(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-websocket/src/main/java/io/github/dunwu/springboot/client/SimpleGreetingService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.client; 2 | 3 | public class SimpleGreetingService implements GreetingService { 4 | 5 | @Override 6 | public String getGreeting() { 7 | return "Hello world!"; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-websocket/src/main/java/io/github/dunwu/springboot/echo/DefaultEchoService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.echo; 2 | 3 | public class DefaultEchoService implements EchoService { 4 | 5 | private final String echoFormat; 6 | 7 | public DefaultEchoService(String echoFormat) { 8 | this.echoFormat = (echoFormat != null) ? echoFormat : "%s"; 9 | } 10 | 11 | @Override 12 | public String getMessage(String message) { 13 | return String.format(this.echoFormat, message); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-websocket/src/main/java/io/github/dunwu/springboot/echo/EchoService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.echo; 2 | 3 | public interface EchoService { 4 | 5 | String getMessage(String message); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-websocket/src/main/java/io/github/dunwu/springboot/reverse/ReverseWebSocketEndpoint.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.reverse; 2 | 3 | import java.io.IOException; 4 | import javax.websocket.OnMessage; 5 | import javax.websocket.Session; 6 | import javax.websocket.server.ServerEndpoint; 7 | 8 | @ServerEndpoint("/reverse") 9 | public class ReverseWebSocketEndpoint { 10 | 11 | @OnMessage 12 | public void handleMessage(Session session, String message) throws IOException { 13 | session.getBasicRemote().sendText("Reversed: " + new StringBuilder(message).reverse()); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-websocket/src/main/java/io/github/dunwu/springboot/snake/Direction.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.snake; 2 | 3 | public enum Direction { 4 | 5 | NONE, 6 | NORTH, 7 | SOUTH, 8 | EAST, 9 | WEST 10 | } 11 | -------------------------------------------------------------------------------- /codes/web/spring-boot-web-websocket/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/.vuepress/config/baiduCode.js: -------------------------------------------------------------------------------- 1 | module.exports = ''; 2 | -------------------------------------------------------------------------------- /docs/.vuepress/enhanceApp.js: -------------------------------------------------------------------------------- 1 | // import vue from 'vue/dist/vue.esm.browser' 2 | export default ({ 3 | Vue, // VuePress 正在使用的 Vue 构造函数 4 | options, // 附加到根实例的一些选项 5 | router, // 当前应用的路由实例 6 | siteData // 站点元数据 7 | }) => { 8 | // window.Vue = vue // 使页面中可以使用Vue构造函数 (使页面中的vue demo生效) 9 | } 10 | -------------------------------------------------------------------------------- /docs/.vuepress/plugins/love-me/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const LoveMyPlugin = (options = {}) => ({ 3 | define() { 4 | const COLOR = 5 | options.color || 6 | 'rgb(' + ~~(255 * Math.random()) + ',' + ~~(255 * Math.random()) + ',' + ~~(255 * Math.random()) + ')' 7 | const EXCLUDECLASS = options.excludeClassName || '' 8 | return { COLOR, EXCLUDECLASS } 9 | }, 10 | enhanceAppFiles: [path.resolve(__dirname, 'love-me.js')], 11 | }) 12 | module.exports = LoveMyPlugin 13 | -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/docs/.vuepress/public/favicon.ico -------------------------------------------------------------------------------- /docs/.vuepress/public/img/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/docs/.vuepress/public/img/bg.gif -------------------------------------------------------------------------------- /docs/.vuepress/public/img/dunwu-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/docs/.vuepress/public/img/dunwu-logo.png -------------------------------------------------------------------------------- /docs/.vuepress/public/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/docs/.vuepress/public/img/favicon.ico -------------------------------------------------------------------------------- /docs/.vuepress/public/img/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/docs/.vuepress/public/img/more.png -------------------------------------------------------------------------------- /docs/.vuepress/public/img/other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-boot-tutorial/c5d0bd2050179502291f5cc72092a93575c44da2/docs/.vuepress/public/img/other.png -------------------------------------------------------------------------------- /docs/@pages/archivesPage.md: -------------------------------------------------------------------------------- 1 | --- 2 | archivesPage: true 3 | title: 归档 4 | permalink: /archives/ 5 | article: false 6 | --- 7 | -------------------------------------------------------------------------------- /docs/@pages/categoriesPage.md: -------------------------------------------------------------------------------- 1 | --- 2 | categoriesPage: true 3 | title: 分类 4 | permalink: /categories/ 5 | article: false 6 | --- 7 | -------------------------------------------------------------------------------- /docs/@pages/tagsPage.md: -------------------------------------------------------------------------------- 1 | --- 2 | tagsPage: true 3 | title: 标签 4 | permalink: /tags/ 5 | article: false 6 | --- 7 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://prettier.io/docs/en/options.html 3 | * @see https://prettier.io/docs/en/configuration.html 4 | */ 5 | module.exports = { 6 | tabWidth: 2, 7 | semi: false, 8 | singleQuote: true, 9 | } 10 | -------------------------------------------------------------------------------- /utils/config.yml: -------------------------------------------------------------------------------- 1 | #批量添加和修改、删除front matter配置文件 2 | 3 | # 需要批量处理的路径,docs文件夹内的文件夹 (数组,映射路径:path[0]/path[1]/path[2] ... ) 4 | path: 5 | - docs # 第一个成员必须是docs 6 | 7 | # 要删除的字段 (数组) 8 | delete: 9 | # - tags 10 | 11 | # 要添加、修改front matter的数据 (front matter中没有的数据则添加,已有的数据则覆盖) 12 | data: 13 | # author: 14 | # name: xugaoyi 15 | # link: https://github.com/xugaoyi 16 | --------------------------------------------------------------------------------