├── .gitignore ├── README.md ├── Spring-Boot-ActiveMQ ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── activemq │ │ │ ├── SpringBootActiveMqApplication.java │ │ │ ├── bean │ │ │ └── User.java │ │ │ ├── config │ │ │ └── ActivemqConfig.java │ │ │ ├── controller │ │ │ └── ProducerController.java │ │ │ └── service │ │ │ ├── Consumer1.java │ │ │ └── Consumer2.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── example │ └── activemq │ └── SpringBootActiveMqApplicationTests.java ├── Spring-Boot-Admin ├── Spring-Boot-Admin-Client │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── client │ │ │ │ └── SpringBootAdminClientApplication.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── client │ │ └── SpringBootAdminClientApplicationTests.java └── Spring-Boot-Admin-Server │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── server │ │ │ └── SpringBootAdminServerApplication.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── example │ └── server │ └── SpringBootAdminServerApplicationTests.java ├── Spring-Boot-Aop-Log ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── aoplog │ │ │ ├── SpringBootAopLogApplication.java │ │ │ ├── annotation │ │ │ └── Log.java │ │ │ ├── aspect │ │ │ └── LogAspect.java │ │ │ ├── bean │ │ │ └── SysLog.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ ├── dao │ │ │ └── SysLogMapper.java │ │ │ └── utils │ │ │ ├── HttpContextUtils.java │ │ │ └── IPUtils.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ └── mapper │ │ └── SysLogMapper.xml │ └── test │ └── java │ └── com │ └── example │ └── aoplog │ └── SpringBootAopLogApplicationTests.java ├── Spring-Boot-Async ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── async │ │ │ ├── SpringBootAsyncApplication.java │ │ │ ├── config │ │ │ └── AsyncPoolConfig.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ └── service │ │ │ ├── TestReturnService.java │ │ │ └── TestService.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── async │ └── SpringBootAsyncApplicationTests.java ├── Spring-Boot-Autoconfig ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── autoconfig │ │ │ ├── SpringBootAutoconfigApplication.java │ │ │ ├── annotation │ │ │ ├── CustomService.java │ │ │ └── EnableHelloWorld.java │ │ │ ├── bootstrap │ │ │ ├── EnableAutoConfigurationBootstrap.java │ │ │ ├── ServiceBootstrap.java │ │ │ └── TestEnableBootstap.java │ │ │ ├── configuration │ │ │ ├── HelloWorldAutoConfiguration.java │ │ │ └── HelloWorldConfiguration.java │ │ │ ├── selector │ │ │ └── HelloWorldImportSelector.java │ │ │ └── service │ │ │ └── TestService.java │ └── resources │ │ ├── META-INF │ │ └── spring.factories │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── autoconfig │ └── SpringBootAutoconfigApplicationTests.java ├── Spring-Boot-Cors-Support ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── corssupport │ │ │ ├── SpringBootCorsSupportApplication.java │ │ │ ├── config │ │ │ ├── CorsConfig.java │ │ │ └── WebConfigurer.java │ │ │ └── controller │ │ │ └── TestController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── example │ └── corssupport │ └── SpringBootCorsSupportApplicationTests.java ├── Spring-Boot-Ehcache-Anno ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── ehcache │ │ │ ├── SpringBootEhcacheAnnoApplication.java │ │ │ ├── bean │ │ │ └── Student.java │ │ │ ├── controller │ │ │ └── StudentController.java │ │ │ ├── dao │ │ │ └── StudentMapper.java │ │ │ └── service │ │ │ ├── StudentService.java │ │ │ └── impl │ │ │ └── StudentServiceImpl.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ ├── ehcache.xml │ │ └── mapper │ │ └── StudentMapper.xml │ └── test │ └── java │ └── com │ └── example │ └── ehcache │ └── SpringBootEhcacheAnnoApplicationTests.java ├── Spring-Boot-Elasticsearch ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── example │ │ └── elasticsearch │ │ ├── SpringBootElasticsearchApplication.java │ │ ├── config │ │ ├── ExceptionAdvice.java │ │ ├── RestClientConfig.java │ │ └── WebMvcConfig.java │ │ ├── controller │ │ ├── HighLevelRestController.java │ │ ├── IndexController.java │ │ └── LowLevelRestController.java │ │ ├── domain │ │ ├── BookDto.java │ │ ├── Constant.java │ │ └── ResponseBean.java │ │ └── exception │ │ ├── CustomException.java │ │ └── SystemException.java │ └── resources │ ├── application.properties │ ├── application.yml │ ├── static │ ├── element-ui │ │ ├── fonts │ │ │ ├── element-icons.ttf │ │ │ └── element-icons.woff │ │ ├── index.css │ │ └── index.js │ ├── favicon.ico │ └── js │ │ ├── axios.min.js │ │ ├── moment.min.js │ │ └── vue.min.js │ └── templates │ ├── common │ └── common.html │ └── index.html ├── Spring-Boot-Error-Controller ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── errorcontroller │ │ │ ├── SpringBootErrorControllerApplication.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ └── exception │ │ │ ├── ErrorInfo.java │ │ │ ├── ErrorInfoBuilder.java │ │ │ └── GlobalErrorController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── error.html │ └── test │ └── java │ └── com │ └── example │ └── errorcontroller │ └── SpringBootErrorControllerApplicationTests.java ├── Spring-Boot-Error-Handler ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── errorhandler │ │ │ ├── SpringBootErrorHandlerApplication.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ └── exception │ │ │ ├── ErrorInfo.java │ │ │ ├── ErrorInfoBuilder.java │ │ │ └── GlobalErrorHandler.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── error.html │ └── test │ └── java │ └── com │ └── example │ └── errorhandler │ └── SpringBootErrorHandlerApplicationTests.java ├── Spring-Boot-FastDFS ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── fastdfs │ │ │ ├── SpringBootFastDfsApplication.java │ │ │ ├── bean │ │ │ └── FastDFSProperties.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ └── util │ │ │ └── FastDFSUtil.java │ └── resources │ │ ├── application.yml │ │ └── templates │ │ ├── upload.html │ │ └── uploadStatus.html │ └── test │ └── java │ └── com │ └── example │ └── fastdfs │ └── SpringBootFastDfsApplicationTests.java ├── Spring-Boot-Filter-Listener-Interceptor ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── filterlistenerinterceptor │ │ │ ├── SpringBootFilterListenerInterceptorApplication.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ ├── filter │ │ │ ├── CustomFilter.java │ │ │ └── WebConfig.java │ │ │ ├── interceptor │ │ │ ├── CustomHandlerInterceptor.java │ │ │ ├── InterceptorConf.java │ │ │ └── InterceptorConf1.java │ │ │ └── listener │ │ │ └── CustomListener.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── example │ └── filterlistenerinterceptor │ └── SpringBootFilterListenerInterceptorApplicationTests.java ├── Spring-Boot-Hibernate-Validator ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── hibernatevalidator │ │ │ ├── SpringBootHibernateValidatorApplication.java │ │ │ ├── bean │ │ │ └── User.java │ │ │ ├── config │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── MyConstraint.java │ │ │ └── MyConstraintValidator.java │ │ │ └── controller │ │ │ ├── TestBeanController.java │ │ │ ├── TestCustomController.java │ │ │ └── TestParamController.java │ └── resources │ │ ├── ValidationMessages.properties │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── hibernatevalidator │ └── SpringBootHibernateValidatorApplicationTests.java ├── Spring-Boot-Https ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── https │ │ │ ├── SpringBootHttpsApplication.java │ │ │ ├── config │ │ │ └── Http2Https.java │ │ │ └── controller │ │ │ └── HttpsController.java │ └── resources │ │ ├── application.yml │ │ └── springboot_https.keystore │ └── test │ └── java │ └── com │ └── example │ └── https │ └── SpringBootHttpsApplicationTests.java ├── Spring-Boot-Jackson ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── jackson │ │ │ ├── SpringBootJacksonApplication.java │ │ │ ├── bean │ │ │ └── User.java │ │ │ ├── config │ │ │ ├── JacksonConfig.java │ │ │ ├── UserDeserializer.java │ │ │ └── UserSerializer.java │ │ │ └── controller │ │ │ └── TestController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── jackson │ └── SpringBootJacksonApplicationTests.java ├── Spring-Boot-Jasypt ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── jasypt │ │ │ ├── SpringBootJasyptApplication.java │ │ │ └── controller │ │ │ └── TestController.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── example │ └── jasypt │ └── SpringBootJasyptApplicationTests.java ├── Spring-Boot-JdbcTemplate ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── jdbctemplate │ │ │ ├── SpringBootJdbcTemplateApplication.java │ │ │ ├── bean │ │ │ ├── Student.java │ │ │ └── StudentObj.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ ├── mapper │ │ │ ├── StudentMapper.java │ │ │ └── impl │ │ │ │ └── StudentMapperImpl.java │ │ │ └── service │ │ │ ├── StudentService.java │ │ │ └── impl │ │ │ └── StudentServiceImpl.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── example │ └── jdbctemplate │ └── SpringBootJdbcTemplateApplicationTests.java ├── Spring-Boot-Kafka ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── kafka │ │ │ ├── SpringBootKafkaApplication.java │ │ │ ├── config │ │ │ ├── KafkaConsumerConfig.java │ │ │ └── KafkaProducerConfig.java │ │ │ ├── consumer │ │ │ └── KafkaMessageConsumer.java │ │ │ ├── controller │ │ │ └── SendMessageController.java │ │ │ └── entity │ │ │ └── Message.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── example │ └── kafka │ └── SpringBootKafkaApplicationTests.java ├── Spring-Boot-Logback ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── logback │ │ │ ├── SpringBootLogbackApplication.java │ │ │ ├── bean │ │ │ └── User.java │ │ │ └── controller │ │ │ └── TestController.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ └── logback-spring.xml │ └── test │ └── java │ └── com │ └── example │ └── logback │ └── SpringBootLogbackApplicationTests.java ├── Spring-Boot-Mail ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── mail │ │ │ ├── SpringBootMailApplication.java │ │ │ └── controller │ │ │ └── MailController.java │ └── resources │ │ ├── application-qq.yml │ │ ├── application-wangyi.yml │ │ ├── application.properties │ │ ├── application.yml │ │ ├── static │ │ ├── file │ │ │ └── 项目文档.docx │ │ └── img │ │ │ └── 优秀.jpg │ │ └── templates │ │ └── emailTemplate.html │ └── test │ └── java │ └── com │ └── example │ └── mail │ └── SpringBootMailApplicationTests.java ├── Spring-Boot-Mapper-PageHelper ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── mapperpagehelper │ │ │ ├── SpringBootMapperPageHelperApplication.java │ │ │ ├── bean │ │ │ └── User.java │ │ │ ├── config │ │ │ └── MyMapper.java │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ └── service │ │ │ ├── IService.java │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ ├── BaseServiceImpl.java │ │ │ └── UserServiceImpl.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ ├── generatorConfig.xml │ │ └── mapper │ │ └── UserMapper.xml │ └── test │ └── java │ └── com │ └── example │ └── mapperpagehelper │ └── SpringBootMapperPageHelperApplicationTests.java ├── Spring-Boot-MongoDB ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── mongodb │ │ │ ├── SpringBootMongoDbApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ └── service │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ └── UserServiceImpl.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── example │ └── mongodb │ └── SpringBootMongoDbApplicationTests.java ├── Spring-Boot-MultiDS1 ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── multidatasource │ │ │ ├── SpringBootMultiDs1Application.java │ │ │ ├── config │ │ │ ├── MysqlDatasourceConfig.java │ │ │ └── OracleDatasourceConfig.java │ │ │ ├── controller │ │ │ └── StudentController.java │ │ │ ├── mysqldao │ │ │ └── MysqlStudentMapper.java │ │ │ ├── oracledao │ │ │ └── OracleStudentMapper.java │ │ │ └── service │ │ │ ├── StudentService.java │ │ │ └── impl │ │ │ └── StudentServiceImpl.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ ├── application1.properties │ │ └── mapper │ │ ├── mysql │ │ └── MysqlStudentMapper.xml │ │ └── oracle │ │ └── OracleStudentMapper.xml │ └── test │ └── java │ └── com │ └── example │ └── multidatasource │ └── SpringBootMultiDs1ApplicationTests.java ├── Spring-Boot-MultiDS2-Switch ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── multidatasource │ │ │ ├── SpringBootMultiDs2SwitchApplication.java │ │ │ ├── controller │ │ │ └── DataSourceController.java │ │ │ ├── dao │ │ │ └── StudentMapper.java │ │ │ ├── datasourceConfig │ │ │ ├── DynamicDataSource.java │ │ │ ├── DynamicDataSourceAspect.java │ │ │ ├── DynamicDataSourceContextHolder.java │ │ │ ├── DynamicDataSourceRegister.java │ │ │ └── TargetDataSource.java │ │ │ └── service │ │ │ ├── StudentService.java │ │ │ └── impl │ │ │ └── StudentServiceImpl.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ └── mapper │ │ └── StudentMapper.xml │ └── test │ └── java │ └── com │ └── example │ └── multidatasource │ └── SpringBootMultiDs2SwitchApplicationTests.java ├── Spring-Boot-Mybatis ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── mybatis │ │ │ ├── SpringBootMybatisApplication.java │ │ │ ├── bean │ │ │ └── Student.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ ├── mapper │ │ │ └── StudentMapper.java │ │ │ └── service │ │ │ ├── StudentService.java │ │ │ └── impl │ │ │ └── StudentServiceImpl.java │ └── resources │ │ ├── application.yml │ │ └── mapper │ │ └── StudentMapper.xml │ └── test │ └── java │ └── com │ └── example │ └── mybatis │ └── SpringBootMybatisApplicationTests.java ├── Spring-Boot-MybatisPlus ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── mybatisplus │ │ │ ├── SpringBootMybatisPlusApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ └── service │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ └── UserServiceImpl.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ └── mapper │ │ └── UserMapper.xml │ └── test │ └── java │ └── com │ └── example │ └── mybatisplus │ └── SpringBootMybatisPlusApplicationTests.java ├── Spring-Boot-Quartz ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── quartz │ │ │ ├── SpringBootQuartzApplication.java │ │ │ ├── config │ │ │ └── SchedulerConfig.java │ │ │ ├── controller │ │ │ └── SchedulerController.java │ │ │ ├── dao │ │ │ └── JobAndTriggerMapper.java │ │ │ ├── entity │ │ │ └── JobAndTrigger.java │ │ │ ├── job │ │ │ ├── BaseJob.java │ │ │ ├── HelloJob.java │ │ │ └── NewJob.java │ │ │ └── service │ │ │ ├── JobAndTriggerService.java │ │ │ └── impl │ │ │ └── JobAndTriggerServiceImpl.java │ └── resources │ │ ├── application.yml │ │ ├── file │ │ ├── JobManager.html │ │ ├── quartz-mysql.sql │ │ └── quartzConfig.txt │ │ ├── mapper │ │ └── JobAndTriggerMapper.xml │ │ └── quartz.properties │ └── test │ └── java │ └── com │ └── example │ └── quartz │ └── SpringBootQuartzApplicationTests.java ├── Spring-Boot-Rabbit-Reliable-Delivery ├── Rabbitmq-Common │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── common │ │ │ └── domain │ │ │ ├── BrokerMessageLog.java │ │ │ ├── BrokerMessageLogExample.java │ │ │ ├── Order.java │ │ │ └── OrderExample.java │ │ └── resources │ │ └── application.properties ├── Rabbitmq-Customer │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── customer │ │ │ │ ├── RabbitmqCustomerApplication.java │ │ │ │ ├── config │ │ │ │ └── RabbitMqConfig.java │ │ │ │ └── consumer │ │ │ │ └── OrderReceiver.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── customer │ │ └── RabbitmqCustomerApplicationTests.java ├── Rabbitmq-Publisher │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── publisher │ │ │ │ ├── SpringBootRabbitmqPublisherApplication.java │ │ │ │ ├── constants │ │ │ │ └── Constants.java │ │ │ │ ├── controller │ │ │ │ └── IndexController.java │ │ │ │ ├── mapper │ │ │ │ ├── BrokerMessageLogMapper.java │ │ │ │ └── OrderMapper.java │ │ │ │ ├── producer │ │ │ │ └── OrderSender.java │ │ │ │ ├── service │ │ │ │ ├── OrderService.java │ │ │ │ └── impl │ │ │ │ │ └── OrderServiceImpl.java │ │ │ │ └── task │ │ │ │ ├── TaskConfig.java │ │ │ │ └── TrySendTask.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── generatorConfig.xml │ │ │ └── mappers │ │ │ ├── BrokerMessageLogMapper.xml │ │ │ └── OrderMapper.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── publisher │ │ └── SpringBootRabbitmqPublisherApplicationTests.java ├── imgs │ ├── RabbitMQ1.jpg │ └── RabbitMQ2.jpg ├── pom.xml └── test.sql ├── Spring-Boot-RabbitMQ ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── rabbitmq │ │ │ ├── SpringBootRabbitMqApplication.java │ │ │ ├── config │ │ │ ├── ListenerConfig.java │ │ │ └── TtlConfig.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ ├── domain │ │ │ └── Student.java │ │ │ └── listener │ │ │ ├── MyAckListener.java │ │ │ ├── MyDeadLetterListener.java │ │ │ ├── MyDefaultListener.java │ │ │ ├── MyDirectListener.java │ │ │ ├── MyFanoutListener.java │ │ │ ├── MyHeadListener.java │ │ │ ├── MyJasonListener.java │ │ │ ├── MyPluginListener.java │ │ │ ├── MyTopicListener.java │ │ │ └── MyWorkListener.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── example │ └── rabbitmq │ └── SpringBootRabbitMqApplicationTests.java ├── Spring-Boot-Redis-Anno ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── redis │ │ │ ├── SpringBootRedisAnnoApplication.java │ │ │ ├── bean │ │ │ └── Student.java │ │ │ ├── config │ │ │ └── RedisConfig.java │ │ │ ├── controller │ │ │ └── StudentController.java │ │ │ ├── dao │ │ │ └── StudentMapper.java │ │ │ └── service │ │ │ ├── StudentService.java │ │ │ └── impl │ │ │ └── StudentServiceImpl.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ └── mapper │ │ └── StudentMapper.xml │ └── test │ └── java │ └── com │ └── example │ └── redis │ └── SpringBootRedisAnnoApplicationTests.java ├── Spring-Boot-Smartdoc ├── doc │ └── markdown │ │ └── AllInOne-V202001091931.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── smartdoc │ │ │ ├── SpringBootSmartdocApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ └── model │ │ │ └── User.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── smartdoc │ └── SpringBootSmartdocApplicationTests.java ├── Spring-Boot-Socket ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── socket │ │ │ ├── SpringBootSocketApplication.java │ │ │ ├── client │ │ │ └── Client.java │ │ │ └── server │ │ │ ├── Server.java │ │ │ ├── Server1.java │ │ │ ├── Server2.java │ │ │ └── Server3.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── socket │ └── SpringBootSocketApplicationTests.java ├── Spring-Boot-Starter ├── myapp-spring-boot-autoconfigure │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── codeming │ │ │ └── starter │ │ │ ├── HelloProperties.java │ │ │ ├── HelloService.java │ │ │ └── HelloServiceAutoConfiguration.java │ │ └── resources │ │ └── META-INF │ │ └── spring.factories ├── myapp-spring-boot-starter-test │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── codeming │ │ │ │ └── startertest │ │ │ │ ├── MyappSpringBootStarterTestApplication.java │ │ │ │ └── controller │ │ │ │ └── HelloController.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── codeming │ │ └── startertest │ │ └── MyappSpringBootStarterTestApplicationTests.java └── myapp-spring-boot-starter │ ├── .idea │ ├── $CACHE_FILE$ │ ├── compiler.xml │ ├── encodings.xml │ ├── inspectionProfiles │ │ └── Project_Default.xml │ ├── misc.xml │ ├── vcs.xml │ └── workspace.xml │ ├── myapp-spring-boot-starter.iml │ └── pom.xml ├── Spring-Boot-Swagger2 ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── swagger2 │ │ │ ├── SpringBootSwagger2Application.java │ │ │ ├── bean │ │ │ └── User.java │ │ │ ├── config │ │ │ └── SwaggerConfig.java │ │ │ └── controller │ │ │ └── UserController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── swagger2 │ └── SpringBootSwagger2ApplicationTests.java ├── Spring-Boot-Swaggerdoc ├── docs │ ├── asciidoc │ │ ├── generated │ │ │ ├── all.adoc │ │ │ ├── definitions.adoc │ │ │ ├── overview.adoc │ │ │ ├── paths.adoc │ │ │ └── security.adoc │ │ ├── html │ │ │ ├── all.html │ │ │ ├── definitions.html │ │ │ ├── overview.html │ │ │ ├── paths.html │ │ │ └── security.html │ │ └── pdf │ │ │ ├── all.pdf │ │ │ ├── definitions.pdf │ │ │ ├── overview.pdf │ │ │ ├── paths.pdf │ │ │ └── security.pdf │ ├── confluence │ │ └── generated │ │ │ ├── all.txt │ │ │ ├── definitions.txt │ │ │ ├── overview.txt │ │ │ ├── paths.txt │ │ │ └── security.txt │ └── markdown │ │ └── generated │ │ ├── all.md │ │ ├── definitions.md │ │ ├── overview.md │ │ ├── paths.md │ │ └── security.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── swaggerdoc │ │ │ ├── SpringBootSwaggerdocApplication.java │ │ │ ├── config │ │ │ └── SwaggerConfig.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── util │ │ │ └── SwaggerUtils.java │ └── resources │ │ ├── application.properties │ │ ├── fonts │ │ ├── KaiGenGothicCN-Bold-Italic.ttf │ │ ├── KaiGenGothicCN-Bold.ttf │ │ ├── KaiGenGothicCN-Regular-Italic.ttf │ │ ├── KaiGenGothicCN-Regular.ttf │ │ ├── RobotoMono-Bold.ttf │ │ ├── RobotoMono-BoldItalic.ttf │ │ ├── RobotoMono-Italic.ttf │ │ └── RobotoMono-Regular.ttf │ │ └── themes │ │ ├── cn-theme.yml │ │ ├── jp-theme.yml │ │ ├── kr-theme.yml │ │ └── tw-theme.yml │ └── test │ └── java │ └── com │ └── example │ └── swaggerdoc │ └── SpringBootSwaggerdocApplicationTests.java ├── Spring-Boot-Test ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── test │ │ │ ├── SpringBootTestApplication.java │ │ │ ├── bean │ │ │ └── User.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── dao │ │ │ └── UserMapper.java │ │ │ └── service │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ └── UserServiceImpl.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ └── mapper │ │ └── UserMapper.xml │ └── test │ └── java │ └── com │ └── example │ └── test │ └── SpringBootTestApplicationTests.java ├── Spring-Boot-Thymeleaf ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── thymeleaf │ │ │ ├── SpringBootThymeleafApplication.java │ │ │ ├── bean │ │ │ └── User.java │ │ │ └── controller │ │ │ └── IndexController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── example │ └── thymeleaf │ └── SpringBootThymeleafApplicationTests.java ├── Spring-Boot-Updownload ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── updownload │ │ │ ├── SpringBootUpdownloadApplication.java │ │ │ └── controller │ │ │ ├── FileDownloadController.java │ │ │ └── FileUploadController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── download.html │ │ ├── upload.html │ │ └── uploadBatch.html │ └── test │ └── java │ └── com │ └── example │ └── updownload │ └── SpringBootUpdownloadApplicationTests.java ├── Spring-Boot-WebService ├── .idea │ ├── $CACHE_FILE$ │ ├── .gitignore │ ├── Spring-Boot-WebService.iml │ ├── compiler.xml │ ├── encodings.xml │ ├── libraries │ │ ├── Maven__ch_qos_logback_logback_classic_1_2_3.xml │ │ ├── Maven__ch_qos_logback_logback_core_1_2_3.xml │ │ ├── Maven__com_fasterxml_classmate_1_4_0.xml │ │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_10.xml │ │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_9_10.xml │ │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_9_10_1.xml │ │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_10.xml │ │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_10.xml │ │ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_10.xml │ │ ├── Maven__com_fasterxml_woodstox_woodstox_core_5_0_3.xml │ │ ├── Maven__com_jayway_jsonpath_json_path_2_4_0.xml │ │ ├── Maven__com_sun_activation_javax_activation_1_2_0.xml │ │ ├── Maven__com_sun_istack_istack_commons_runtime_3_0_7.xml │ │ ├── Maven__com_sun_xml_fastinfoset_FastInfoset_1_2_15.xml │ │ ├── Maven__com_sun_xml_messaging_saaj_saaj_impl_1_5_0.xml │ │ ├── Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml │ │ ├── Maven__jakarta_activation_jakarta_activation_api_1_2_1.xml │ │ ├── Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_2.xml │ │ ├── Maven__javax_activation_javax_activation_api_1_2_0.xml │ │ ├── Maven__javax_annotation_javax_annotation_api_1_3_2.xml │ │ ├── Maven__javax_validation_validation_api_2_0_1_Final.xml │ │ ├── Maven__javax_xml_bind_jaxb_api_2_3_1.xml │ │ ├── Maven__javax_xml_soap_javax_xml_soap_api_1_4_0.xml │ │ ├── Maven__javax_xml_ws_jaxws_api_2_3_1.xml │ │ ├── Maven__junit_junit_4_12.xml │ │ ├── Maven__net_bytebuddy_byte_buddy_1_9_16.xml │ │ ├── Maven__net_bytebuddy_byte_buddy_agent_1_9_16.xml │ │ ├── Maven__net_minidev_accessors_smart_1_2.xml │ │ ├── Maven__net_minidev_json_smart_2_3.xml │ │ ├── Maven__org_apache_cxf_cxf_core_3_3_4.xml │ │ ├── Maven__org_apache_cxf_cxf_rt_bindings_soap_3_3_4.xml │ │ ├── Maven__org_apache_cxf_cxf_rt_bindings_xml_3_3_4.xml │ │ ├── Maven__org_apache_cxf_cxf_rt_databinding_jaxb_3_3_4.xml │ │ ├── Maven__org_apache_cxf_cxf_rt_frontend_jaxws_3_3_4.xml │ │ ├── Maven__org_apache_cxf_cxf_rt_frontend_simple_3_3_4.xml │ │ ├── Maven__org_apache_cxf_cxf_rt_transports_http_3_3_4.xml │ │ ├── Maven__org_apache_cxf_cxf_rt_ws_addr_3_3_4.xml │ │ ├── Maven__org_apache_cxf_cxf_rt_ws_policy_3_3_4.xml │ │ ├── Maven__org_apache_cxf_cxf_rt_wsdl_3_3_4.xml │ │ ├── Maven__org_apache_geronimo_specs_geronimo_jta_1_1_spec_1_1_1.xml │ │ ├── Maven__org_apache_geronimo_specs_geronimo_ws_metadata_2_0_spec_1_1_3.xml │ │ ├── Maven__org_apache_logging_log4j_log4j_api_2_11_2.xml │ │ ├── Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_2.xml │ │ ├── Maven__org_apache_neethi_neethi_3_1_1.xml │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_29.xml │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_29.xml │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_29.xml │ │ ├── Maven__org_apache_ws_xmlschema_xmlschema_core_2_2_4.xml │ │ ├── Maven__org_assertj_assertj_core_3_11_1.xml │ │ ├── Maven__org_codehaus_woodstox_stax2_api_3_1_4.xml │ │ ├── Maven__org_glassfish_jaxb_jaxb_runtime_2_3_1.xml │ │ ├── Maven__org_glassfish_jaxb_txw2_2_3_1.xml │ │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ │ ├── Maven__org_hamcrest_hamcrest_library_1_3.xml │ │ ├── Maven__org_hibernate_validator_hibernate_validator_6_0_18_Final.xml │ │ ├── Maven__org_jacorb_jacorb_omgapi_3_7.xml │ │ ├── Maven__org_jboss_logging_jboss_logging_3_3_3_Final.xml │ │ ├── Maven__org_jboss_spec_javax_rmi_jboss_rmi_api_1_0_spec_1_0_6_Final.xml │ │ ├── Maven__org_jvnet_mimepull_mimepull_1_9_12.xml │ │ ├── Maven__org_jvnet_staxex_stax_ex_1_8.xml │ │ ├── Maven__org_mockito_mockito_core_2_23_4.xml │ │ ├── Maven__org_objenesis_objenesis_2_6.xml │ │ ├── Maven__org_ow2_asm_asm_7_1.xml │ │ ├── Maven__org_skyscreamer_jsonassert_1_5_0.xml │ │ ├── Maven__org_slf4j_jul_to_slf4j_1_7_29.xml │ │ ├── Maven__org_slf4j_slf4j_api_1_7_29.xml │ │ ├── Maven__org_springframework_boot_spring_boot_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_test_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_web_services_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_test_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_11_RELEASE.xml │ │ ├── Maven__org_springframework_spring_aop_5_1_12_RELEASE.xml │ │ ├── Maven__org_springframework_spring_beans_5_1_12_RELEASE.xml │ │ ├── Maven__org_springframework_spring_context_5_1_12_RELEASE.xml │ │ ├── Maven__org_springframework_spring_core_5_1_12_RELEASE.xml │ │ ├── Maven__org_springframework_spring_expression_5_1_12_RELEASE.xml │ │ ├── Maven__org_springframework_spring_jcl_5_1_12_RELEASE.xml │ │ ├── Maven__org_springframework_spring_oxm_5_1_12_RELEASE.xml │ │ ├── Maven__org_springframework_spring_test_5_1_12_RELEASE.xml │ │ ├── Maven__org_springframework_spring_web_5_1_12_RELEASE.xml │ │ ├── Maven__org_springframework_spring_webmvc_5_1_12_RELEASE.xml │ │ ├── Maven__org_springframework_ws_spring_ws_core_3_0_8_RELEASE.xml │ │ ├── Maven__org_springframework_ws_spring_xml_3_0_8_RELEASE.xml │ │ ├── Maven__org_xmlunit_xmlunit_core_2_6_3.xml │ │ ├── Maven__org_yaml_snakeyaml_1_23.xml │ │ ├── Maven__wsdl4j_wsdl4j_1_6_3.xml │ │ └── Maven__xml_resolver_xml_resolver_1_2.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── WebService-Client │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── client │ │ │ │ ├── WebServiceClientApplication.java │ │ │ │ └── controller │ │ │ │ └── TestController.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── client │ │ └── WebServiceClientApplicationTests.java └── WebService-Server │ ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── server │ │ │ ├── WebServiceServerApplication.java │ │ │ ├── config │ │ │ └── CxfConfig.java │ │ │ └── service │ │ │ ├── DemoService.java │ │ │ └── impl │ │ │ └── DemoServiceImpl.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── server │ └── WebServiceServerApplicationTests.java ├── Spring-Boot-Webflux-MongoDB ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── mongodb │ │ │ ├── SpringBootMongoDbWebfluxApplication.java │ │ │ ├── config │ │ │ ├── AsyncServlet.java │ │ │ └── SyncServlet.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ └── service │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ └── UserServiceImpl.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── example │ └── mongodb │ └── SpringBootMongoDbWebfluxApplicationTests.java ├── Spring-Boot-Websocket-Redis ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── websocket │ │ │ ├── SpringBootWebsocketRedisApplication.java │ │ │ ├── config │ │ │ ├── RedisConfig.java │ │ │ └── WebSocketConfig.java │ │ │ ├── controller │ │ │ └── ChatController.java │ │ │ ├── listener │ │ │ ├── RedisMessageListener.java │ │ │ └── WebSocketEventListener.java │ │ │ ├── model │ │ │ └── ChatMessage.java │ │ │ ├── service │ │ │ └── ChatService.java │ │ │ └── util │ │ │ └── JsonUtil.java │ └── resources │ │ ├── application.properties │ │ └── static │ │ ├── css │ │ └── main.css │ │ ├── index.html │ │ └── js │ │ └── main.js │ └── test │ └── java │ └── com │ └── example │ └── websocket │ └── SpringBootWebsocketRedisApplicationTests.java ├── Spring-Boot-Websocket ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── websocket │ │ │ ├── SpringBootWebsocketApplication.java │ │ │ ├── config │ │ │ └── WebSocketConfig.java │ │ │ ├── controller │ │ │ └── ChatController.java │ │ │ ├── listener │ │ │ └── WebSocketEventListener.java │ │ │ └── model │ │ │ └── ChatMessage.java │ └── resources │ │ ├── application.properties │ │ └── static │ │ ├── css │ │ └── main.css │ │ ├── index.html │ │ └── js │ │ └── main.js │ └── test │ └── java │ └── com │ └── example │ └── websocket │ └── SpringBootWebsocketApplicationTests.java ├── Spring-Boot-XSSFilter ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── xssfilter │ │ │ ├── SpringBootXssFilterApplication.java │ │ │ ├── config │ │ │ └── XssFilterConfig.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ ├── filter │ │ │ ├── XssFilter.java │ │ │ └── XssHttpServletRequestWrapper.java │ │ │ └── utils │ │ │ └── JsoupUtil.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── xssfilter │ └── SpringBootXssFilterApplicationTests.java ├── Spring-Boot-Zookeeper ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── springboot │ │ ├── SpringBootZookeeperApplication.java │ │ ├── config │ │ ├── ZookeeperConfig.java │ │ └── ZookeeperProps.java │ │ ├── controller │ │ └── ZookeeperController.java │ │ ├── exception │ │ └── GlobalErrorHandler.java │ │ └── service │ │ ├── ZookeeperService.java │ │ └── impl │ │ └── ZookeeperServiceImpl.java │ └── resources │ └── application.yml └── doc ├── SpringBootAOP记录用户请求日志.md ├── SpringBoot中处理跨域问题.md ├── SpringBoot中实现异步调用.md ├── SpringBoot中配置过滤器监听器和拦截器.md ├── SpringBoot使用Jsoup防御XSS攻击.md ├── SpringBoot单元测试.md ├── SpringBoot启用HTTPS加密访问.md ├── SpringBoot实现上传下载.md ├── SpringBoot整合Actuator监控应用.md ├── SpringBoot整合Admin监控服务.md ├── SpringBoot整合Devtools热部署.md ├── SpringBoot整合ElasticSearch7.6.md ├── SpringBoot整合FastDFS.md ├── SpringBoot整合Hibernate-Validator.md ├── SpringBoot整合JackSon.md ├── SpringBoot整合Jasypt实现盐值加密.md ├── SpringBoot整合JdbcTemplate.md ├── SpringBoot整合Kafka.md ├── SpringBoot整合Logback.md ├── SpringBoot整合Mail发送邮件.md ├── SpringBoot整合MongoDB.md ├── SpringBoot整合MyBatis和Druid.md ├── SpringBoot整合Mybatis-Plus.md ├── SpringBoot整合Quartz实现分布式定时任务.md ├── SpringBoot整合RabbitMQ.md ├── SpringBoot整合Socket.md ├── SpringBoot整合Swagger2构建RESTfulAPI.md ├── SpringBoot整合WebService.md ├── SpringBoot整合模板引擎Thymeleaf.md ├── SpringBoot整合缓存框架(注解版).md ├── SpringBoot整合通用Mapper和PageHelper.md ├── SpringBoot的基础配置.md ├── SpringBoot统一异常处理之ErrorController.md ├── SpringBoot统一异常处理之ErrorHandler.md ├── SpringBoot自定义线程池实现多线程调用.md ├── SpringBoot配置多数据源.md ├── SpringBoot配置多数据源动态切换.md ├── SpringBoot集成Webflux整合MongoDB.md ├── SpringBoot项目打包部署.md ├── 开启SpringBoot.md └── 深入学习SpringBoot自动装配.md /.gitignore: -------------------------------------------------------------------------------- 1 | */.idea 2 | */.mvn 3 | */target 4 | */HELP.md 5 | */mvnw 6 | */mvnw.cmd 7 | */.gitignore 8 | -------------------------------------------------------------------------------- /Spring-Boot-ActiveMQ/src/main/java/com/example/activemq/SpringBootActiveMqApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.activemq; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootActiveMqApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootActiveMqApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-ActiveMQ/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-ActiveMQ/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | activemq: 3 | #ActiveMQ通讯地址 4 | broker-url: tcp://localhost:61616 5 | #用户名 6 | user: admin 7 | #密码 8 | password: admin 9 | #是否启用内存模式(就是不安装MQ,项目启动时同时启动一个MQ实例) 10 | in-memory: false 11 | packages: 12 | #信任所有的包 13 | trust-all: true 14 | pool: 15 | #是否替换默认的连接池,使用ActiveMQ的连接池需引入的依赖 16 | enabled: true 17 | max-connections: 10 18 | server: 19 | port: 8099 -------------------------------------------------------------------------------- /Spring-Boot-ActiveMQ/src/test/java/com/example/activemq/SpringBootActiveMqApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.activemq; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootActiveMqApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Admin/Spring-Boot-Admin-Client/src/main/java/com/example/client/SpringBootAdminClientApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.client; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootAdminClientApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootAdminClientApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Admin/Spring-Boot-Admin-Client/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Admin/Spring-Boot-Admin-Client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoint: 3 | shutdown: 4 | enabled: true 5 | health: 6 | show-details: always 7 | endpoints: 8 | web: 9 | exposure: 10 | include: '*' 11 | spring: 12 | boot: 13 | admin: 14 | client: 15 | instance: 16 | service-base-url: http://localhost:8081/ 17 | url: http://localhost:8080/admin-server #服务端监控地址 18 | server: 19 | port: 8081 20 | info: 21 | app: 22 | name: "@project.name@" 23 | description: "@project.description@" 24 | version: "@project.version@" 25 | spring-boot-version: "@project.parent.version@" 26 | -------------------------------------------------------------------------------- /Spring-Boot-Admin/Spring-Boot-Admin-Client/src/test/java/com/example/client/SpringBootAdminClientApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.client; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootAdminClientApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Admin/Spring-Boot-Admin-Server/src/main/java/com/example/server/SpringBootAdminServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.server; 2 | 3 | import de.codecentric.boot.admin.server.config.EnableAdminServer; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @EnableAdminServer 8 | @SpringBootApplication 9 | public class SpringBootAdminServerApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringBootAdminServerApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-Admin/Spring-Boot-Admin-Server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Admin/Spring-Boot-Admin-Server/src/test/java/com/example/server/SpringBootAdminServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.server; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootAdminServerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Aop-Log/src/main/java/com/example/aoplog/SpringBootAopLogApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.aoplog; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootAopLogApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootAopLogApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Aop-Log/src/main/java/com/example/aoplog/annotation/Log.java: -------------------------------------------------------------------------------- 1 | package com.example.aoplog.annotation; 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 | * Created by dengzhiming on 2019/4/11 10 | */ 11 | @Target(ElementType.METHOD) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface Log { 14 | String value() default ""; 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-Aop-Log/src/main/java/com/example/aoplog/dao/SysLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.aoplog.dao; 2 | 3 | import com.example.aoplog.bean.SysLog; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * Created by dengzhiming on 2019/4/11 9 | */ 10 | @Repository 11 | @Mapper 12 | public interface SysLogMapper { 13 | void saveSysLog(SysLog syslog); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Spring-Boot-Aop-Log/src/main/java/com/example/aoplog/utils/HttpContextUtils.java: -------------------------------------------------------------------------------- 1 | package com.example.aoplog.utils; 2 | 3 | import org.springframework.web.context.request.RequestContextHolder; 4 | import org.springframework.web.context.request.ServletRequestAttributes; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | public class HttpContextUtils { 9 | public static HttpServletRequest getHttpServletRequest() { 10 | return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Spring-Boot-Aop-Log/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Aop-Log/src/main/resources/mapper/SysLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | insert into SYS_LOG(id,userName,operation,time,method,params,ip,createTime) 7 | values(#{id},#{userName},#{operation},#{time},#{method},#{params},#{ip},#{createTime}) 8 | 9 | -------------------------------------------------------------------------------- /Spring-Boot-Aop-Log/src/test/java/com/example/aoplog/SpringBootAopLogApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.aoplog; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootAopLogApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Async/src/main/java/com/example/async/SpringBootAsyncApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.async; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | 7 | @EnableAsync 8 | @SpringBootApplication 9 | public class SpringBootAsyncApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringBootAsyncApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-Async/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Async/src/test/java/com/example/async/SpringBootAsyncApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.async; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootAsyncApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Autoconfig/src/main/java/com/example/autoconfig/SpringBootAutoconfigApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.autoconfig; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * @author dengzhiming 8 | * @date 2020/02/03 9 | */ 10 | @SpringBootApplication 11 | public class SpringBootAutoconfigApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(SpringBootAutoconfigApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Spring-Boot-Autoconfig/src/main/java/com/example/autoconfig/annotation/CustomService.java: -------------------------------------------------------------------------------- 1 | package com.example.autoconfig.annotation; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.lang.annotation.*; 5 | 6 | /** 7 | * @author dengzhiming 8 | * @date 2020/02/03 9 | */ 10 | @Target({ElementType.TYPE}) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Documented 13 | @Service 14 | public @interface CustomService { 15 | String value() default ""; 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-Autoconfig/src/main/java/com/example/autoconfig/annotation/EnableHelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.example.autoconfig.annotation; 2 | 3 | import com.example.autoconfig.selector.HelloWorldImportSelector; 4 | import org.springframework.context.annotation.Import; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * @author dengzhiming 10 | * @date 2020/02/03 11 | */ 12 | @Target({ElementType.TYPE}) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Documented 15 | //@Import(HelloWorldConfiguration.class) 16 | @Import(HelloWorldImportSelector.class) 17 | public @interface EnableHelloWorld { 18 | } 19 | -------------------------------------------------------------------------------- /Spring-Boot-Autoconfig/src/main/java/com/example/autoconfig/configuration/HelloWorldAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.example.autoconfig.configuration; 2 | 3 | import com.example.autoconfig.annotation.EnableHelloWorld; 4 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * @author dengzhiming 9 | * @date 2020/02/03 10 | */ 11 | @Configuration 12 | @EnableHelloWorld 13 | @ConditionalOnProperty(name = "helloworld", havingValue = "true") 14 | public class HelloWorldAutoConfiguration { 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-Autoconfig/src/main/java/com/example/autoconfig/configuration/HelloWorldConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.example.autoconfig.configuration; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | /** 7 | * @author dengzhiming 8 | * @date 2020/02/03 9 | */ 10 | @Configuration 11 | public class HelloWorldConfiguration { 12 | @Bean 13 | public String hello() { 14 | return "hello world"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-Autoconfig/src/main/java/com/example/autoconfig/selector/HelloWorldImportSelector.java: -------------------------------------------------------------------------------- 1 | package com.example.autoconfig.selector; 2 | 3 | import com.example.autoconfig.configuration.HelloWorldConfiguration; 4 | import org.springframework.context.annotation.ImportSelector; 5 | import org.springframework.core.type.AnnotationMetadata; 6 | 7 | /** 8 | * @author dengzhiming 9 | * @date 2020/02/03 10 | */ 11 | public class HelloWorldImportSelector implements ImportSelector { 12 | @Override 13 | public String[] selectImports(AnnotationMetadata importingClassMetadata) { 14 | return new String[]{HelloWorldConfiguration.class.getName()}; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-Autoconfig/src/main/java/com/example/autoconfig/service/TestService.java: -------------------------------------------------------------------------------- 1 | package com.example.autoconfig.service; 2 | 3 | import com.example.autoconfig.annotation.CustomService; 4 | 5 | /** 6 | * @author dengzhiming 7 | * @date 2020/02/03 8 | */ 9 | @CustomService 10 | //@Service 11 | public class TestService { 12 | } 13 | -------------------------------------------------------------------------------- /Spring-Boot-Autoconfig/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # Auto Configure 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | com.example.autoconfig.configuration.HelloWorldAutoConfiguration 4 | -------------------------------------------------------------------------------- /Spring-Boot-Autoconfig/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | helloworld=true 2 | -------------------------------------------------------------------------------- /Spring-Boot-Autoconfig/src/test/java/com/example/autoconfig/SpringBootAutoconfigApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.autoconfig; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootAutoconfigApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Cors-Support/src/main/java/com/example/corssupport/SpringBootCorsSupportApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.corssupport; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootCorsSupportApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootCorsSupportApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Cors-Support/src/main/java/com/example/corssupport/config/WebConfigurer.java: -------------------------------------------------------------------------------- 1 | package com.example.corssupport.config; 2 | 3 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 4 | 5 | /** 6 | * Created by dengzhiming on 2019/6/30 7 | */ 8 | //@Configuration 9 | public class WebConfigurer implements WebMvcConfigurer { 10 | /*@Override 11 | public void addCorsMappings(CorsRegistry registry) { 12 | registry.addMapping("/**") 13 | .allowedOrigins("*") 14 | .allowedMethods("GET"); 15 | }*/ 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-Cors-Support/src/main/java/com/example/corssupport/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.example.corssupport.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | 7 | /** 8 | * Created by dengzhiming on 2019/6/30 9 | */ 10 | @Controller 11 | public class TestController { 12 | @GetMapping("index") 13 | public String index() { 14 | return "index"; 15 | } 16 | 17 | @GetMapping("hello") 18 | @ResponseBody 19 | //@CrossOrigin(value = "*") 20 | public String hello() { 21 | return "hello"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spring-Boot-Cors-Support/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Cors-Support/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 跨域测试 6 | 7 | 8 | 9 |
10 | 11 | 18 | -------------------------------------------------------------------------------- /Spring-Boot-Cors-Support/src/test/java/com/example/corssupport/SpringBootCorsSupportApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.corssupport; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootCorsSupportApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Ehcache-Anno/src/main/java/com/example/ehcache/SpringBootEhcacheAnnoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.ehcache; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cache.annotation.EnableCaching; 6 | 7 | @EnableCaching 8 | @SpringBootApplication 9 | public class SpringBootEhcacheAnnoApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringBootEhcacheAnnoApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-Ehcache-Anno/src/main/java/com/example/ehcache/dao/StudentMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.ehcache.dao; 2 | 3 | import com.example.ehcache.bean.Student; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * Created by dengzhiming on 2019/4/17 9 | */ 10 | @Repository 11 | @Mapper 12 | public interface StudentMapper { 13 | int add(Student student); 14 | 15 | int update(Student student); 16 | 17 | int deleteById(String sno); 18 | 19 | Student queryStudentById(String id); 20 | } 21 | -------------------------------------------------------------------------------- /Spring-Boot-Ehcache-Anno/src/main/java/com/example/ehcache/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.example.ehcache.service; 2 | 3 | import com.example.ehcache.bean.Student; 4 | 5 | /** 6 | * Created by dengzhiming on 2019/4/17 7 | */ 8 | public interface StudentService { 9 | 10 | Student add(Student student); 11 | 12 | Student update(Student student); 13 | 14 | void deleteById(String sno); 15 | 16 | Student queryStudentById(String sno); 17 | } 18 | -------------------------------------------------------------------------------- /Spring-Boot-Ehcache-Anno/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Ehcache-Anno/src/main/resources/ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 13 | 21 | -------------------------------------------------------------------------------- /Spring-Boot-Ehcache-Anno/src/main/resources/mapper/StudentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | insert into student1 (sno,name,sex) values(#{sno},#{name},#{sex}) 7 | 8 | 9 | update student1 set name=#{name},sex=#{sex} where sno=#{sno} 10 | 11 | 12 | delete from student1 where sno=#{sno} 13 | 14 | 17 | -------------------------------------------------------------------------------- /Spring-Boot-Ehcache-Anno/src/test/java/com/example/ehcache/SpringBootEhcacheAnnoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.ehcache; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootEhcacheAnnoApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/java/com/example/elasticsearch/SpringBootElasticsearchApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.elasticsearch; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootElasticsearchApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootElasticsearchApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/java/com/example/elasticsearch/domain/BookDto.java: -------------------------------------------------------------------------------- 1 | package com.example.elasticsearch.domain; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.io.Serializable; 9 | 10 | @Data 11 | @Builder 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | public class BookDto implements Serializable { 15 | 16 | /** 17 | * Id 18 | */ 19 | private Long id; 20 | 21 | /** 22 | * 名称 23 | */ 24 | private String name; 25 | 26 | /** 27 | * 描述 28 | */ 29 | private String desc; 30 | } 31 | -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/java/com/example/elasticsearch/domain/Constant.java: -------------------------------------------------------------------------------- 1 | package com.example.elasticsearch.domain; 2 | 3 | public interface Constant { 4 | String INDEX = "book"; 5 | } 6 | -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/java/com/example/elasticsearch/domain/ResponseBean.java: -------------------------------------------------------------------------------- 1 | package com.example.elasticsearch.domain; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | @Data 9 | @Builder 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | public class ResponseBean { 13 | /** 14 | * HTTP状态码 15 | */ 16 | private Integer code; 17 | 18 | /** 19 | * 返回信息 20 | */ 21 | private String msg; 22 | 23 | /** 24 | * 返回的数据 25 | */ 26 | private Object data; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/java/com/example/elasticsearch/exception/CustomException.java: -------------------------------------------------------------------------------- 1 | package com.example.elasticsearch.exception; 2 | 3 | 4 | public class CustomException extends RuntimeException { 5 | public CustomException(String msg){ 6 | super(msg); 7 | } 8 | public CustomException() { 9 | super(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/java/com/example/elasticsearch/exception/SystemException.java: -------------------------------------------------------------------------------- 1 | package com.example.elasticsearch.exception; 2 | 3 | public class SystemException extends RuntimeException { 4 | public SystemException(String msg){ 5 | super(msg); 6 | } 7 | public SystemException() { 8 | super(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | spring: 4 | application: 5 | name: springboot-elasticsearch 6 | thymeleaf: 7 | # 开发时关闭缓存不然没法看到实时页面 8 | cache: off 9 | # 启用不严格检查 10 | mode: HTML 11 | # Elasticsearch配置 12 | elasticsearch: 13 | hostname: localhost 14 | port: 9200 15 | -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/resources/static/element-ui/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Elasticsearch/src/main/resources/static/element-ui/fonts/element-icons.ttf -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/resources/static/element-ui/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Elasticsearch/src/main/resources/static/element-ui/fonts/element-icons.woff -------------------------------------------------------------------------------- /Spring-Boot-Elasticsearch/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Elasticsearch/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /Spring-Boot-Error-Controller/src/main/java/com/example/errorcontroller/SpringBootErrorControllerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.errorcontroller; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootErrorControllerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootErrorControllerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Error-Controller/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Error-Controller/src/main/resources/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GlobalError 5 | 6 | 7 |

服务异常,请稍后再试!

8 |
9 |

10 |

11 |

12 |

13 |

14 |
15 | 16 | -------------------------------------------------------------------------------- /Spring-Boot-Error-Controller/src/test/java/com/example/errorcontroller/SpringBootErrorControllerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.errorcontroller; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootErrorControllerApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Error-Handler/src/main/java/com/example/errorhandler/SpringBootErrorHandlerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.errorhandler; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootErrorHandlerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootErrorHandlerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Error-Handler/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Error-Handler/src/main/resources/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GlobalError 5 | 6 | 7 |

服务异常,请稍后再试!

8 |
9 |

10 |

11 |

12 |

13 |

14 |
15 | 16 | -------------------------------------------------------------------------------- /Spring-Boot-Error-Handler/src/test/java/com/example/errorhandler/SpringBootErrorHandlerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.errorhandler; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootErrorHandlerApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-FastDFS/src/main/java/com/example/fastdfs/SpringBootFastDfsApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.fastdfs; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootFastDfsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootFastDfsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-FastDFS/src/main/resources/templates/upload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Spring Boot file upload example

5 | 6 |
7 |

8 | 9 |
10 | 11 | 12 | -------------------------------------------------------------------------------- /Spring-Boot-FastDFS/src/main/resources/templates/uploadStatus.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Spring Boot - Upload Status

5 | 6 |
7 |

8 |
9 | 10 |
11 |

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /Spring-Boot-FastDFS/src/test/java/com/example/fastdfs/SpringBootFastDfsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.fastdfs; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootFastDfsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Filter-Listener-Interceptor/src/main/java/com/example/filterlistenerinterceptor/SpringBootFilterListenerInterceptorApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.filterlistenerinterceptor; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | //@ServletComponentScan 7 | @SpringBootApplication 8 | public class SpringBootFilterListenerInterceptorApplication { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(SpringBootFilterListenerInterceptorApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Spring-Boot-Filter-Listener-Interceptor/src/main/java/com/example/filterlistenerinterceptor/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.example.filterlistenerinterceptor.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * Created by dengzhiming on 2019/5/31 8 | */ 9 | @RestController 10 | public class TestController { 11 | 12 | @GetMapping("/test") 13 | public String test() { 14 | System.out.println("controller 执行"); 15 | return "controller return"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Spring-Boot-Filter-Listener-Interceptor/src/main/java/com/example/filterlistenerinterceptor/interceptor/InterceptorConf.java: -------------------------------------------------------------------------------- 1 | package com.example.filterlistenerinterceptor.interceptor; 2 | 3 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 4 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 5 | 6 | /** 7 | * Created by dengzhiming on 2019/6/1 8 | */ 9 | //@Configuration 10 | public class InterceptorConf extends WebMvcConfigurationSupport { 11 | @Override 12 | protected void addInterceptors(InterceptorRegistry registry) { 13 | registry.addInterceptor(new CustomHandlerInterceptor()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-Filter-Listener-Interceptor/src/main/java/com/example/filterlistenerinterceptor/interceptor/InterceptorConf1.java: -------------------------------------------------------------------------------- 1 | package com.example.filterlistenerinterceptor.interceptor; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | /** 8 | * Created by dengzhiming on 2019/6/1 9 | */ 10 | @Configuration 11 | public class InterceptorConf1 implements WebMvcConfigurer { 12 | @Override 13 | public void addInterceptors(InterceptorRegistry registry) { 14 | registry.addInterceptor(new CustomHandlerInterceptor()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-Filter-Listener-Interceptor/src/main/java/com/example/filterlistenerinterceptor/listener/CustomListener.java: -------------------------------------------------------------------------------- 1 | package com.example.filterlistenerinterceptor.listener; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import javax.servlet.ServletRequestEvent; 6 | import javax.servlet.ServletRequestListener; 7 | import javax.servlet.annotation.WebListener; 8 | 9 | /** 10 | * Created by dengzhiming on 2019/6/1 11 | */ 12 | @Component 13 | @WebListener 14 | public class CustomListener implements ServletRequestListener { 15 | @Override 16 | public void requestDestroyed(ServletRequestEvent sre) { 17 | System.out.println("Listener 销毁"); 18 | } 19 | 20 | @Override 21 | public void requestInitialized(ServletRequestEvent sre) { 22 | System.out.println("Listener 初始化"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Spring-Boot-Filter-Listener-Interceptor/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Filter-Listener-Interceptor/src/main/resources/application.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Filter-Listener-Interceptor/src/main/resources/application.yml -------------------------------------------------------------------------------- /Spring-Boot-Filter-Listener-Interceptor/src/test/java/com/example/filterlistenerinterceptor/SpringBootFilterListenerInterceptorApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.filterlistenerinterceptor; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootFilterListenerInterceptorApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Hibernate-Validator/src/main/java/com/example/hibernatevalidator/SpringBootHibernateValidatorApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.hibernatevalidator; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootHibernateValidatorApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootHibernateValidatorApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Hibernate-Validator/src/main/java/com/example/hibernatevalidator/config/MyConstraint.java: -------------------------------------------------------------------------------- 1 | package com.example.hibernatevalidator.config; 2 | 3 | import javax.validation.Constraint; 4 | import javax.validation.Payload; 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | /** 11 | * Created by dengzhiming on 2019/6/29 12 | */ 13 | @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Constraint(validatedBy = MyConstraintValidator.class) 16 | public @interface MyConstraint { 17 | String message(); 18 | 19 | Class[] groups() default {}; 20 | 21 | Class[] payload() default {}; 22 | } 23 | -------------------------------------------------------------------------------- /Spring-Boot-Hibernate-Validator/src/main/java/com/example/hibernatevalidator/config/MyConstraintValidator.java: -------------------------------------------------------------------------------- 1 | package com.example.hibernatevalidator.config; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | 6 | /** 7 | * Created by dengzhiming on 2019/6/29 8 | */ 9 | public class MyConstraintValidator implements ConstraintValidator { 10 | @Override 11 | public void initialize(MyConstraint constraintAnnotation) { 12 | System.out.println("my validator init"); 13 | } 14 | 15 | @Override 16 | public boolean isValid(Object o, ConstraintValidatorContext constraintValidatorContext) { 17 | return !o.toString().contains("k"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spring-Boot-Hibernate-Validator/src/main/java/com/example/hibernatevalidator/controller/TestBeanController.java: -------------------------------------------------------------------------------- 1 | package com.example.hibernatevalidator.controller; 2 | 3 | import com.example.hibernatevalidator.bean.User; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.ResponseBody; 7 | 8 | import javax.validation.Valid; 9 | 10 | /** 11 | * Created by dengzhiming on 2019/6/29 12 | */ 13 | @Controller 14 | public class TestBeanController { 15 | @GetMapping("test2") 16 | @ResponseBody 17 | public String test2(@Valid User user) { 18 | return "success"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spring-Boot-Hibernate-Validator/src/main/java/com/example/hibernatevalidator/controller/TestCustomController.java: -------------------------------------------------------------------------------- 1 | package com.example.hibernatevalidator.controller; 2 | 3 | import com.example.hibernatevalidator.config.MyConstraint; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.validation.annotation.Validated; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | /** 10 | * Created by dengzhiming on 2019/6/29 11 | */ 12 | @Controller 13 | @Validated 14 | public class TestCustomController { 15 | @GetMapping("test3") 16 | @ResponseBody 17 | public String test3(@MyConstraint(message = "{illegal}") String name) { 18 | return "success"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spring-Boot-Hibernate-Validator/src/main/resources/ValidationMessages.properties: -------------------------------------------------------------------------------- 1 | required=\u4e0d\u80fd\u4e3a\u7a7a 2 | invalid=\u683c\u5f0f\u4e0d\u5408\u6cd5 3 | illegal=\u4e0d\u80fd\u5305\u542b\u5b57\u7b26\u006b -------------------------------------------------------------------------------- /Spring-Boot-Hibernate-Validator/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Hibernate-Validator/src/test/java/com/example/hibernatevalidator/SpringBootHibernateValidatorApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.hibernatevalidator; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootHibernateValidatorApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Https/src/main/java/com/example/https/SpringBootHttpsApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.https; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootHttpsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootHttpsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Https/src/main/java/com/example/https/controller/HttpsController.java: -------------------------------------------------------------------------------- 1 | package com.example.https.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * @author dengzhiming 8 | * @date 2020/3/5 21:11 9 | */ 10 | @RestController 11 | public class HttpsController { 12 | @GetMapping(value = "/hello") 13 | public String hello() { 14 | return "Hello HTTPS"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-Https/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | # \u914D\u7F6E HTTPS \u76F8\u5173\u4FE1\u606F 2 | server: 3 | port: 443 4 | # \u4E3A\u4E86\u540E\u9762\u7684\u914D\u7F6E\u4F7F\u7528,\u6682\u65F6\u65E0\u7528 5 | http-port: 80 6 | ssl: 7 | enabled: true 8 | # \u8BC1\u4E66\u6587\u4EF6 9 | key-store: classpath:springboot_https.keystore 10 | # \u5BC6\u7801 11 | key-password: 123456 12 | # \u5BC6\u94A5\u5E93\u7C7B\u578B 13 | key-store-type: JKS 14 | key-alias: springboot_https 15 | -------------------------------------------------------------------------------- /Spring-Boot-Https/src/main/resources/springboot_https.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Https/src/main/resources/springboot_https.keystore -------------------------------------------------------------------------------- /Spring-Boot-Https/src/test/java/com/example/https/SpringBootHttpsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.https; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootHttpsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Jackson/src/main/java/com/example/jackson/SpringBootJacksonApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.jackson; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootJacksonApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootJacksonApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Jackson/src/main/java/com/example/jackson/config/JacksonConfig.java: -------------------------------------------------------------------------------- 1 | package com.example.jackson.config; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | import java.text.SimpleDateFormat; 8 | 9 | /** 10 | * Created by dengzhiming on 2019/4/23 11 | */ 12 | @Configuration 13 | public class JacksonConfig { 14 | @Bean 15 | public ObjectMapper getObjectMapper() { 16 | ObjectMapper objectMapper = new ObjectMapper(); 17 | objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); 18 | return objectMapper; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spring-Boot-Jackson/src/main/java/com/example/jackson/config/UserSerializer.java: -------------------------------------------------------------------------------- 1 | package com.example.jackson.config; 2 | 3 | import com.example.jackson.bean.User; 4 | import com.fasterxml.jackson.core.JsonGenerator; 5 | import com.fasterxml.jackson.databind.JsonSerializer; 6 | import com.fasterxml.jackson.databind.SerializerProvider; 7 | 8 | import java.io.IOException; 9 | 10 | /** 11 | * Created by dengzhiming on 2019/4/24 12 | */ 13 | public class UserSerializer extends JsonSerializer { 14 | @Override 15 | public void serialize(User user, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { 16 | jsonGenerator.writeStartObject(); 17 | jsonGenerator.writeStringField("user-name", user.getUserName()); 18 | jsonGenerator.writeEndObject(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spring-Boot-Jackson/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.servlet.context-path=/web -------------------------------------------------------------------------------- /Spring-Boot-Jackson/src/test/java/com/example/jackson/SpringBootJacksonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.jackson; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootJacksonApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Jasypt/src/main/java/com/example/jasypt/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.example.jasypt.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import reactor.core.publisher.Mono; 8 | 9 | /** 10 | * Created by dengzhiming on 2020/1/18 11 | */ 12 | @RestController 13 | @RequestMapping("/jasypt") 14 | public class TestController { 15 | @Value("${name}") 16 | private String password; 17 | @GetMapping("/name") 18 | public Mono sendNormalText() { 19 | System.out.println(password); 20 | return Mono.just(password); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spring-Boot-Jasypt/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Jasypt/src/main/resources/application.properties -------------------------------------------------------------------------------- /Spring-Boot-Jasypt/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | name: ENC(Xt2kU2GFjee7eZj/oc/rQg==) 2 | jasypt: 3 | encryptor: 4 | password: password 5 | algorithm: PBEWithMD5AndDES 6 | key-obtention-iterations: 1000 7 | pool-size: 1 8 | provider-name: SunJCE 9 | salt-generator-classname: org.jasypt.salt.RandomSaltGenerator 10 | iv-generator-classname: org.jasypt.iv.NoIvGenerator 11 | string-output-type: base64 -------------------------------------------------------------------------------- /Spring-Boot-JdbcTemplate/src/main/java/com/example/jdbctemplate/SpringBootJdbcTemplateApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.jdbctemplate; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootJdbcTemplateApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootJdbcTemplateApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-JdbcTemplate/src/main/java/com/example/jdbctemplate/bean/StudentObj.java: -------------------------------------------------------------------------------- 1 | package com.example.jdbctemplate.bean; 2 | 3 | import org.springframework.jdbc.core.RowMapper; 4 | 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | 8 | /** 9 | * Created by dengzhiming on 2019/3/24 10 | */ 11 | public class StudentObj implements RowMapper { 12 | 13 | @Override 14 | public Student mapRow(ResultSet rs, int rowNum) throws SQLException { 15 | Student student = new Student(); 16 | student.setSno(rs.getString("sno")); 17 | student.setName(rs.getString("sname")); 18 | student.setSex(rs.getString("ssex")); 19 | return student; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spring-Boot-JdbcTemplate/src/main/java/com/example/jdbctemplate/mapper/StudentMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.jdbctemplate.mapper; 2 | 3 | import com.example.jdbctemplate.bean.Student; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | /** 9 | * Created by dengzhiming on 2019/3/24 10 | */ 11 | public interface StudentMapper { 12 | int add(Student student); 13 | 14 | int update(Student student); 15 | 16 | int deleteBysno(String sno); 17 | 18 | List> queryStudentsListMap(); 19 | 20 | Student queryStudentBySno(String sno); 21 | } 22 | -------------------------------------------------------------------------------- /Spring-Boot-JdbcTemplate/src/main/java/com/example/jdbctemplate/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.example.jdbctemplate.service; 2 | 3 | import com.example.jdbctemplate.bean.Student; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | /** 9 | * Created by dengzhiming on 2019/3/24 10 | */ 11 | public interface StudentService { 12 | int add(Student student); 13 | 14 | int update(Student student); 15 | 16 | int deleteBysno(String sno); 17 | 18 | List> queryStudentListMap(); 19 | 20 | Student queryStudentBySno(String sno); 21 | } 22 | -------------------------------------------------------------------------------- /Spring-Boot-JdbcTemplate/src/test/java/com/example/jdbctemplate/SpringBootJdbcTemplateApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.jdbctemplate; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootJdbcTemplateApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Kafka/src/main/java/com/example/kafka/SpringBootKafkaApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.kafka; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootKafkaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootKafkaApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Kafka/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Kafka/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | kafka: 3 | bootstrap-servers: localhost:9092 4 | consumer: 5 | group-id: test-consumer 6 | auto-offset-reset: latest 7 | -------------------------------------------------------------------------------- /Spring-Boot-Kafka/src/test/java/com/example/kafka/SpringBootKafkaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.kafka; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootKafkaApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Logback/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Logback/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Spring-Boot-Logback/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /Spring-Boot-Logback/src/main/java/com/example/logback/SpringBootLogbackApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.logback; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootLogbackApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootLogbackApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Logback/src/main/java/com/example/logback/bean/User.java: -------------------------------------------------------------------------------- 1 | package com.example.logback.bean; 2 | 3 | /** 4 | * Created by dengzhiming on 2019/5/19 5 | */ 6 | public class User { 7 | private String userName; 8 | private String password; 9 | 10 | public User() { 11 | } 12 | 13 | public User(String userName, String password) { 14 | this.userName = userName; 15 | this.password = password; 16 | } 17 | 18 | public String getUserName() { 19 | return userName; 20 | } 21 | 22 | public void setUserName(String userName) { 23 | this.userName = userName; 24 | } 25 | 26 | public String getPassword() { 27 | return password; 28 | } 29 | 30 | public void setPassword(String password) { 31 | this.password = password; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Spring-Boot-Logback/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Logback/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | servlet: 3 | context-path: /web 4 | port: 8080 -------------------------------------------------------------------------------- /Spring-Boot-Logback/src/test/java/com/example/logback/SpringBootLogbackApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.logback; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootLogbackApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Mail/src/main/java/com/example/mail/SpringBootMailApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.mail; 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 | -------------------------------------------------------------------------------- /Spring-Boot-Mail/src/main/resources/application-qq.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | mail: 3 | #发送邮件服务器 4 | host: smtp.qq.com 5 | #QQ邮箱 6 | username: xxx@qq.com 7 | #授权码参考:https://service.mail.qq.com/cgi-bin/help?subtype=1&&no=1001256&&id=28 8 | password: xxxxxx 9 | #发送邮件协议 10 | protocol: smtp 11 | #编码格式 12 | default-encoding: utf-8 13 | properties: 14 | mail: 15 | smtp: 16 | #开启认证 17 | auth: true 18 | #端口号465(开启SSL时)或587(不开启SSL时) 19 | port: 465 20 | ssl: 21 | #开启SSL(使用587端口时无法连接QQ邮件服务器) 22 | enable: true 23 | starttls: 24 | #需要TLS认证 保证发送邮件安全验证 25 | enable: true 26 | required: true -------------------------------------------------------------------------------- /Spring-Boot-Mail/src/main/resources/application-wangyi.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | mail: 3 | host: smtp.163.com #发送邮件服务器(smtp.126/163/yeah.com) 4 | username: xxx@163.com #126/163/yeah邮箱 5 | #授权码参考:http://help.mail.163.com/faq.do?m=list&categoryID=197 6 | password: xxxxxx 7 | protocol: smtp 8 | default-encoding: utf-8 #编码格式 9 | properties: 10 | mail: 11 | smtp: 12 | auth: true #开启认证 13 | port: 994 #465或者994 14 | ssl: 15 | enable: true #开启SSL 16 | starttls: 17 | enable: true #需要TLS认证 保证发送邮件安全验证 18 | required: true 19 | 20 | -------------------------------------------------------------------------------- /Spring-Boot-Mail/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Mail/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: wangyi -------------------------------------------------------------------------------- /Spring-Boot-Mail/src/main/resources/static/file/项目文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Mail/src/main/resources/static/file/项目文档.docx -------------------------------------------------------------------------------- /Spring-Boot-Mail/src/main/resources/static/img/优秀.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Mail/src/main/resources/static/img/优秀.jpg -------------------------------------------------------------------------------- /Spring-Boot-Mail/src/main/resources/templates/emailTemplate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 模板 6 | 7 | 8 | 9 | 您好,您的验证码为,请在两分钟内使用完成操作。 10 | 11 | -------------------------------------------------------------------------------- /Spring-Boot-Mail/src/test/java/com/example/mail/SpringBootMailApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.mail; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootMailApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Mapper-PageHelper/src/main/java/com/example/mapperpagehelper/SpringBootMapperPageHelperApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.mapperpagehelper; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import tk.mybatis.spring.annotation.MapperScan; 6 | 7 | @MapperScan("com.example.mapperpagehelper.mapper") 8 | @SpringBootApplication 9 | public class SpringBootMapperPageHelperApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringBootMapperPageHelperApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-Mapper-PageHelper/src/main/java/com/example/mapperpagehelper/config/MyMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.mapperpagehelper.config; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import tk.mybatis.mapper.common.MySqlMapper; 5 | 6 | public interface MyMapper extends Mapper, MySqlMapper { 7 | 8 | } -------------------------------------------------------------------------------- /Spring-Boot-Mapper-PageHelper/src/main/java/com/example/mapperpagehelper/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.mapperpagehelper.mapper; 2 | 3 | import com.example.mapperpagehelper.bean.User; 4 | import com.example.mapperpagehelper.config.MyMapper; 5 | 6 | public interface UserMapper extends MyMapper { 7 | } -------------------------------------------------------------------------------- /Spring-Boot-Mapper-PageHelper/src/main/java/com/example/mapperpagehelper/service/IService.java: -------------------------------------------------------------------------------- 1 | package com.example.mapperpagehelper.service; 2 | 3 | import java.util.List; 4 | 5 | public interface IService { 6 | List selectAll(); 7 | 8 | T selectByKey(Object key); 9 | 10 | int save(T entity); 11 | 12 | int delete(Object key); 13 | 14 | int updateAll(T entity); 15 | 16 | int updateNotNull(T entity); 17 | 18 | List selectByExample(Object example); 19 | } -------------------------------------------------------------------------------- /Spring-Boot-Mapper-PageHelper/src/main/java/com/example/mapperpagehelper/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.example.mapperpagehelper.service; 2 | 3 | import com.example.mapperpagehelper.bean.User; 4 | 5 | public interface UserService extends IService { 6 | } -------------------------------------------------------------------------------- /Spring-Boot-Mapper-PageHelper/src/main/java/com/example/mapperpagehelper/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.example.mapperpagehelper.service.impl; 2 | 3 | import com.example.mapperpagehelper.bean.User; 4 | import com.example.mapperpagehelper.service.UserService; 5 | import org.springframework.stereotype.Service; 6 | 7 | @Service("userService") 8 | public class UserServiceImpl extends BaseServiceImpl implements UserService { 9 | } -------------------------------------------------------------------------------- /Spring-Boot-Mapper-PageHelper/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Mapper-PageHelper/src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Spring-Boot-MongoDB/src/main/java/com/example/mongodb/SpringBootMongoDbApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.mongodb; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootMongoDbApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootMongoDbApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-MongoDB/src/main/java/com/example/mongodb/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.example.mongodb.service; 2 | 3 | import com.example.mongodb.entity.User; 4 | import org.springframework.data.domain.Page; 5 | 6 | import java.util.List; 7 | import java.util.Optional; 8 | 9 | /** 10 | * Created by dengzhiming on 2019/7/6 11 | */ 12 | public interface UserService { 13 | List selectAll(); 14 | 15 | Optional selectById(String id); 16 | 17 | User create(User user); 18 | 19 | void updateById(String id, User user); 20 | 21 | void deleteById(String id); 22 | 23 | Page selectByCondition(int page, int size, User user); 24 | } 25 | -------------------------------------------------------------------------------- /Spring-Boot-MongoDB/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-MongoDB/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | data: 3 | mongodb: 4 | host: localhost 5 | port: 27017 6 | database: testdb -------------------------------------------------------------------------------- /Spring-Boot-MongoDB/src/test/java/com/example/mongodb/SpringBootMongoDbApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.mongodb; 2 | 3 | 4 | import org.junit.jupiter.api.Test; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | 7 | @SpringBootTest 8 | public class SpringBootMongoDbApplicationTests { 9 | 10 | @Test 11 | public void contextLoads() { 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS1/src/main/java/com/example/multidatasource/SpringBootMultiDs1Application.java: -------------------------------------------------------------------------------- 1 | package com.example.multidatasource; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootMultiDs1Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootMultiDs1Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS1/src/main/java/com/example/multidatasource/mysqldao/MysqlStudentMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.multidatasource.mysqldao; 2 | 3 | import org.springframework.stereotype.Repository; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | /** 9 | * Created by dengzhiming on 2019/3/27 10 | */ 11 | @Repository 12 | public interface MysqlStudentMapper { 13 | List> getAllStudents(); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS1/src/main/java/com/example/multidatasource/oracledao/OracleStudentMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.multidatasource.oracledao; 2 | 3 | import org.springframework.stereotype.Repository; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | /** 9 | * Created by dengzhiming on 2019/3/27 10 | */ 11 | @Repository 12 | public interface OracleStudentMapper { 13 | List> getAllStudents(); 14 | } 15 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS1/src/main/java/com/example/multidatasource/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.example.multidatasource.service; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | /** 7 | * Created by dengzhiming on 2019/3/28 8 | */ 9 | public interface StudentService { 10 | List> getAllStudentsFromMysql(); 11 | 12 | List> getAllStudentsFromOracle(); 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS1/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS1/src/main/resources/mapper/mysql/MysqlStudentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS1/src/main/resources/mapper/oracle/OracleStudentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS1/src/test/java/com/example/multidatasource/SpringBootMultiDs1ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.multidatasource; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootMultiDs1ApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS2-Switch/src/main/java/com/example/multidatasource/SpringBootMultiDs2SwitchApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.multidatasource; 2 | 3 | import com.example.multidatasource.datasourceConfig.DynamicDataSourceRegister; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.Import; 7 | 8 | @SpringBootApplication 9 | @Import(DynamicDataSourceRegister.class) 10 | public class SpringBootMultiDs2SwitchApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringBootMultiDs2SwitchApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS2-Switch/src/main/java/com/example/multidatasource/dao/StudentMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.multidatasource.dao; 2 | 3 | import org.apache.ibatis.annotations.Mapper; 4 | import org.apache.ibatis.annotations.Param; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | * Created by dengzhiming on 2019/4/7 12 | */ 13 | @Repository 14 | @Mapper 15 | public interface StudentMapper { 16 | List> getAllStudents(); 17 | int updateStudent(@Param("sno") int sno, @Param("sname") String sname); 18 | } 19 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS2-Switch/src/main/java/com/example/multidatasource/datasourceConfig/TargetDataSource.java: -------------------------------------------------------------------------------- 1 | package com.example.multidatasource.datasourceConfig; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 指定数据源注解类 7 | * Created by dengzhiming on 2019/3/29 8 | */ 9 | @Target({ElementType.METHOD, ElementType.TYPE}) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Documented 12 | public @interface TargetDataSource { 13 | String value(); 14 | } 15 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS2-Switch/src/main/java/com/example/multidatasource/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.example.multidatasource.service; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | /** 7 | * Created by dengzhiming on 2019/4/7 8 | */ 9 | public interface StudentService { 10 | List> getAllStudentsFromMaster(); 11 | 12 | List> getAllStudentsFromSlave(); 13 | 14 | int updateStudent(int sno,String sname); 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS2-Switch/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS2-Switch/src/main/resources/mapper/StudentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | update student set sname = #{sname} where sno = #{sno} 10 | 11 | 12 | -------------------------------------------------------------------------------- /Spring-Boot-MultiDS2-Switch/src/test/java/com/example/multidatasource/SpringBootMultiDs2SwitchApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.multidatasource; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootMultiDs2SwitchApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Mybatis/src/main/java/com/example/mybatis/SpringBootMybatisApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.mybatis; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootMybatisApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootMybatisApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Mybatis/src/main/java/com/example/mybatis/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.example.mybatis.controller; 2 | 3 | import com.example.mybatis.bean.Student; 4 | import com.example.mybatis.service.StudentService; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import javax.annotation.Resource; 10 | 11 | /** 12 | * Created by dengzhiming on 2019/3/21 13 | */ 14 | @RestController 15 | public class TestController { 16 | @Resource 17 | private StudentService service; 18 | 19 | @GetMapping("/querystudent/{sno}") 20 | public Student queryStudentBySno(@PathVariable String sno) { 21 | return this.service.queryStudentById(sno); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Spring-Boot-Mybatis/src/main/java/com/example/mybatis/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.example.mybatis.service; 2 | 3 | import com.example.mybatis.bean.Student; 4 | 5 | /** 6 | * Created by dengzhiming on 2019/3/21 7 | */ 8 | public interface StudentService { 9 | int add(Student student); 10 | 11 | int update(Student student); 12 | 13 | int deleteById(String sno); 14 | 15 | Student queryStudentById(String sno); 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-Mybatis/src/main/resources/mapper/StudentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | insert into student(sno,sname,ssex) values(#{sno},#{name},#{sex}) 6 | 7 | 8 | update student set sname=#{name},ssex=#{sex} where sno=#{sno} 9 | 10 | 11 | delete from student where sno=#{id} 12 | 13 | 20 | -------------------------------------------------------------------------------- /Spring-Boot-Mybatis/src/test/java/com/example/mybatis/SpringBootMybatisApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.mybatis; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootMybatisApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-MybatisPlus/src/main/java/com/example/mybatisplus/SpringBootMybatisPlusApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.mybatisplus; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @MapperScan("com.example.mybatisplus.mapper") 8 | @SpringBootApplication 9 | public class SpringBootMybatisPlusApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringBootMybatisPlusApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-MybatisPlus/src/main/java/com/example/mybatisplus/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.example.mybatisplus.controller; 2 | 3 | 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | import org.springframework.stereotype.Controller; 7 | 8 | /** 9 | *

10 | * 前端控制器 11 | *

12 | * 13 | * @author dengzhiming 14 | * @since 2019-11-28 15 | */ 16 | @Controller 17 | @RequestMapping("/user") 18 | public class UserController { 19 | 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Spring-Boot-MybatisPlus/src/main/java/com/example/mybatisplus/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.mybatisplus.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.example.mybatisplus.entity.User; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | *

9 | * Mapper 接口 10 | *

11 | * 12 | * @author dengzhiming 13 | * @since 2019-11-28 14 | */ 15 | @Repository 16 | public interface UserMapper extends BaseMapper { 17 | User findById(String id); 18 | } 19 | -------------------------------------------------------------------------------- /Spring-Boot-MybatisPlus/src/main/java/com/example/mybatisplus/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.example.mybatisplus.service; 2 | 3 | import com.example.mybatisplus.entity.User; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author dengzhiming 12 | * @since 2019-11-28 13 | */ 14 | public interface UserService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-MybatisPlus/src/main/java/com/example/mybatisplus/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.example.mybatisplus.service.impl; 2 | 3 | import com.example.mybatisplus.entity.User; 4 | import com.example.mybatisplus.mapper.UserMapper; 5 | import com.example.mybatisplus.service.UserService; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 服务实现类 12 | *

13 | * 14 | * @author dengzhiming 15 | * @since 2019-11-28 16 | */ 17 | @Service 18 | public class UserServiceImpl extends ServiceImpl implements UserService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Spring-Boot-MybatisPlus/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-MybatisPlus/src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /Spring-Boot-Quartz/src/main/java/com/example/quartz/SpringBootQuartzApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.quartz; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootQuartzApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootQuartzApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Quartz/src/main/java/com/example/quartz/dao/JobAndTriggerMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.quartz.dao; 2 | 3 | import com.example.quartz.entity.JobAndTrigger; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by dengzhiming on 2019/8/1 11 | */ 12 | @Repository 13 | @Mapper 14 | public interface JobAndTriggerMapper { 15 | List getTriggerAndDetails(); 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-Quartz/src/main/java/com/example/quartz/job/BaseJob.java: -------------------------------------------------------------------------------- 1 | package com.example.quartz.job; 2 | 3 | import org.springframework.scheduling.quartz.QuartzJobBean; 4 | 5 | /** 6 | * Created by dengzhiming on 2019/8/1 7 | */ 8 | public abstract class BaseJob extends QuartzJobBean { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Spring-Boot-Quartz/src/main/java/com/example/quartz/job/HelloJob.java: -------------------------------------------------------------------------------- 1 | package com.example.quartz.job; 2 | 3 | import org.quartz.JobExecutionContext; 4 | import org.quartz.JobExecutionException; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import java.util.Date; 9 | 10 | /** 11 | * Created by dengzhiming on 2019/8/1 12 | */ 13 | public class HelloJob extends BaseJob { 14 | 15 | private static Logger logger = LoggerFactory.getLogger(HelloJob.class); 16 | @Override 17 | protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { 18 | logger.info("HelloJob执行时间: " + new Date()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spring-Boot-Quartz/src/main/java/com/example/quartz/job/NewJob.java: -------------------------------------------------------------------------------- 1 | package com.example.quartz.job; 2 | 3 | import org.quartz.JobExecutionContext; 4 | import org.quartz.JobExecutionException; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import java.util.Date; 9 | 10 | /** 11 | * Created by dengzhiming on 2019/8/1 12 | */ 13 | public class NewJob extends BaseJob { 14 | 15 | private static Logger logger = LoggerFactory.getLogger(NewJob.class); 16 | @Override 17 | protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { 18 | logger.info("NewJob执行的时间: " + new Date()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spring-Boot-Quartz/src/main/java/com/example/quartz/service/JobAndTriggerService.java: -------------------------------------------------------------------------------- 1 | package com.example.quartz.service; 2 | 3 | import com.example.quartz.entity.JobAndTrigger; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by dengzhiming on 2019/8/1 9 | */ 10 | public interface JobAndTriggerService { 11 | List getTriggerAndDetails(); 12 | 13 | void addjob(JobAndTrigger jobAndTrigger); 14 | 15 | void pausejob(String triggerName, String triggerGroup); 16 | 17 | void resumejob(String triggerName, String triggerGroup); 18 | 19 | void deletejob(String triggerName, String triggerGroup); 20 | 21 | void reschedulejob(JobAndTrigger jobAndTrigger); 22 | } 23 | -------------------------------------------------------------------------------- /Spring-Boot-Quartz/src/test/java/com/example/quartz/SpringBootQuartzApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.quartz; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootQuartzApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/Rabbitmq-Common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.example 7 | rabbit-reliable-delivery 8 | 1.0-SNAPSHOT 9 | 10 | rabbitmq-common 11 | 0.0.1-SNAPSHOT 12 | 13 | 14 | -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/Rabbitmq-Common/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/Rabbitmq-Customer/src/main/java/com/example/customer/RabbitmqCustomerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.customer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RabbitmqCustomerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RabbitmqCustomerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/Rabbitmq-Customer/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | spring: 4 | rabbitmq: 5 | #基本配置 6 | addresses: localhost:5672 7 | username: guest 8 | password: guest 9 | virtual-host: / 10 | connection-timeout: 15000 11 | #消费端配置 12 | listener: 13 | simple: 14 | #消费端 15 | concurrency: 5 16 | #最大消费端数 17 | max-concurrency: 10 18 | #自动签收auto 手动 manual 19 | acknowledge-mode: manual 20 | #限流(海量数据,同时只能过来一条) 21 | prefetch: 1 22 | -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/Rabbitmq-Customer/src/test/java/com/example/customer/RabbitmqCustomerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.customer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class RabbitmqCustomerApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/Rabbitmq-Publisher/src/main/java/com/example/publisher/SpringBootRabbitmqPublisherApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.publisher; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootRabbitmqPublisherApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootRabbitmqPublisherApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/Rabbitmq-Publisher/src/main/java/com/example/publisher/constants/Constants.java: -------------------------------------------------------------------------------- 1 | package com.example.publisher.constants; 2 | 3 | public class Constants { 4 | 5 | public static final String ORDER_SENDING = "0"; //发送中 6 | 7 | public static final String ORDER_SEND_SUCCESS = "1"; //成功 8 | 9 | public static final String ORDER_SEND_FAILURE = "2"; //失败 10 | 11 | public static final int ORDER_TIMEOUT = 1; //重新投递时间(分钟) 12 | } 13 | -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/Rabbitmq-Publisher/src/main/java/com/example/publisher/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.example.publisher.service; 2 | 3 | import com.example.common.domain.Order; 4 | 5 | public interface OrderService { 6 | void createOrder(Order order) throws Exception; 7 | } 8 | -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/Rabbitmq-Publisher/src/test/java/com/example/publisher/SpringBootRabbitmqPublisherApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.publisher; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootRabbitmqPublisherApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/imgs/RabbitMQ1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Rabbit-Reliable-Delivery/imgs/RabbitMQ1.jpg -------------------------------------------------------------------------------- /Spring-Boot-Rabbit-Reliable-Delivery/imgs/RabbitMQ2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Rabbit-Reliable-Delivery/imgs/RabbitMQ2.jpg -------------------------------------------------------------------------------- /Spring-Boot-RabbitMQ/src/main/java/com/example/rabbitmq/SpringBootRabbitMqApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.rabbitmq; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootRabbitMqApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootRabbitMqApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-RabbitMQ/src/main/java/com/example/rabbitmq/listener/MyDefaultListener.java: -------------------------------------------------------------------------------- 1 | package com.example.rabbitmq.listener; 2 | 3 | import org.springframework.amqp.rabbit.annotation.Queue; 4 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class MyDefaultListener { 9 | 10 | @RabbitListener(queuesToDeclare = @Queue("myDefaultExchange")) 11 | public void onMessage(String msg) { 12 | System.out.println("来自 myDefaultExchange 的消息:" + msg); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Spring-Boot-RabbitMQ/src/main/java/com/example/rabbitmq/listener/MyJasonListener.java: -------------------------------------------------------------------------------- 1 | package com.example.rabbitmq.listener; 2 | 3 | import com.example.rabbitmq.domain.Student; 4 | import org.springframework.amqp.rabbit.annotation.Queue; 5 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 6 | import org.springframework.messaging.handler.annotation.Payload; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component 10 | public class MyJasonListener { 11 | @RabbitListener(containerFactory = "jsonListenerFactory",queuesToDeclare = @Queue("jsonQueue")) 12 | public void onMessage(@Payload Student student) { 13 | System.out.println(student); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-RabbitMQ/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-RabbitMQ/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | rabbitmq: 3 | #RabbitMQ的用户名,默认为guest 4 | username: guest 5 | #RabbitMQ的密码,默认为guest 6 | password: guest 7 | addresses: localhost:5672 8 | cache: 9 | connection: 10 | #缓存连接模式,默认一个连接,多个channel 11 | mode: channel 12 | #多个连接,多个channel 13 | #mode: connection -------------------------------------------------------------------------------- /Spring-Boot-RabbitMQ/src/test/java/com/example/rabbitmq/SpringBootRabbitMqApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.rabbitmq; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootRabbitMqApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Redis-Anno/src/main/java/com/example/redis/SpringBootRedisAnnoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.redis; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootRedisAnnoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootRedisAnnoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Redis-Anno/src/main/java/com/example/redis/dao/StudentMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.redis.dao; 2 | 3 | import com.example.redis.bean.Student; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * Created by dengzhiming on 2019/4/17 9 | */ 10 | @Repository 11 | @Mapper 12 | public interface StudentMapper { 13 | int add(Student student); 14 | 15 | int update(Student student); 16 | 17 | int deleteById(String sno); 18 | 19 | Student queryStudentById(String id); 20 | } 21 | -------------------------------------------------------------------------------- /Spring-Boot-Redis-Anno/src/main/java/com/example/redis/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.example.redis.service; 2 | 3 | import com.example.redis.bean.Student; 4 | 5 | /** 6 | * Created by dengzhiming on 2019/4/17 7 | */ 8 | public interface StudentService { 9 | 10 | Student add(Student student); 11 | 12 | Student update(Student student); 13 | 14 | void deleteById(String sno); 15 | 16 | Student queryStudentById(String sno); 17 | } 18 | -------------------------------------------------------------------------------- /Spring-Boot-Redis-Anno/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Redis-Anno/src/main/resources/mapper/StudentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | insert into student1(sno,name,sex) values(#{sno},#{name},#{sex}) 7 | 8 | 9 | update student1 set name=#{name},sex=#{sex} where sno=#{sno} 10 | 11 | 12 | delete from student1 where sno=#{sno} 13 | 14 | 17 | -------------------------------------------------------------------------------- /Spring-Boot-Redis-Anno/src/test/java/com/example/redis/SpringBootRedisAnnoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.redis; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootRedisAnnoApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Smartdoc/src/main/java/com/example/smartdoc/SpringBootSmartdocApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.smartdoc; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootSmartdocApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootSmartdocApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Smartdoc/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Socket/src/main/java/com/example/socket/SpringBootSocketApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.socket; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootSocketApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootSocketApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Socket/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Socket/src/test/java/com/example/socket/SpringBootSocketApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.socket; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootSocketApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-autoconfigure/src/main/java/com/codeming/starter/HelloProperties.java: -------------------------------------------------------------------------------- 1 | package com.codeming.starter; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | 5 | /** 6 | * @author dengzhiming 7 | * @date 2020/3/5 23:08 8 | */ 9 | @ConfigurationProperties(prefix = "myapp.hello") 10 | public class HelloProperties { 11 | private String suffix; 12 | 13 | public String getSuffix() { 14 | return suffix; 15 | } 16 | 17 | public void setSuffix(String suffix) { 18 | this.suffix = suffix; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-autoconfigure/src/main/java/com/codeming/starter/HelloService.java: -------------------------------------------------------------------------------- 1 | package com.codeming.starter; 2 | 3 | /** 4 | * @author dengzhiming 5 | * @date 2020/3/5 23:11 6 | */ 7 | public class HelloService { 8 | HelloProperties helloProperties; 9 | 10 | public String sayHello(String name){ 11 | return "Hello " + name + "," + helloProperties.getSuffix(); 12 | } 13 | 14 | public HelloProperties getHelloProperties() { 15 | return helloProperties; 16 | } 17 | 18 | public void setHelloProperties(HelloProperties helloProperties) { 19 | this.helloProperties = helloProperties; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # Auto Configure 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | com.codeming.starter.HelloServiceAutoConfiguration 4 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-starter-test/src/main/java/com/codeming/startertest/MyappSpringBootStarterTestApplication.java: -------------------------------------------------------------------------------- 1 | package com.codeming.startertest; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class MyappSpringBootStarterTestApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(MyappSpringBootStarterTestApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-starter-test/src/main/java/com/codeming/startertest/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | package com.codeming.startertest.controller; 2 | 3 | import com.codeming.starter.HelloService; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | * @author dengzhiming 10 | * @date 2020/3/5 23:50 11 | */ 12 | @RestController 13 | public class HelloController { 14 | @Autowired 15 | HelloService helloService; 16 | 17 | @GetMapping("/hello") 18 | public String sayHello(String name) { 19 | return helloService.sayHello(name); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-starter-test/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | myapp.hello.suffix=\u6700\u8FD1\u8FD8\u597D\u5417\uFF1F 2 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-starter-test/src/test/java/com/codeming/startertest/MyappSpringBootStarterTestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.codeming.startertest; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class MyappSpringBootStarterTestApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-starter/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-starter/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-starter/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Spring-Boot-Starter/myapp-spring-boot-starter/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Spring-Boot-Swagger2/src/main/java/com/example/swagger2/SpringBootSwagger2Application.java: -------------------------------------------------------------------------------- 1 | package com.example.swagger2; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootSwagger2Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootSwagger2Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Swagger2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Swagger2/src/test/java/com/example/swagger2/SpringBootSwagger2ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.swagger2; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootSwagger2ApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/asciidoc/generated/definitions.adoc: -------------------------------------------------------------------------------- 1 | 2 | [[_definitions]] 3 | == 定义 4 | 5 | [[_user]] 6 | === User 7 | 用户信息对象 8 | 9 | 10 | [options="header", cols=".^3a,.^11a,.^4a"] 11 | |=== 12 | |名称|说明|类型 13 | |**address** + 14 | __可选__|家庭住址 + 15 | **样例** : `"string"`|string 16 | |**age** + 17 | __可选__|年龄 + 18 | **样例** : `0`|integer (int32) 19 | |**id** + 20 | __可选__|用户id + 21 | **样例** : `0`|integer (int32) 22 | |**name** + 23 | __可选__|用户名 + 24 | **样例** : `"string"`|string 25 | |**sex** + 26 | __可选__|性别 + 27 | **样例** : `"string"`|string 28 | |=== 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/asciidoc/generated/overview.adoc: -------------------------------------------------------------------------------- 1 | = 用户信息API文档 2 | 3 | 4 | [[_overview]] 5 | == 概览 6 | 这里除了查看接口功能外,还提供了调试测试功能 7 | 8 | 9 | === 版本信息 10 | [%hardbreaks] 11 | __版本__ : 1.0 12 | 13 | 14 | === 联系方式 15 | [%hardbreaks] 16 | __名字__ : 倾尽天下 17 | __邮箱__ : 1206291365@qq.com 18 | 19 | 20 | === URI scheme 21 | [%hardbreaks] 22 | __域名__ : 127.0.0.1:8080 23 | __基础路径__ : / 24 | 25 | 26 | === 标签 27 | 28 | * UserApi : 用户基本信息操作API 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/asciidoc/generated/security.adoc: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/asciidoc/pdf/all.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/docs/asciidoc/pdf/all.pdf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/asciidoc/pdf/definitions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/docs/asciidoc/pdf/definitions.pdf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/asciidoc/pdf/overview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/docs/asciidoc/pdf/overview.pdf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/asciidoc/pdf/paths.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/docs/asciidoc/pdf/paths.pdf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/asciidoc/pdf/security.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/docs/asciidoc/pdf/security.pdf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/confluence/generated/definitions.txt: -------------------------------------------------------------------------------- 1 | 2 | h2. 定义 {anchor:definitions} 3 | 4 | h3. User {anchor:user} 5 | 用户信息对象 6 | 7 | 8 | ||名称||说明||类型|| 9 | |*address*\\ \\ _可选_||家庭住址\\ \\ *样例* : {noformat}"string"{noformat}||string| 10 | |*age*\\ \\ _可选_||年龄\\ \\ *样例* : {noformat}0{noformat}||integer (int32)| 11 | |*id*\\ \\ _可选_||用户id\\ \\ *样例* : {noformat}0{noformat}||integer (int32)| 12 | |*name*\\ \\ _可选_||用户名\\ \\ *样例* : {noformat}"string"{noformat}||string| 13 | |*sex*\\ \\ _可选_||性别\\ \\ *样例* : {noformat}"string"{noformat}||string| 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/confluence/generated/overview.txt: -------------------------------------------------------------------------------- 1 | h1. 用户信息API文档 2 | 3 | 4 | h2. 概览 {anchor:overview} 5 | 这里除了查看接口功能外,还提供了调试测试功能 6 | 7 | 8 | h3. 版本信息 9 | _版本_ : 1.0 10 | 11 | 12 | h3. 联系方式 13 | _名字_ : 倾尽天下\\ 14 | _邮箱_ : 1206291365@qq.com 15 | 16 | 17 | h3. URI scheme 18 | _域名_ : 127.0.0.1:8080\\ 19 | _基础路径_ : / 20 | 21 | 22 | h3. 标签 23 | 24 | * UserApi : 用户基本信息操作API 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/confluence/generated/security.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/markdown/generated/definitions.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## 定义 4 | 5 | 6 | ### User 7 | 用户信息对象 8 | 9 | 10 | |名称|说明|类型| 11 | |---|---|---| 12 | |**address**
*可选*|家庭住址
**样例** : `"string"`|string| 13 | |**age**
*可选*|年龄
**样例** : `0`|integer (int32)| 14 | |**id**
*可选*|用户id
**样例** : `0`|integer (int32)| 15 | |**name**
*可选*|用户名
**样例** : `"string"`|string| 16 | |**sex**
*可选*|性别
**样例** : `"string"`|string| 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/markdown/generated/overview.md: -------------------------------------------------------------------------------- 1 | # 用户信息API文档 2 | 3 | 4 | 5 | ## 概览 6 | 这里除了查看接口功能外,还提供了调试测试功能 7 | 8 | 9 | ### 版本信息 10 | *版本* : 1.0 11 | 12 | 13 | ### 联系方式 14 | *名字* : 倾尽天下 15 | *邮箱* : 1206291365@qq.com 16 | 17 | 18 | ### URI scheme 19 | *域名* : 127.0.0.1:8080 20 | *基础路径* : / 21 | 22 | 23 | ### 标签 24 | 25 | * UserApi : 用户基本信息操作API 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/docs/markdown/generated/security.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/src/main/java/com/example/swaggerdoc/SpringBootSwaggerdocApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.swaggerdoc; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootSwaggerdocApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootSwaggerdocApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/src/main/resources/fonts/KaiGenGothicCN-Bold-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/src/main/resources/fonts/KaiGenGothicCN-Bold-Italic.ttf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/src/main/resources/fonts/KaiGenGothicCN-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/src/main/resources/fonts/KaiGenGothicCN-Bold.ttf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/src/main/resources/fonts/KaiGenGothicCN-Regular-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/src/main/resources/fonts/KaiGenGothicCN-Regular-Italic.ttf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/src/main/resources/fonts/KaiGenGothicCN-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/src/main/resources/fonts/KaiGenGothicCN-Regular.ttf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/src/main/resources/fonts/RobotoMono-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/src/main/resources/fonts/RobotoMono-Bold.ttf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/src/main/resources/fonts/RobotoMono-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/src/main/resources/fonts/RobotoMono-BoldItalic.ttf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/src/main/resources/fonts/RobotoMono-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/src/main/resources/fonts/RobotoMono-Italic.ttf -------------------------------------------------------------------------------- /Spring-Boot-Swaggerdoc/src/main/resources/fonts/RobotoMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-Swaggerdoc/src/main/resources/fonts/RobotoMono-Regular.ttf -------------------------------------------------------------------------------- /Spring-Boot-Test/src/main/java/com/example/test/SpringBootTestApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.test; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootTestApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootTestApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Test/src/main/java/com/example/test/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.test.dao; 2 | 3 | import com.example.test.bean.User; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | @Mapper 9 | public interface UserMapper { 10 | int add(User user); 11 | 12 | int update(User user); 13 | 14 | int deleteById(String id); 15 | 16 | User queryUserById(String id); 17 | } 18 | -------------------------------------------------------------------------------- /Spring-Boot-Test/src/main/java/com/example/test/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.example.test.service; 2 | 3 | import com.example.test.bean.User; 4 | 5 | /** 6 | * Created by dengzhiming on 2019/4/29 7 | */ 8 | public interface UserService { 9 | int add(User user); 10 | 11 | int update(User user); 12 | 13 | int deleteById(String id); 14 | 15 | User queryUserById(String id); 16 | } 17 | -------------------------------------------------------------------------------- /Spring-Boot-Test/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Thymeleaf/src/main/java/com/example/thymeleaf/SpringBootThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.thymeleaf; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootThymeleafApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootThymeleafApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Thymeleaf/src/test/java/com/example/thymeleaf/SpringBootThymeleafApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.thymeleaf; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootThymeleafApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Updownload/src/main/java/com/example/updownload/SpringBootUpdownloadApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.updownload; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootUpdownloadApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootUpdownloadApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Updownload/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # thymeleaf 2 | spring.thymeleaf.prefix=classpath:/templates/ 3 | spring.thymeleaf.suffix=.html 4 | spring.thymeleaf.mode=HTML 5 | spring.thymeleaf.encoding=UTF-8 6 | spring.thymeleaf.servlet.content-type=text/html 7 | spring.thymeleaf.cache=false 8 | # 上传文件总的最大值 9 | spring.servlet.multipart.max-request-size=100MB 10 | # 单个文件的最大值 11 | spring.servlet.multipart.max-file-size=100MB 12 | # 是否支持批量上传(默认值 true) 13 | spring.servlet.multipart.enabled=true 14 | # 上传文件的临时目录(一般情况下不用特意修改) 15 | #spring.servlet.multipart.location= 16 | # 文件大小阈值,当大于这个阈值时将写入到磁盘,否则存在内存中(默认值0 一般情况下不用特意修改) 17 | spring.servlet.multipart.file-size-threshold=0 18 | # 判断是否要延迟解析文件(相当于懒加载,一般情况下不用特意修改) 19 | spring.servlet.multipart.resolve-lazily=false 20 | -------------------------------------------------------------------------------- /Spring-Boot-Updownload/src/main/resources/templates/download.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 文件下载 6 | 7 | 8 | 9 | 10 | 11 | 下载文件 12 | 13 | 22 | 23 | -------------------------------------------------------------------------------- /Spring-Boot-Updownload/src/main/resources/templates/upload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 单文件上传 6 | 7 | 8 |

单文件上传

9 |
10 | 文件: 11 | 12 |
13 | 14 | -------------------------------------------------------------------------------- /Spring-Boot-Updownload/src/main/resources/templates/uploadBatch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 多文件上传 6 | 7 | 8 |

多文件上传

9 |
10 |

文件1:

11 |

文件2:

12 |

13 |
14 | 15 | -------------------------------------------------------------------------------- /Spring-Boot-Updownload/src/test/java/com/example/updownload/SpringBootUpdownloadApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.updownload; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootUpdownloadApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/Spring-Boot-WebService.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_10_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_fasterxml_woodstox_woodstox_core_5_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_sun_activation_javax_activation_1_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_sun_istack_istack_commons_runtime_3_0_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_sun_xml_fastinfoset_FastInfoset_1_2_15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_sun_xml_messaging_saaj_saaj_impl_1_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__jakarta_activation_jakarta_activation_api_1_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__javax_activation_javax_activation_api_1_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__javax_xml_bind_jaxb_api_2_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__javax_xml_soap_javax_xml_soap_api_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__javax_xml_ws_jaxws_api_2_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__junit_junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_9_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_cxf_cxf_core_3_3_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_cxf_cxf_rt_bindings_soap_3_3_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_cxf_cxf_rt_bindings_xml_3_3_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_cxf_cxf_rt_databinding_jaxb_3_3_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_cxf_cxf_rt_frontend_jaxws_3_3_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_cxf_cxf_rt_frontend_simple_3_3_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_cxf_cxf_rt_transports_http_3_3_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_cxf_cxf_rt_ws_addr_3_3_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_cxf_cxf_rt_ws_policy_3_3_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_cxf_cxf_rt_wsdl_3_3_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_geronimo_specs_geronimo_jta_1_1_spec_1_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_11_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_neethi_neethi_3_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_apache_ws_xmlschema_xmlschema_core_2_2_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_assertj_assertj_core_3_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_codehaus_woodstox_stax2_api_3_1_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_glassfish_jaxb_jaxb_runtime_2_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_glassfish_jaxb_txw2_2_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_18_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_jacorb_jacorb_omgapi_3_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_3_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_jboss_spec_javax_rmi_jboss_rmi_api_1_0_spec_1_0_6_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_jvnet_mimepull_mimepull_1_9_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_jvnet_staxex_stax_ex_1_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_mockito_mockito_core_2_23_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_ow2_asm_asm_7_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_11_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_11_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_1_11_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_spring_aop_5_1_12_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_spring_beans_5_1_12_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_spring_context_5_1_12_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_spring_core_5_1_12_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_spring_expression_5_1_12_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_spring_jcl_5_1_12_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_spring_oxm_5_1_12_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_spring_test_5_1_12_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_spring_web_5_1_12_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_12_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_ws_spring_ws_core_3_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_springframework_ws_spring_xml_3_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_6_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__wsdl4j_wsdl4j_1_6_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/libraries/Maven__xml_resolver_xml_resolver_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Client/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-WebService/WebService-Client/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Client/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Client/src/main/java/com/example/client/WebServiceClientApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.client; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class WebServiceClientApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(WebServiceClientApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Client/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Client/src/test/java/com/example/client/WebServiceClientApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.client; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class WebServiceClientApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Server/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/Spring-Boot-WebService/WebService-Server/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Server/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Server/src/main/java/com/example/server/WebServiceServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.server; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class WebServiceServerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(WebServiceServerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Server/src/main/java/com/example/server/service/DemoService.java: -------------------------------------------------------------------------------- 1 | package com.example.server.service; 2 | 3 | import javax.jws.WebService; 4 | 5 | /** 6 | * Created by dengzhiming on 2019/8/4 7 | */ 8 | // name: Web Service的名称;targetNamespace: 指定名称空间,一般使用接口实现类的包名的反缀 9 | @WebService(name = "DemoService", targetNamespace = "http://impl.service.server.example.com") 10 | public interface DemoService { 11 | String sayHello(String user); 12 | } 13 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Server/src/main/java/com/example/server/service/impl/DemoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.example.server.service.impl; 2 | 3 | import com.example.server.service.DemoService; 4 | 5 | import javax.jws.WebService; 6 | import java.util.Date; 7 | 8 | /** 9 | * Created by dengzhiming on 2019/8/4 10 | */ 11 | // serviceName: 对外发布的服务名; 12 | // targetNamespace: 指定名称空间,一般使用接口实现类的包名的反缀; 13 | // endpointInterface: 服务接口的全类名; 14 | @WebService(serviceName = "DemoService" 15 | , targetNamespace = "http://impl.service.server.example.com" 16 | , endpointInterface = "com.example.server.service.DemoService") 17 | public class DemoServiceImpl implements DemoService { 18 | @Override 19 | public String sayHello(String user) { 20 | return user + ",现在的时间: " + new Date(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | -------------------------------------------------------------------------------- /Spring-Boot-WebService/WebService-Server/src/test/java/com/example/server/WebServiceServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.server; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class WebServiceServerApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Webflux-MongoDB/src/main/java/com/example/mongodb/SpringBootMongoDbWebfluxApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.mongodb; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.mongodb.repository.config.EnableReactiveMongoRepositories; 6 | 7 | @EnableReactiveMongoRepositories 8 | @SpringBootApplication 9 | public class SpringBootMongoDbWebfluxApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringBootMongoDbWebfluxApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Spring-Boot-Webflux-MongoDB/src/main/java/com/example/mongodb/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.mongodb.mapper; 2 | 3 | import com.example.mongodb.entity.User; 4 | import org.springframework.data.mongodb.repository.ReactiveMongoRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * Created by dengzhiming on 2019/7/10 9 | */ 10 | @Repository 11 | public interface UserMapper extends ReactiveMongoRepository { 12 | } 13 | -------------------------------------------------------------------------------- /Spring-Boot-Webflux-MongoDB/src/main/java/com/example/mongodb/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.example.mongodb.service; 2 | 3 | import com.example.mongodb.entity.User; 4 | import reactor.core.publisher.Flux; 5 | import reactor.core.publisher.Mono; 6 | 7 | /** 8 | * Created by dengzhiming on 2019/7/10 9 | */ 10 | public interface UserService { 11 | // 查询文档内所有数据 12 | Flux selectAll(); 13 | 14 | // 通过id查询文档内的数据 15 | Mono selectById(String id); 16 | 17 | // 向文档内插入一条记录 18 | Mono create(User user); 19 | 20 | // 通过id更新文档内容 21 | Mono updateById(String id, User user); 22 | 23 | // 通过id删除文档内容 24 | Mono deleteById(String id); 25 | } 26 | -------------------------------------------------------------------------------- /Spring-Boot-Webflux-MongoDB/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Webflux-MongoDB/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | data: 3 | mongodb: 4 | host: localhost 5 | # 启动MongoDB使用的端口号 6 | port: 27017 7 | # MongoDB中操作的database,需要创建 8 | database: webflux -------------------------------------------------------------------------------- /Spring-Boot-Webflux-MongoDB/src/test/java/com/example/mongodb/SpringBootMongoDbWebfluxApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.mongodb; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class SpringBootMongoDbWebfluxApplicationTests { 8 | 9 | @Test 10 | public void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Websocket-Redis/src/main/java/com/example/websocket/SpringBootWebsocketRedisApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.websocket; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootWebsocketRedisApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootWebsocketRedisApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Websocket-Redis/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # redis 连接配置 2 | spring.redis.database=0 3 | spring.redis.host=127.0.0.1 4 | spring.redis.password= 5 | spring.redis.port=6379 6 | spring.redis.ssl=false 7 | # 空闲连接最大数 8 | spring.redis.jedis.pool.max-idle=10 9 | # 获取连接最大等待时间(s) 10 | spring.redis.jedis.pool.max-wait=60000 11 | 12 | # 服务端口 13 | server.port=8080 14 | 15 | # Redis定义 16 | redis.set.onlineUsers=websocket.onlineUsers 17 | redis.channel.msgToAll=websocket.msgToAll 18 | redis.channel.userStatus=websocket.userStatus 19 | -------------------------------------------------------------------------------- /Spring-Boot-Websocket-Redis/src/test/java/com/example/websocket/SpringBootWebsocketRedisApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.websocket; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootWebsocketRedisApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Websocket/src/main/java/com/example/websocket/SpringBootWebsocketApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.websocket; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootWebsocketApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootWebsocketApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Websocket/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Websocket/src/test/java/com/example/websocket/SpringBootWebsocketApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.websocket; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootWebsocketApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-XSSFilter/src/main/java/com/example/xssfilter/SpringBootXssFilterApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.xssfilter; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootXssFilterApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootXssFilterApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-XSSFilter/src/main/java/com/example/xssfilter/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.example.xssfilter.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.PostMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | import org.springframework.web.bind.annotation.ResponseBody; 7 | 8 | /** 9 | * Created by dengzhiming on 2019/5/25 10 | */ 11 | @Controller 12 | public class TestController { 13 | 14 | @PostMapping("/testParam") 15 | @ResponseBody 16 | public String testParam(@RequestParam String param) { 17 | return param; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spring-Boot-XSSFilter/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Spring-Boot-Zookeeper/src/main/java/com/springboot/SpringBootZookeeperApplication.java: -------------------------------------------------------------------------------- 1 | package com.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootZookeeperApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootZookeeperApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring-Boot-Zookeeper/src/main/java/com/springboot/config/ZookeeperProps.java: -------------------------------------------------------------------------------- 1 | package com.springboot.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @author dengzhiming 9 | * @date 2020/5/5 14:10 10 | */ 11 | @Data 12 | @Component 13 | @ConfigurationProperties(prefix = "zookeeper") 14 | public class ZookeeperProps { 15 | private boolean enabled ; 16 | private String server ; 17 | private String namespace ; 18 | private String digest ; 19 | private Integer sessionTimeoutMs ; 20 | private Integer connectionTimeoutMs ; 21 | private Integer maxRetries ; 22 | private Integer baseSleepTimeMs ; 23 | } 24 | -------------------------------------------------------------------------------- /Spring-Boot-Zookeeper/src/main/java/com/springboot/exception/GlobalErrorHandler.java: -------------------------------------------------------------------------------- 1 | package com.springboot.exception; 2 | 3 | import org.springframework.web.bind.annotation.ControllerAdvice; 4 | import org.springframework.web.bind.annotation.ExceptionHandler; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | 7 | /** 8 | * @author dengzhiming 9 | * @date 2020/5/5 17:54 10 | */ 11 | @ControllerAdvice 12 | public class GlobalErrorHandler { 13 | @ExceptionHandler(Exception.class) 14 | @ResponseBody 15 | public String exceptionHandler(Throwable error){ 16 | return error.getMessage(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Spring-Boot-Zookeeper/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | spring: 4 | application: 5 | name: springboot-zookeeper 6 | zookeeper: 7 | #开启标志 8 | enabled: true 9 | #服务器地址 10 | server: 127.0.0.1:2181 11 | #命名空间,被称为ZNode 12 | namespace: cicada 13 | #权限控制,加密 14 | digest: smile:123456 15 | #会话超时时间 16 | sessionTimeoutMs: 3000 17 | #连接超时时间 18 | connectionTimeoutMs: 60000 19 | #最大重试次数 20 | maxRetries: 2 21 | #初始休眠时间 22 | baseSleepTimeMs: 1000 23 | -------------------------------------------------------------------------------- /doc/SpringBoot启用HTTPS加密访问.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/doc/SpringBoot启用HTTPS加密访问.md -------------------------------------------------------------------------------- /doc/SpringBoot实现上传下载.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/doc/SpringBoot实现上传下载.md -------------------------------------------------------------------------------- /doc/SpringBoot整合Devtools热部署.md: -------------------------------------------------------------------------------- 1 | ``` 2 | 热部署: 在你修改了后端代码后不需要手动重启,工具会帮你快速的自动重启使修改生效; 3 | 原理:使用两个ClassLoader,一个Classloader加载那些不会改变的类(第三方Jar包),另一个ClassLoader 4 | 加载会更改的类,称为restart ClassLoader,这样在有代码更改的时候,原来的restart ClassLoader 5 | 被丢弃,重新创建一个restart ClassLoader,由于需要加载的类相比较少,所以实现了较快的重启时间; 6 | [1]引入Spring-Boot-devtools依赖: 7 | 8 | org.springframework.boot 9 | spring-boot-devtools 10 | true 11 | 12 | [2]IDEA启动自动编译功能: 13 | File -> Settings -> Build,Execution,Deployment -> Compile -> 勾选"Build project automatically" 14 | [3]IDEA设置为在程序运行过程中,依然允许自动编译: 15 | 操作: ctrl + shift + alt + / ,选择Registry,勾选勾上"Compiler autoMake allow when app running" 16 | ``` 17 | -------------------------------------------------------------------------------- /doc/SpringBoot整合FastDFS.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/doc/SpringBoot整合FastDFS.md -------------------------------------------------------------------------------- /doc/SpringBoot自定义线程池实现多线程调用.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/doc/SpringBoot自定义线程池实现多线程调用.md -------------------------------------------------------------------------------- /doc/SpringBoot集成Webflux整合MongoDB.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaCodeMing/SpringBootLearning/9df90391b107f5d68f5ae7e7e8b9c33e3b790829/doc/SpringBoot集成Webflux整合MongoDB.md --------------------------------------------------------------------------------