├── .gitignore ├── .idea └── icon.svg ├── LICENSE ├── README.md ├── centos_install_docker └── readme.md ├── pom.xml ├── springboot-access-log ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── config │ └── WebLogAspect.java │ ├── controller │ └── DemoController.java │ ├── entity │ └── User.java │ └── util │ └── ParametersUtils.java ├── springboot-activemq ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── consumer │ │ └── ActiveMQConsumer.java │ │ ├── controller │ │ └── DemoController.java │ │ └── producer │ │ └── ActiveMQProducer.java │ └── resources │ └── application.yml ├── springboot-actuator ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── controller │ │ └── DemoController.java │ └── resources │ └── application.yml ├── springboot-admin ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ └── Application.java │ └── resources │ └── application.yml ├── springboot-alipay ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ └── AlipayConfig.java │ │ ├── constants │ │ └── AppConstants.java │ │ ├── controller │ │ └── AlipayController.java │ │ └── entity │ │ └── Alipay.java │ └── resources │ └── application.yml ├── springboot-apidoc ├── apidoc.json ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Appllication.java │ ├── controller │ └── DemoController.java │ └── entity │ └── User.java ├── springboot-argumentResolver ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── annotation │ └── CurrentUser.java │ ├── config │ ├── CurrentUserArgumentResolver.java │ └── WebConfig.java │ ├── controller │ └── DemoController.java │ └── entity │ └── User.java ├── springboot-async ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── controller │ └── DemoController.java │ └── service │ └── AsyncService.java ├── springboot-cache-caffeine ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── config │ ├── CacheType.java │ └── CaffeineConfig.java │ ├── controller │ └── UserController.java │ ├── entity │ └── User.java │ └── service │ └── UserService.java ├── springboot-cache-ehcache ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── UserService.java │ └── resources │ ├── application.yml │ └── ehcache.xml ├── springboot-cache-guava ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── config │ └── GuavaCacheConfig.java │ ├── controller │ └── UserController.java │ ├── entity │ └── User.java │ └── service │ └── UserService.java ├── springboot-cache-redis ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.yml ├── springboot-cache-spring ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── controller │ └── UserController.java │ ├── entity │ └── User.java │ └── service │ └── UserService.java ├── springboot-caffeine ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── app │ │ └── Application.java │ │ ├── controller │ │ └── UserController.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.yml ├── springboot-commandLineRunner ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── OrderRunner1.java │ ├── OrderRunner2.java │ ├── Runner2.java │ └── Runner3.java ├── springboot-cross ├── pom.xml ├── springboot-cross-client │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── oven │ │ │ └── app │ │ │ └── Application.java │ │ └── resources │ │ ├── application.yml │ │ └── static │ │ ├── index.html │ │ └── jquery.min.js └── springboot-cross-server │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── app │ │ └── Application.java │ │ └── controller │ │ └── TestController.java │ └── resources │ └── application.yml ├── springboot-dateformat ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── config │ └── DateFormatConfig.java │ ├── controller │ └── DemoController.java │ └── entity │ └── User.java ├── springboot-derby ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ └── derby │ │ ├── Application.java │ │ ├── controller │ │ └── StudentController.java │ │ ├── dao │ │ └── StudentDao.java │ │ ├── entity │ │ └── Student.java │ │ ├── service │ │ └── StudentService.java │ │ └── utils │ │ └── PropertyRowMapper.java │ └── resources │ └── application.yml ├── springboot-devtools ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ └── controller │ └── DemoController.java ├── springboot-disruptor ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── config │ ├── DisruptorManager.java │ └── SpringContextUtil.java │ ├── controller │ └── TestController.java │ ├── entity │ ├── Message.java │ └── MessageEventFactory.java │ ├── handler │ └── TaskEventHandler.java │ └── service │ └── TaskMessageService.java ├── springboot-docker ├── Dockerfile ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── controller │ │ └── DemoController.java │ └── resources │ └── application.properties ├── springboot-druid-monitor ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ ├── DruidConfig.java │ │ └── RemoveDruidAdvertisingConfig.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── dao │ │ └── UserDao.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.yml ├── springboot-dubbo ├── pom.xml ├── springboot-dubbo-client │ ├── pom.xml │ ├── readme.md │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── oven │ │ │ ├── Application.java │ │ │ └── controller │ │ │ └── DemoController.java │ │ └── resources │ │ └── application.properties ├── springboot-dubbo-common-api │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── oven │ │ └── service │ │ └── DemoService.java └── springboot-dubbo-server │ ├── pom.xml │ ├── readme.md │ └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── service │ │ └── impl │ │ └── DemoServiceImpl.java │ └── resources │ └── application.properties ├── springboot-dynamic-datasource ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── app │ │ └── Application.java │ │ ├── config │ │ ├── DataSourceConfig.java │ │ ├── MySQLDataSourceConfig.java │ │ └── OracleDataSourceConfig.java │ │ ├── controller │ │ └── TestController.java │ │ ├── entity │ │ └── User.java │ │ ├── mapper │ │ ├── mysql │ │ │ ├── UserMySQLMapper.java │ │ │ └── UserMySQLMapper.xml │ │ └── oracle │ │ │ ├── UserOracleMapper.java │ │ │ └── UserOracleMapper.xml │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.yml ├── springboot-dynamic-schedule ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── oven │ ├── app │ └── Application.java │ ├── config │ └── QuartzSchedulerConfig.java │ ├── job │ └── MyJob.java │ └── service │ └── TaskService.java ├── springboot-easypoi ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── controller │ └── EasyPoiController.java │ └── entity │ └── Member.java ├── springboot-elasticjob ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ └── job │ │ ├── Application.java │ │ └── MySimpleJob.java │ └── resources │ └── application.properties ├── springboot-elasticsearch ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── BookController.java │ │ ├── dao │ │ └── UserRepository.java │ │ └── entity │ │ └── User.java │ └── resources │ └── application.properties ├── springboot-elk ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── controller │ │ └── DemoController.java │ └── resources │ └── logback-spring.xml ├── springboot-email ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── MailController.java │ │ └── service │ │ ├── MailService.java │ │ └── impl │ │ └── MailServiceImpl.java │ └── resources │ └── application.properties ├── springboot-encry ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── oven │ ├── app │ └── Application.java │ ├── controller │ └── TestController.java │ ├── intercepter │ ├── DecryptRequestBodyAdvice.java │ └── EncryResponseBodyAdvice.java │ └── util │ └── DesUtil.java ├── springboot-esper ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── config │ └── EsperConfig.java │ ├── controller │ └── EplController.java │ ├── listener │ ├── LocationListener1.java │ └── LocationListener2.java │ └── util │ └── EsperUtil.java ├── springboot-event ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── app │ │ ├── Application.java │ │ └── DataLoader.java │ │ ├── controller │ │ └── DemoController.java │ │ └── event │ │ ├── EnvironmentPreparedEvent.java │ │ ├── FailedEvent.java │ │ ├── PreparedEvent.java │ │ ├── ReadyEvent.java │ │ ├── StartedEvent.java │ │ └── StartingEvent.java │ └── resources │ ├── META-INF │ └── spring.factories │ └── application.properties ├── springboot-exception ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── controller │ └── DemoController.java │ └── exception │ └── GlobalExceptionHandle.java ├── springboot-extend ├── pom.xml ├── springboot-base │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── oven │ │ ├── app │ │ └── Application.java │ │ ├── controller │ │ └── SaveController.java │ │ └── service │ │ ├── ISaveIndividualizationService.java │ │ ├── ISaveService.java │ │ └── impl │ │ └── SaveServiceImpl.java └── springboot-individualization │ ├── pom.xml │ └── src │ └── main │ └── java │ └── com │ └── oven │ ├── app │ └── Application.java │ └── service │ └── impl │ └── ServiceIndividualizationImpl.java ├── springboot-factory ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── context │ └── ServiceContext.java │ ├── controller │ └── DemoController.java │ └── service │ ├── IService.java │ └── impl │ ├── DefaultServiceImpl.java │ ├── Service01Impl.java │ ├── Service02Impl.java │ └── Service03Impl.java ├── springboot-fastdfs ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── DemoController.java │ │ └── utils │ │ └── FastdfsUtils.java │ └── resources │ ├── application.properties │ └── templates │ └── upload.html ├── springboot-fileUpload ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── DemoController.java │ │ └── utils │ │ └── FileUtils.java │ └── resources │ └── templates │ └── upload.html ├── springboot-filter ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── controller │ └── DemoController.java │ └── filter │ └── MyFilter.java ├── springboot-freemarker ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── DemoController.java │ └── resources │ ├── application.properties │ ├── static │ ├── css │ │ └── index.css │ └── js │ │ └── index.js │ └── templates │ └── index.ftl ├── springboot-getIp ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── app │ │ └── Application.java │ │ ├── controller │ │ └── TestController.java │ │ └── utils │ │ └── IPUtils.java │ └── resources │ └── application.properties ├── springboot-graylog ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── log │ │ └── InfoLog.java │ └── resources │ ├── docker-compose.yml │ └── logback-spring.xml ├── springboot-hbase ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ ├── HBaseClient.java │ │ ├── HbaseConfig.java │ │ └── HbaseProperties.java │ │ └── controller │ │ └── DemoController.java │ └── resources │ └── application.yml ├── springboot-hibernate ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── dao │ │ └── UserRepository.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.properties ├── springboot-i18n ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ └── LocaleConfig.java │ │ └── controller │ │ └── LoginController.java │ └── resources │ ├── application.yml │ ├── static │ └── i18n │ │ ├── messages.properties │ │ ├── messages_en_US.properties │ │ ├── messages_zh_CN.properties │ │ └── messages_zh_TW.properties │ └── templates │ └── login.html ├── springboot-influxdb ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ └── influxdb │ │ ├── Application.java │ │ ├── config │ │ └── InfluxDbTemplate.java │ │ ├── controller │ │ └── StudentController.java │ │ └── entity │ │ └── Student.java │ └── resources │ └── application.yml ├── springboot-interceptor ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── config │ └── InterceptorConfig.java │ ├── controller │ └── DemoController.java │ └── interceptor │ └── MyInterceptor.java ├── springboot-jasypt ├── pom.xml ├── readme.md └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── oven │ │ │ ├── Application.java │ │ │ └── controller │ │ │ └── TestController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── oven │ └── JasyptTest.java ├── springboot-jayway-jsonpath ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── oven │ └── jsonpath │ ├── Application.java │ └── Test.java ├── springboot-jdbcTemplate ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── dao │ │ └── UserDao.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.properties ├── springboot-jsp ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── DemoController.java │ ├── resources │ └── application.properties │ └── webapp │ └── WEB-INF │ └── jsp │ └── index.jsp ├── springboot-jwt ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── config │ └── InterceptorConfig.java │ ├── constants │ └── AppConst.java │ ├── controller │ └── DemoController.java │ ├── entity │ └── User.java │ ├── interceptor │ └── JwtInterceptor.java │ └── utils │ ├── JwtUtils.java │ └── ResultInfo.java ├── springboot-kafka ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── consumer │ │ └── KafkaConsumer.java │ │ ├── controller │ │ └── DemoController.java │ │ └── producer │ │ └── KafkaProducer.java │ └── resources │ └── application.properties ├── springboot-knife4j ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── config │ └── Knife4jConfig.java │ ├── controller │ └── DemoController.java │ └── entity │ └── User.java ├── springboot-lifecycle ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── app │ │ ├── Application.java │ │ └── DataLoader.java │ │ ├── controller │ │ └── DemoController.java │ │ └── event │ │ ├── EnvironmentPreparedEvent.java │ │ ├── FailedEvent.java │ │ ├── PreparedEvent.java │ │ ├── ReadyEvent.java │ │ ├── StartedEvent.java │ │ └── StartingEvent.java │ └── resources │ ├── META-INF │ └── spring.factories │ └── application.properties ├── springboot-limit ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ └── RedisConfig.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── limitation │ │ ├── Limit.java │ │ ├── LimitException.java │ │ ├── LimitInterceptor.java │ │ └── LimitType.java │ │ └── util │ │ └── IPUtils.java │ └── resources │ └── application.yml ├── springboot-listener ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── controller │ └── DemoController.java │ └── listener │ └── MyListener.java ├── springboot-logback ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── log │ │ ├── DebugLog.java │ │ ├── ErrorLog.java │ │ ├── InfoLog.java │ │ └── StdoutLog.java │ └── resources │ └── logback.xml ├── springboot-lucene ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── controller │ └── DemoController.java │ ├── entity │ └── Article.java │ └── util │ └── LuceneUtil.java ├── springboot-memcached ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ ├── MemcacheSource.java │ │ └── MemcachedRunner.java │ │ └── controller │ │ └── DemoController.java │ └── resources │ └── application.properties ├── springboot-minio ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── oven │ └── minio │ ├── config │ └── MinIoConfig.java │ ├── controller │ └── TestController.java │ └── service │ └── MinioService.java ├── springboot-mongodb ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── dao │ │ └── UserDao.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.yml ├── springboot-mqtt ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ └── mqtt │ │ ├── Application.java │ │ ├── config │ │ ├── MQTTCallback.java │ │ ├── MQTTClient.java │ │ ├── MQTTConfiguration.java │ │ └── MQTTProperties.java │ │ └── controller │ │ └── MqttController.java │ └── resources │ └── application.properties ├── springboot-multi-tenant ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ ├── DataSourceBasedMultiTenantConnectionProviderImpl.java │ │ ├── DefaultDataSourceConfig.java │ │ ├── TenantDataSource.java │ │ ├── dao │ │ │ └── DataSourceConfigDao.java │ │ └── entity │ │ │ └── DataSourceConfig.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── dao │ │ ├── BaseDao.java │ │ └── UserDao.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.properties ├── springboot-multiDatasource-jdbc ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ └── DatasouceConfig.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── dao │ │ └── UserDao.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.yml ├── springboot-multiDatasource-jpa ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ ├── DataSourceConfig.java │ │ ├── JpaConfigMySql.java │ │ └── JpaConfigOracle.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── dao │ │ ├── mysql │ │ │ └── MysqlUserDao.java │ │ └── oracle │ │ │ └── OracleUserDao.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.yml ├── springboot-multiDatasource-mybatis ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ ├── MySqlDataSourceConfig.java │ │ └── OracleDataSourceConfig.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── entity │ │ └── User.java │ │ ├── mapper │ │ ├── mysql │ │ │ └── MySqlMapper.java │ │ └── oracle │ │ │ └── OracleMapper.java │ │ └── service │ │ └── UserService.java │ └── resources │ ├── application.yml │ └── mapper │ ├── mysql │ └── MySqlMapper.xml │ └── oracle │ └── OracleMapper.xml ├── springboot-mybatis-annotation ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── entity │ │ └── User.java │ │ ├── mapper │ │ └── UserMapper.java │ │ └── service │ │ └── UserService.java │ └── resources │ └── application.properties ├── springboot-mybatis-plus ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── user │ │ ├── controller │ │ └── UserController.java │ │ ├── entity │ │ └── User.java │ │ ├── mapper │ │ └── UserMapper.java │ │ └── service │ │ ├── IUserService.java │ │ └── impl │ │ └── UserServiceImpl.java │ └── resources │ ├── application.yml │ └── mapper │ └── user │ └── UserMapper.xml ├── springboot-mybatis-xml ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── entity │ │ └── User.java │ │ ├── mapper │ │ └── UserMapper.java │ │ └── service │ │ └── UserService.java │ └── resources │ ├── application.properties │ └── mapper │ └── UserMapper.xml ├── springboot-netty ├── pom.xml ├── springboot-netty-client │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── oven │ │ │ └── netty │ │ │ ├── entity │ │ │ ├── MethodInvokeMeta.java │ │ │ ├── NullWritable.java │ │ │ └── User.java │ │ │ ├── exception │ │ │ ├── ErrorParamsException.java │ │ │ └── NoUseableChannel.java │ │ │ ├── study │ │ │ ├── StudyClientApplication.java │ │ │ ├── codec │ │ │ │ └── msgpack │ │ │ │ │ ├── MsgPackDecoder.java │ │ │ │ │ └── MsgPackEncoder.java │ │ │ ├── echo │ │ │ │ ├── delimiter │ │ │ │ │ ├── EchoClient.java │ │ │ │ │ └── EchoClientHandler.java │ │ │ │ ├── fixlength │ │ │ │ │ ├── EchoClient.java │ │ │ │ │ └── EchoClientHandler.java │ │ │ │ └── megpack │ │ │ │ │ ├── MessagePackClient.java │ │ │ │ │ └── MessagePackClientHandler.java │ │ │ ├── time │ │ │ │ ├── demo1 │ │ │ │ │ ├── TimeClient.java │ │ │ │ │ └── TimeClientHandler.java │ │ │ │ ├── demo2 │ │ │ │ │ ├── TimeClient.java │ │ │ │ │ └── TimeClientHandler.java │ │ │ │ └── demo3 │ │ │ │ │ ├── TimeClient.java │ │ │ │ │ └── TimeClientHandler.java │ │ │ └── websocket │ │ │ │ ├── WebSocketClient.java │ │ │ │ ├── WebSocketClientHandler.java │ │ │ │ ├── WebSocketConstant.java │ │ │ │ ├── WebSocketHandlerClient.java │ │ │ │ ├── WebSocketMessage.java │ │ │ │ └── WebSocketUsers.java │ │ │ └── util │ │ │ ├── ObjectCodec.java │ │ │ └── ObjectSerializerUtils.java │ │ └── test │ │ └── java │ │ └── com │ │ └── oven │ │ └── netty │ │ └── study │ │ └── StudyClientApplicationTests.java └── springboot-netty-server │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── oven │ │ └── netty │ │ ├── entity │ │ ├── MethodInvokeMeta.java │ │ ├── NullWritable.java │ │ └── User.java │ │ ├── exception │ │ ├── ErrorParamsException.java │ │ └── NoUseableChannel.java │ │ ├── study │ │ ├── StudyServerApplication.java │ │ ├── codec │ │ │ └── msgpack │ │ │ │ ├── MsgPackDecoder.java │ │ │ │ └── MsgPackEncoder.java │ │ ├── echo │ │ │ ├── delimiter │ │ │ │ ├── EchoServer.java │ │ │ │ └── EchoServerHandler.java │ │ │ ├── fixlength │ │ │ │ ├── EchoServer.java │ │ │ │ └── EchoServerHandler.java │ │ │ └── megpack │ │ │ │ ├── MessagePackServer.java │ │ │ │ └── MessagePackServerHandler.java │ │ ├── time │ │ │ ├── demo1 │ │ │ │ ├── ChildChannelHandler.java │ │ │ │ ├── TimeServer.java │ │ │ │ └── TimeServerHandler.java │ │ │ ├── demo2 │ │ │ │ ├── ChildChannelHandler.java │ │ │ │ ├── TimeServer.java │ │ │ │ └── TimeServerHandler.java │ │ │ └── demo3 │ │ │ │ ├── ChildChannelHandler.java │ │ │ │ ├── TimeServer.java │ │ │ │ └── TimeServerHandler.java │ │ └── websocket │ │ │ ├── WebSocketChildHandler.java │ │ │ ├── WebSocketConstant.java │ │ │ ├── WebSocketMessage.java │ │ │ ├── WebSocketServer.java │ │ │ ├── WebSocketServerHandler.java │ │ │ └── WebSocketUsers.java │ │ └── util │ │ ├── ObjectCodec.java │ │ └── ObjectSerializerUtils.java │ └── test │ └── java │ └── com │ └── oven │ └── netty │ └── study │ └── StudyServerApplicationTests.java ├── springboot-nginx-loadBalanced ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── controller │ │ └── DemoController.java │ └── resources │ └── application.yml ├── springboot-oauth2 ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── app │ │ └── Application.java │ │ ├── config │ │ ├── AuthorizationServerConfiguration.java │ │ ├── MyAccessDecisionManager.java │ │ ├── MyFilterSecurityInterceptor.java │ │ ├── MyInvocationSecurityMetadataSourceService.java │ │ ├── ResourceServerConfig.java │ │ ├── SecurityConfig.java │ │ └── WebResponseExceptionTranslateConfig.java │ │ ├── controller │ │ ├── HelloController.java │ │ └── MainController.java │ │ ├── entity │ │ ├── Role.java │ │ ├── RolePermisson.java │ │ └── User.java │ │ ├── mapper │ │ ├── PermissionMapper.java │ │ ├── RoleMapper.java │ │ └── UserMapper.java │ │ └── service │ │ └── MyUserDetailsService.java │ └── resources │ ├── application.properties │ └── templates │ └── login.html ├── springboot-okhttp ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ └── okhttp │ │ ├── Application.java │ │ ├── config │ │ └── CustomOkHttpClientRegistrar.java │ │ ├── controller │ │ └── StudentController.java │ │ ├── entity │ │ └── Student.java │ │ ├── http │ │ └── StudentServerApiService.java │ │ ├── service │ │ └── StudentService.java │ │ └── test │ │ └── Test.java │ └── resources │ └── application.yml ├── springboot-prometheus ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ └── Application.java │ └── resources │ └── application.properties ├── springboot-property ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ ├── PropertyConfig.java │ │ └── RedisConfig.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── RedisService.java │ └── resources │ └── application.properties ├── springboot-quartz-web ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ └── DemoController.java │ │ └── quartz │ │ ├── config │ │ └── QuartzSchedulerConfig.java │ │ └── job │ │ ├── MyJob1.java │ │ └── MyJob2.java │ └── resources │ ├── application.yml │ └── quartz.sql ├── springboot-quartz ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── quartz │ │ ├── config │ │ └── QuartzConfig.java │ │ └── job │ │ └── MyJob.java │ └── resources │ ├── application.yml │ └── quartz.sql ├── springboot-rabbitmq ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── consumer │ │ └── RabbitMQConsumer.java │ │ ├── controller │ │ └── DemoController.java │ │ └── producer │ │ └── RabbitMQProducer.java │ └── resources │ └── application.yml ├── springboot-redis ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ └── RedisConfig.java │ │ ├── controller │ │ └── DemoController.java │ │ ├── entity │ │ └── User.java │ │ └── service │ │ └── RedisService.java │ └── resources │ └── application.yml ├── springboot-redisson ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ ├── RedisConfig.java │ │ └── RedissionConfig.java │ │ └── controller │ │ └── DemoController.java │ └── resources │ └── application.yml ├── springboot-restTemplate ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── config │ │ └── RestTemplateConfig.java │ │ └── controller │ │ └── DemoController.java │ └── resources │ └── application.yml ├── springboot-restdoc ├── pom.xml ├── readme.md └── src │ ├── main │ ├── asciidoc │ │ └── index.adoc │ └── java │ │ └── com │ │ └── oven │ │ ├── Applaction.java │ │ ├── controller │ │ └── DemoController.java │ │ └── entity │ │ ├── ResultInfo.java │ │ └── User.java │ └── test │ └── java │ └── com │ └── oven │ └── test │ └── DemoTest.java ├── springboot-rocketmq ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── consumer │ │ ├── MessageListener.java │ │ └── RocketMQConsumer.java │ │ ├── controller │ │ └── DemoController.java │ │ └── producer │ │ └── RocketMQProducer.java │ └── resources │ └── application.properties ├── springboot-schedule ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ └── task │ └── ScheduleTask.java ├── springboot-sentinel ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── controller │ │ └── TestController.java │ └── resources │ └── application.properties ├── springboot-session ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── controller │ │ └── DemoController.java │ └── resources │ └── application.yml ├── springboot-shiro ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ ├── controller │ │ ├── DemoController.java │ │ └── UserController.java │ │ ├── entity │ │ └── User.java │ │ ├── service │ │ ├── RoleMenuService.java │ │ ├── RoleService.java │ │ └── UserService.java │ │ └── shiro │ │ ├── MyShiroRealm.java │ │ ├── NoPermissionException.java │ │ └── ShiroConfig.java │ └── resources │ └── templates │ ├── index.html │ ├── login.html │ └── noauth.html ├── springboot-sqlite ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ └── sqlite │ │ ├── Application.java │ │ ├── controller │ │ └── StudentController.java │ │ ├── dao │ │ └── StudentDao.java │ │ ├── entity │ │ └── Student.java │ │ ├── service │ │ └── StudentService.java │ │ └── utils │ │ └── PropertyRowMapper.java │ └── resources │ ├── application.yml │ └── db │ ├── data.sql │ ├── schema.sql │ └── test.db ├── springboot-sse ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ └── sse │ │ ├── Application.java │ │ ├── controller │ │ └── SSEController.java │ │ └── sse │ │ └── SseEmitterServer.java │ └── resources │ └── templates │ └── index.html ├── springboot-swagger2 ├── pom.xml ├── readme.md └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Appllication.java │ ├── config │ └── Swagger2Config.java │ ├── controller │ └── DemoController.java │ └── entity │ └── User.java ├── springboot-task ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── task │ │ └── DynamicScheduleTask.java │ └── resources │ └── application.properties ├── springboot-thymeleaf ├── pom.xml ├── readme.md └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ ├── Application.java │ │ └── DemoController.java │ └── resources │ ├── application.properties │ ├── static │ ├── css │ │ └── index.css │ └── js │ │ └── index.js │ └── templates │ └── index.html ├── springboot-webclient ├── pom.xml ├── springboot-webclient-client │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── oven │ │ │ └── webclient │ │ │ ├── Application.java │ │ │ ├── config │ │ │ └── WebClientConfig.java │ │ │ └── controller │ │ │ └── TestController.java │ │ └── resources │ │ └── application.yml └── springboot-webclient-server │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── com │ │ └── oven │ │ └── webclient │ │ ├── Application.java │ │ ├── controller │ │ └── TestController.java │ │ └── service │ │ └── TestService.java │ └── resources │ └── application.yml ├── springboot-webflux ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ └── controller │ └── HelloController.java ├── springboot-webservice ├── pom.xml ├── readme.md ├── springboot-webservice-client │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── oven │ │ │ ├── Application.java │ │ │ ├── config │ │ │ └── CxfClientConfig.java │ │ │ ├── controller │ │ │ └── DemoController.java │ │ │ └── wsdl │ │ │ ├── Gender.java │ │ │ ├── GetList.java │ │ │ ├── GetListResponse.java │ │ │ ├── GetString.java │ │ │ ├── GetStringResponse.java │ │ │ ├── GetUserByName.java │ │ │ ├── GetUserByNameResponse.java │ │ │ ├── ObjectFactory.java │ │ │ ├── User.java │ │ │ ├── UserPortType.java │ │ │ ├── UserService.java │ │ │ └── package-info.java │ │ └── resources │ │ └── application.yml └── springboot-webservice-server │ ├── pom.xml │ └── src │ └── main │ └── java │ └── com │ └── oven │ ├── Application.java │ ├── config │ └── CxfWebServiceConfig.java │ ├── entity │ ├── Gender.java │ └── User.java │ └── service │ ├── UserService.java │ └── impl │ └── UserServiceImpl.java └── springboot-websocket ├── pom.xml └── src └── main ├── java └── com │ └── oven │ ├── Application.java │ ├── config │ └── WebSocketConfig.java │ ├── controller │ └── GreetingController.java │ ├── entity │ ├── Greeting.java │ └── Message.java │ ├── listener │ └── STOMPConnectEventListener.java │ └── util │ └── SocketSessionMap.java └── resources ├── application.yml └── static ├── app.js ├── index.html └── main.css /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | !/.idea/icon.svg 3 | !/.idea/icon.png 4 | /**/target/ 5 | /**/*.iml 6 | 7 | /target/ 8 | /.git/ 9 | /.DS_Store 10 | /springboot-chowder.iml -------------------------------------------------------------------------------- /springboot-access-log/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-access-log/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class DemoController { 9 | 10 | @RequestMapping("/test") 11 | public User test(User user) { 12 | user.setAge(18); 13 | return user; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-access-log/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class User { 9 | 10 | private Integer id; 11 | private String name; 12 | private Integer age; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-access-log/src/main/java/com/oven/util/ParametersUtils.java: -------------------------------------------------------------------------------- 1 | package com.oven.util; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import java.util.Enumeration; 7 | 8 | public class ParametersUtils { 9 | 10 | public static String getParameters(HttpServletRequest req) { 11 | Enumeration enums = req.getParameterNames(); 12 | JSONObject parameter = new JSONObject(); 13 | while (enums.hasMoreElements()) { 14 | String name = enums.nextElement(); 15 | parameter.put(name, req.getParameter(name)); 16 | } 17 | return parameter.toJSONString(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /springboot-activemq/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-activemq/src/main/java/com/oven/consumer/ActiveMQConsumer.java: -------------------------------------------------------------------------------- 1 | package com.oven.consumer; 2 | 3 | import org.springframework.jms.annotation.JmsListener; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class ActiveMQConsumer { 8 | 9 | @JmsListener(destination = "springboot-activemq") 10 | public void consumer(String message) { 11 | System.out.printf("消费者收到消息:%s", message); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-activemq/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.producer.ActiveMQProducer; 4 | import org.apache.activemq.command.ActiveMQQueue; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import javax.annotation.Resource; 9 | import javax.jms.Destination; 10 | 11 | @RestController 12 | public class DemoController { 13 | 14 | @Resource 15 | private ActiveMQProducer producer; 16 | 17 | @RequestMapping("/send") 18 | public String send(String msg) { 19 | Destination destination = new ActiveMQQueue("springboot-activemq"); 20 | producer.send(destination, msg); 21 | return "发送成功!"; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /springboot-activemq/src/main/java/com/oven/producer/ActiveMQProducer.java: -------------------------------------------------------------------------------- 1 | package com.oven.producer; 2 | 3 | import org.springframework.jms.core.JmsMessagingTemplate; 4 | import org.springframework.stereotype.Component; 5 | 6 | import javax.annotation.Resource; 7 | import javax.jms.Destination; 8 | 9 | @Component 10 | public class ActiveMQProducer { 11 | 12 | @Resource 13 | private JmsMessagingTemplate messagingTemplate; 14 | 15 | public void send(Destination destination, String message) { 16 | messagingTemplate.convertAndSend(destination, message); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /springboot-activemq/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | activemq: 3 | broker-url: tcp://172.16.188.182:61616 4 | user: admin 5 | password: 123456 -------------------------------------------------------------------------------- /springboot-actuator/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-actuator/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class DemoController { 8 | 9 | @RequestMapping("/test") 10 | public String test(String name) { 11 | return "hello " + name; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-actuator/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | info: 2 | name: springboot-actuator 3 | version: v1.0.0 4 | management: 5 | endpoint: 6 | shutdown: 7 | enabled: true 8 | endpoints: 9 | web: 10 | exposure: 11 | include: '*' -------------------------------------------------------------------------------- /springboot-admin/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 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 Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-admin/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | boot: 3 | admin: 4 | client: 5 | url: http://localhost:8080 6 | management: 7 | endpoints: 8 | web: 9 | exposure: 10 | include: '*' 11 | info: 12 | name: demo 13 | author: Oven -------------------------------------------------------------------------------- /springboot-alipay/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-alipay/src/main/java/com/oven/config/AlipayConfig.java: -------------------------------------------------------------------------------- 1 | package com.oven.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Data 8 | @Component 9 | @ConfigurationProperties(prefix = "alipay") 10 | public class AlipayConfig { 11 | 12 | private String serverUrl; 13 | private String appId; 14 | private String privateKey; 15 | private String alipayPublicKey; 16 | private String notifyUrl; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-alipay/src/main/java/com/oven/constants/AppConstants.java: -------------------------------------------------------------------------------- 1 | package com.oven.constants; 2 | 3 | public interface AppConstants { 4 | 5 | String FORMAT = "JSON"; 6 | String CHARSET = "UTF-8"; 7 | String SIGN_TYPE = "RSA2"; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot-alipay/src/main/java/com/oven/entity/Alipay.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Alipay { 7 | 8 | private String traceNo; 9 | private double totalAmount; 10 | private String subject; 11 | private String alipayTraceNo; 12 | 13 | } -------------------------------------------------------------------------------- /springboot-alipay/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | alipay: 2 | server-url: https://openapi-sandbox.dl.alipaydev.com/gateway.do 3 | app-id: 1122 4 | private-key: 445566 5 | alipay-public-key: 778899 6 | notify-url: https://xxx.com/alipay/notify -------------------------------------------------------------------------------- /springboot-apidoc/apidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "springboot-apidoc", 3 | "version": "v1.0.0", 4 | "description": "springboot-apidoc的接口文档" 5 | } 6 | -------------------------------------------------------------------------------- /springboot-apidoc/src/main/java/com/oven/Appllication.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Appllication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Appllication.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-apidoc/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private Integer id; 9 | private String uname; 10 | private String pwd; 11 | private Integer age; 12 | 13 | } -------------------------------------------------------------------------------- /springboot-argumentResolver/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-argumentResolver/src/main/java/com/oven/annotation/CurrentUser.java: -------------------------------------------------------------------------------- 1 | package com.oven.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Documented 10 | @Target(ElementType.PARAMETER) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | public @interface CurrentUser { 13 | } 14 | -------------------------------------------------------------------------------- /springboot-argumentResolver/src/main/java/com/oven/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.oven.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.method.support.HandlerMethodArgumentResolver; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | import javax.annotation.Resource; 8 | import java.util.List; 9 | 10 | @Configuration 11 | public class WebConfig implements WebMvcConfigurer { 12 | 13 | @Resource 14 | private CurrentUserArgumentResolver currentUserArgumentResolver; 15 | 16 | @Override 17 | public void addArgumentResolvers(List resolvers) { 18 | resolvers.add(currentUserArgumentResolver); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-argumentResolver/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.annotation.CurrentUser; 4 | import com.oven.entity.User; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | @RestController 9 | public class DemoController { 10 | 11 | @RequestMapping("/test") 12 | public Object test(@CurrentUser User user) { 13 | return user; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-argumentResolver/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class User { 9 | 10 | private Integer id; 11 | private String uname; 12 | private String pwd; 13 | private Integer age; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-async/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | springboot-chowder 7 | com.oven 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | springboot-async 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter-web 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /springboot-async/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 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 Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-async/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.AsyncService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class DemoController { 11 | 12 | @Resource 13 | private AsyncService asyncService; 14 | 15 | @RequestMapping("/test") 16 | public String test() { 17 | try { 18 | asyncService.doSomething(); 19 | return "success"; 20 | } catch (Exception e) { 21 | e.printStackTrace(); 22 | return "error"; 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /springboot-async/src/main/java/com/oven/service/AsyncService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import org.springframework.scheduling.annotation.Async; 4 | import org.springframework.stereotype.Service; 5 | 6 | import java.util.concurrent.TimeUnit; 7 | 8 | @Service 9 | public class AsyncService { 10 | 11 | @Async 12 | public void doSomething() throws InterruptedException { 13 | for (int i = 0; i < 5; i++) { 14 | System.out.println("do something..." + i); 15 | TimeUnit.SECONDS.sleep(1); 16 | } 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /springboot-cache-caffeine/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 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 Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-cache-caffeine/src/main/java/com/oven/config/CacheType.java: -------------------------------------------------------------------------------- 1 | package com.oven.config; 2 | 3 | public enum CacheType { 4 | 5 | TEN(10), 6 | 7 | FIVE(5); 8 | 9 | private final int expires; 10 | 11 | CacheType(int expires) { 12 | this.expires = expires; 13 | } 14 | 15 | public int getExpires() { 16 | return expires; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /springboot-cache-caffeine/src/main/java/com/oven/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.UserService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class UserController { 11 | 12 | @Resource 13 | private UserService userService; 14 | 15 | @RequestMapping("/getById") 16 | public Object getById(Integer id) { 17 | return userService.getById(id); 18 | } 19 | 20 | @RequestMapping("/delete") 21 | public Object delete(Integer id) { 22 | userService.delete(id); 23 | return "删除成功!"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /springboot-cache-caffeine/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class User { 9 | 10 | private Integer id; 11 | private String uname; 12 | private String pwd; 13 | private Integer age; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-cache-caffeine/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.cache.annotation.CacheEvict; 5 | import org.springframework.cache.annotation.Cacheable; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class UserService { 10 | 11 | @CacheEvict(value = "FIVE", key = "#id") 12 | public void delete(Integer id) { 13 | System.out.println("删除key为[" + id + "]的缓存"); 14 | } 15 | 16 | @Cacheable(value = "FIVE", key = "#id", sync = true) 17 | public User getById(Integer id) { 18 | System.out.println("操作数据库,进行通过ID查询,ID: " + id); 19 | return new User(id, "admin", "123", 18); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-cache-ehcache/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 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 Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /springboot-cache-ehcache/src/main/java/com/oven/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.UserService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class UserController { 11 | 12 | @Resource 13 | private UserService userService; 14 | 15 | @RequestMapping("/getById") 16 | public Object getById(Integer id) { 17 | return userService.getById(id); 18 | } 19 | 20 | @RequestMapping("/delete") 21 | public Object delete(Integer id) { 22 | userService.delete(id); 23 | return "删除成功!"; 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /springboot-cache-ehcache/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class User { 9 | 10 | private Integer id; 11 | private String uname; 12 | private String pwd; 13 | private Integer age; 14 | 15 | } -------------------------------------------------------------------------------- /springboot-cache-ehcache/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.cache.annotation.CacheEvict; 5 | import org.springframework.cache.annotation.Cacheable; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class UserService { 10 | 11 | @CacheEvict(value = "user", key = "#id") 12 | public void delete(Integer id) { 13 | System.out.println("删除key为[" + id + "]的缓存"); 14 | } 15 | 16 | @Cacheable(value = "user", key = "#id", sync = true) 17 | public User getById(Integer id) { 18 | System.out.println("操作数据库,进行通过ID查询,ID: " + id); 19 | return new User(id, "admin", "123", 18); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /springboot-cache-ehcache/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cache: 3 | ehcache: 4 | config: classpath:ehcache.xml -------------------------------------------------------------------------------- /springboot-cache-ehcache/src/main/resources/ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /springboot-cache-guava/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 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 Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /springboot-cache-guava/src/main/java/com/oven/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.UserService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class UserController { 11 | 12 | @Resource 13 | private UserService userService; 14 | 15 | @RequestMapping("/getById") 16 | public Object getById(Integer id) { 17 | return userService.getById(id); 18 | } 19 | 20 | @RequestMapping("/delete") 21 | public Object delete(Integer id) { 22 | userService.delete(id); 23 | return "删除成功!"; 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /springboot-cache-guava/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class User { 9 | 10 | private Integer id; 11 | private String uname; 12 | private String pwd; 13 | private Integer age; 14 | 15 | } -------------------------------------------------------------------------------- /springboot-cache-guava/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.cache.annotation.CacheEvict; 5 | import org.springframework.cache.annotation.Cacheable; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class UserService { 10 | 11 | @CacheEvict(value = "user", key = "#id") 12 | public void delete(Integer id) { 13 | System.out.println("删除key为[" + id + "]的缓存"); 14 | } 15 | 16 | @Cacheable(value = "user", key = "#id", sync = true) 17 | public User getById(Integer id) { 18 | System.out.println("操作数据库,进行通过ID查询,ID: " + id); 19 | return new User(id, "admin", "123", 18); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /springboot-cache-redis/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 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 Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-cache-redis/src/main/java/com/oven/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.UserService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class UserController { 11 | 12 | @Resource 13 | private UserService userService; 14 | 15 | @RequestMapping("/getById") 16 | public Object getById(Integer id) { 17 | return userService.getById(id); 18 | } 19 | 20 | @RequestMapping("/delete") 21 | public String delete(Integer id) { 22 | userService.delete(id); 23 | return "删除成功"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /springboot-cache-redis/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | public class User implements Serializable { 11 | 12 | private Integer id; 13 | private String uname; 14 | private String pwd; 15 | private Integer age; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /springboot-cache-redis/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.cache.annotation.CacheConfig; 5 | import org.springframework.cache.annotation.CacheEvict; 6 | import org.springframework.cache.annotation.Cacheable; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | @CacheConfig(cacheNames = "user") 11 | public class UserService { 12 | 13 | @Cacheable 14 | public User getById(Integer id) { 15 | System.out.println("查询数据库了。。。"); 16 | return new User(id, "admin", "123", 18); 17 | } 18 | 19 | @CacheEvict 20 | public void delete(Integer id) { 21 | System.out.println("删除[" + id + "]缓存"); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /springboot-cache-redis/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | redis: 3 | host: localhost 4 | port: 6379 5 | password: 5217 -------------------------------------------------------------------------------- /springboot-cache-spring/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 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 Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /springboot-cache-spring/src/main/java/com/oven/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.UserService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class UserController { 11 | 12 | @Resource 13 | private UserService userService; 14 | 15 | @RequestMapping("/getById") 16 | public Object getById(Integer id) { 17 | return userService.getById(id); 18 | } 19 | 20 | @RequestMapping("/delete") 21 | public String delete(Integer id) { 22 | userService.delete(id); 23 | return "删除成功"; 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /springboot-cache-spring/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | public class User implements Serializable { 11 | 12 | private Integer id; 13 | private String uname; 14 | private String pwd; 15 | private Integer age; 16 | 17 | } -------------------------------------------------------------------------------- /springboot-cache-spring/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.cache.annotation.CacheConfig; 5 | import org.springframework.cache.annotation.CacheEvict; 6 | import org.springframework.cache.annotation.Cacheable; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | @CacheConfig(cacheNames = "user") 11 | public class UserService { 12 | 13 | @Cacheable 14 | public User getById(Integer id) { 15 | System.out.println("查询数据库了。。。"); 16 | return new User(id, "admin", "123", 18); 17 | } 18 | 19 | @CacheEvict 20 | public void delete(Integer id) { 21 | System.out.println("删除[" + id + "]缓存"); 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /springboot-caffeine/src/main/java/com/oven/app/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cache.annotation.EnableCaching; 6 | 7 | /** 8 | * 启动类 9 | * 10 | * @author Oven 11 | */ 12 | @EnableCaching 13 | @SpringBootApplication(scanBasePackages = "com.oven") 14 | public class Application { 15 | 16 | /** 17 | * 系统入口 18 | */ 19 | public static void main(String[] args) { 20 | SpringApplication.run(Application.class, args); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /springboot-caffeine/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 用户实体类 7 | * 8 | * @author Oven 9 | */ 10 | @Data 11 | public class User { 12 | 13 | private Integer id; 14 | private String userName; 15 | private Integer age; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /springboot-caffeine/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | spring: 4 | cache: 5 | cache-names: user 6 | caffeine: 7 | spec: initialCapacity=50,maximumSize=500,expireAfterWrite=60s -------------------------------------------------------------------------------- /springboot-commandLineRunner/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-commandLineRunner/src/main/java/com/oven/OrderRunner1.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | import org.springframework.core.annotation.Order; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Order(1) 8 | @Component 9 | public class OrderRunner1 implements CommandLineRunner { 10 | 11 | @Override 12 | public void run(String... args) { 13 | System.out.println("项目启动后就会执行。。。order。。。111"); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-commandLineRunner/src/main/java/com/oven/OrderRunner2.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | import org.springframework.core.annotation.Order; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Order(2) 8 | @Component 9 | public class OrderRunner2 implements CommandLineRunner { 10 | 11 | @Override 12 | public void run(String... args) { 13 | System.out.println("项目启动后就会执行。。。order。。。222"); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-commandLineRunner/src/main/java/com/oven/Runner2.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class Runner2 implements CommandLineRunner { 8 | 9 | @Override 10 | public void run(String... args) { 11 | System.out.println("项目启动后就会执行。。。222"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-commandLineRunner/src/main/java/com/oven/Runner3.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class Runner3 implements CommandLineRunner { 8 | 9 | @Override 10 | public void run(String... args) { 11 | System.out.println("项目启动后就会执行。。。111"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-cross/springboot-cross-client/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | springboot-cross 7 | com.oven 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | springboot-cross-client 13 | 14 | 15 | -------------------------------------------------------------------------------- /springboot-cross/springboot-cross-client/src/main/java/com/oven/app/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-cross/springboot-cross-client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 -------------------------------------------------------------------------------- /springboot-cross/springboot-cross-client/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 | -------------------------------------------------------------------------------- /springboot-cross/springboot-cross-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | springboot-cross 7 | com.oven 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | springboot-cross-server 13 | 14 | -------------------------------------------------------------------------------- /springboot-cross/springboot-cross-server/src/main/java/com/oven/app/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication(scanBasePackages = "com.oven") 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-cross/springboot-cross-server/src/main/java/com/oven/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.CrossOrigin; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | @RestController 9 | public class TestController { 10 | 11 | @GetMapping("/test") 12 | @CrossOrigin(value = {"http://localhost:8081"}) 13 | public Object test1() { 14 | return "test1"; 15 | } 16 | 17 | @PostMapping("/test") 18 | @CrossOrigin(value = {"http://localhost:8081"}) 19 | public Object test2() { 20 | return "test2"; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /springboot-cross/springboot-cross-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 -------------------------------------------------------------------------------- /springboot-dateformat/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-dateformat/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import java.util.Date; 8 | 9 | @RestController 10 | public class DemoController { 11 | 12 | @RequestMapping("/test") 13 | public User test() { 14 | User user = new User(); 15 | user.setId(27); 16 | user.setName("Oven"); 17 | user.setCreateTime(new Date()); 18 | return user; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-dateformat/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class User { 9 | 10 | private Integer id; 11 | private String name; 12 | private Date createTime; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-derby/src/main/java/com/oven/derby/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.derby; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-derby/src/main/java/com/oven/derby/entity/Student.java: -------------------------------------------------------------------------------- 1 | package com.oven.derby.entity; 2 | 3 | import lombok.Data; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Id; 7 | 8 | @Data 9 | public class Student { 10 | 11 | @Id 12 | @Column(name = "dbid") 13 | private Integer id; 14 | 15 | @Column(name = "name") 16 | private String name; 17 | 18 | @Column(name = "age") 19 | private Integer age; 20 | 21 | @Column(name = "gender") 22 | private Integer gender; 23 | 24 | @Column(name = "phone") 25 | private String phone; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /springboot-derby/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | derby: 2 | path: /Users/oven/Downloads/derby 3 | spring: 4 | datasource: 5 | type: com.alibaba.druid.pool.DruidDataSource 6 | driver-class-name: org.apache.derby.jdbc.EmbeddedDriver 7 | url: jdbc:derby:${derby.path};create=true 8 | username: root 9 | password: 123456 -------------------------------------------------------------------------------- /springboot-devtools/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-devtools/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class DemoController { 8 | 9 | @RequestMapping("/test") 10 | public String test(String name) { 11 | return "hello " + name; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-disruptor/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-disruptor/src/main/java/com/oven/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.TaskMessageService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @Resource 13 | private TaskMessageService taskMessageService; 14 | 15 | @RequestMapping("/test") 16 | public Object test(String msg) { 17 | taskMessageService.sendMessage(msg); 18 | return "发送成功"; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-disruptor/src/main/java/com/oven/entity/Message.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 消息体 7 | */ 8 | @Data 9 | public class Message { 10 | 11 | private String message; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-disruptor/src/main/java/com/oven/entity/MessageEventFactory.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import com.lmax.disruptor.EventFactory; 4 | 5 | public class MessageEventFactory implements EventFactory { 6 | 7 | @Override 8 | public Message newInstance() { 9 | return new Message(); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot-disruptor/src/main/java/com/oven/handler/TaskEventHandler.java: -------------------------------------------------------------------------------- 1 | package com.oven.handler; 2 | 3 | import com.lmax.disruptor.EventHandler; 4 | import com.oven.entity.Message; 5 | import lombok.extern.slf4j.Slf4j; 6 | 7 | /** 8 | * 任务消息处理器 9 | */ 10 | @Slf4j 11 | public class TaskEventHandler implements EventHandler { 12 | 13 | @Override 14 | public void onEvent(Message message, long sequence, boolean endOfBatch) { 15 | try { 16 | log.info("任务消息处理器收到消息sequence={},endOfBatch={},消息内容={}", message, sequence, endOfBatch); 17 | } catch (Exception e) { 18 | log.error("任务消息处理器异常:", e); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk-alpine 2 | VOLUME /tmp 3 | ADD target/springboot-docker-1.0.0.jar docker.jar 4 | ENTRYPOINT ["java","-jar","/docker.jar"] -------------------------------------------------------------------------------- /springboot-docker/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-docker/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class DemoController { 8 | 9 | @RequestMapping("/test") 10 | public Object test(String name) { 11 | return "hello " + name; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-docker/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8990 -------------------------------------------------------------------------------- /springboot-druid-monitor/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-druid-monitor/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.entity.User; 4 | import com.oven.service.UserService; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import javax.annotation.Resource; 9 | 10 | @RestController 11 | public class DemoController { 12 | 13 | @Resource 14 | private UserService userService; 15 | 16 | @RequestMapping("/add") 17 | public Object add(User user) { 18 | userService.add(user); 19 | return "添加成功"; 20 | } 21 | 22 | @RequestMapping("/get") 23 | public Object get() { 24 | return userService.get(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /springboot-druid-monitor/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private Integer id; 9 | private String uname; 10 | private String pwd; 11 | private Integer age; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-druid-monitor/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.dao.UserDao; 4 | import com.oven.entity.User; 5 | import org.springframework.stereotype.Service; 6 | 7 | import javax.annotation.Resource; 8 | import java.util.List; 9 | 10 | @Service 11 | public class UserService { 12 | 13 | @Resource 14 | private UserDao userDao; 15 | 16 | public void add(User user) { 17 | userDao.add(user); 18 | } 19 | 20 | public List get() { 21 | return userDao.get(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /springboot-dubbo/springboot-dubbo-client/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-dubbo/springboot-dubbo-client/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.DemoService; 4 | import org.apache.dubbo.config.annotation.Reference; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | @RestController 9 | public class DemoController { 10 | 11 | @Reference(version = "1.0.0") 12 | private DemoService demoService; 13 | 14 | @GetMapping("/test") 15 | public String getUserById(String name) { 16 | return demoService.sayHello(name); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /springboot-dubbo/springboot-dubbo-client/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 2 | dubbo.application.name=demo-consumer 3 | dubbo.protocol.name=dubbo 4 | dubbo.protocol.port=20880 5 | dubbo.registry.address=zookeeper://xxx.xxx.xxx.xxx:2181 -------------------------------------------------------------------------------- /springboot-dubbo/springboot-dubbo-common-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | springboot-dubbo 7 | com.oven 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | springboot-dubbo-common-api 13 | 14 | -------------------------------------------------------------------------------- /springboot-dubbo/springboot-dubbo-common-api/src/main/java/com/oven/service/DemoService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | public interface DemoService { 4 | 5 | String sayHello(String name); 6 | 7 | } -------------------------------------------------------------------------------- /springboot-dubbo/springboot-dubbo-server/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.apache.dubbo.config.spring.context.annotation.DubboComponentScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @DubboComponentScan("com.oven") 9 | public class Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-dubbo/springboot-dubbo-server/src/main/java/com/oven/service/impl/DemoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.oven.service.impl; 2 | 3 | import com.oven.service.DemoService; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.apache.dubbo.config.annotation.Service; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Slf4j 9 | @Component 10 | @Service(version = "1.0.0") 11 | public class DemoServiceImpl implements DemoService { 12 | 13 | @Override 14 | public String sayHello(String name) { 15 | log.info("dubbo服务端被调用了:{}", name); 16 | return "hello " + name; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /springboot-dubbo/springboot-dubbo-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | dubbo.application.name=demo-provider 3 | dubbo.protocol.name=dubbo 4 | dubbo.protocol.port=20880 5 | dubbo.registry.address=zookeeper://xxx.xxx.xxx.xxx:2181 -------------------------------------------------------------------------------- /springboot-dynamic-datasource/src/main/java/com/oven/app/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * 启动类 8 | * 9 | * @author Oven 10 | */ 11 | @SpringBootApplication(scanBasePackages = "com.oven") 12 | public class Application { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(Application.class, args); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-dynamic-datasource/src/main/java/com/oven/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.UserService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | /** 10 | * 测试控制器 11 | * 12 | * @author Oven 13 | */ 14 | @RestController 15 | public class TestController { 16 | 17 | @Resource 18 | private UserService userService; 19 | 20 | @RequestMapping("/findAll") 21 | public Object findAll(String dataSource) { 22 | return userService.findAll(dataSource); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /springboot-dynamic-datasource/src/main/java/com/oven/mapper/mysql/UserMySQLMapper.java: -------------------------------------------------------------------------------- 1 | package com.oven.mapper.mysql; 2 | 3 | import com.oven.entity.User; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * UserMapper 9 | * 10 | * @author Oven 11 | */ 12 | public interface UserMySQLMapper { 13 | 14 | List findAll(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-dynamic-datasource/src/main/java/com/oven/mapper/mysql/UserMySQLMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /springboot-dynamic-datasource/src/main/java/com/oven/mapper/oracle/UserOracleMapper.java: -------------------------------------------------------------------------------- 1 | package com.oven.mapper.oracle; 2 | 3 | import com.oven.entity.User; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * UserMapper 9 | * 10 | * @author Oven 11 | */ 12 | public interface UserOracleMapper { 13 | 14 | List findAll(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-dynamic-datasource/src/main/java/com/oven/mapper/oracle/UserOracleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /springboot-dynamic-datasource/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | mysql: 4 | driver-class-name: com.mysql.jdbc.Driver 5 | url: jdbc:mysql://localhost:3306/db_test_mysql 6 | username: root 7 | password: root 8 | oracle: 9 | driver-class-name: com.mysql.jdbc.Driver 10 | url: jdbc:mysql://localhost:3306/db_test_oracle 11 | username: root 12 | password: root -------------------------------------------------------------------------------- /springboot-dynamic-schedule/src/main/java/com/oven/app/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication(scanBasePackages = "com.oven") 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-easypoi/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-elasticjob/src/main/java/com/oven/job/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.job; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-elasticjob/src/main/java/com/oven/job/MySimpleJob.java: -------------------------------------------------------------------------------- 1 | package com.oven.job; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.apache.shardingsphere.elasticjob.api.ShardingContext; 5 | import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Slf4j 9 | @Service 10 | public class MySimpleJob implements SimpleJob { 11 | 12 | @Override 13 | public void execute(ShardingContext shardingContext) { 14 | log.info("MySimpleJob exec... {}", System.currentTimeMillis()); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /springboot-elasticjob/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | elasticjob.reg-center.server-lists=xxx.xxx.xxx.xxx:2181 2 | elasticjob.reg-center.namespace=springboot-elasticjob 3 | elasticjob.jobs.my-simple-job.elastic-job-class=com.oven.job.MySimpleJob 4 | elasticjob.jobs.my-simple-job.cron=0/5 * * * * ? 5 | elasticjob.jobs.my-simple-job.sharding-total-count=1 -------------------------------------------------------------------------------- /springboot-elasticsearch/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-elasticsearch/src/main/java/com/oven/dao/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.oven.dao; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 5 | 6 | public interface UserRepository extends ElasticsearchRepository { 7 | } 8 | -------------------------------------------------------------------------------- /springboot-elasticsearch/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | import org.springframework.data.elasticsearch.annotations.Document; 5 | 6 | @Data 7 | @Document(indexName = "users", type = "user") 8 | public class User { 9 | 10 | private Integer id; 11 | private String userName; 12 | private String password; 13 | private Integer age; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-elasticsearch/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.data.elasticsearch.cluster-nodes=xxx.xxx.xxx.xxx:9300 -------------------------------------------------------------------------------- /springboot-elk/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-elk/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @Slf4j 8 | @RestController 9 | public class DemoController { 10 | 11 | @RequestMapping("/test") 12 | public String test(String key) { 13 | log.info("打印日志了。。。{}", key); 14 | return "打印日志成功"; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /springboot-email/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-email/src/main/java/com/oven/service/MailService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | public interface MailService { 4 | 5 | /** 6 | * 发送简单文本的邮件 7 | */ 8 | boolean send(String to, String subject, String content); 9 | 10 | /** 11 | * 发送 html 的邮件 12 | */ 13 | boolean sendWithHtml(String to, String subject, String html); 14 | 15 | /** 16 | * 发送带有图片的 html 的邮件 17 | */ 18 | boolean sendWithImageHtml(String to, String subject, String html, String[] cids, String[] filePaths); 19 | 20 | /** 21 | * 发送带有附件的邮件 22 | */ 23 | boolean sendWithWithEnclosure(String to, String subject, String content, String[] filePaths); 24 | 25 | } -------------------------------------------------------------------------------- /springboot-email/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mail.host=smtp.qq.com 2 | spring.mail.username=503612012@qq.com 3 | spring.mail.password=xxxxxxxxxxxxxxxx 4 | spring.mail.properties.mail.smtp.auth=true 5 | spring.mail.properties.mail.smtp.starttls.enable=true 6 | spring.mail.properties.mail.smtp.starttls.required=true -------------------------------------------------------------------------------- /springboot-encry/src/main/java/com/oven/app/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication(scanBasePackages = "com.oven") 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-esper/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-esper/src/main/java/com/oven/listener/LocationListener1.java: -------------------------------------------------------------------------------- 1 | package com.oven.listener; 2 | 3 | import com.espertech.esper.client.EventBean; 4 | import com.espertech.esper.client.UpdateListener; 5 | 6 | public class LocationListener1 implements UpdateListener { 7 | @Override 8 | public void update(EventBean[] newEvents, EventBean[] oldEvents) { 9 | if (newEvents != null) { 10 | System.out.println(String.format(" 111 匹配成功,批到的位置为:%s,要发送的手机号为:%s,原始信息内容:%s", newEvents[0].get("location"), newEvents[0].get("phone"), newEvents[0].getUnderlying())); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /springboot-esper/src/main/java/com/oven/listener/LocationListener2.java: -------------------------------------------------------------------------------- 1 | package com.oven.listener; 2 | 3 | import com.espertech.esper.client.EventBean; 4 | import com.espertech.esper.client.UpdateListener; 5 | 6 | public class LocationListener2 implements UpdateListener { 7 | @Override 8 | public void update(EventBean[] newEvents, EventBean[] oldEvents) { 9 | if (newEvents != null) { 10 | System.out.println(String.format(" 222 匹配成功,批到的位置为:%s,要发送的手机号为:%s,原始信息内容:%s", newEvents[0].get("location"), newEvents[0].get("phone"), newEvents[0].getUnderlying())); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /springboot-event/src/main/java/com/oven/app/DataLoader.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | 5 | public class DataLoader implements CommandLineRunner { 6 | 7 | @Override 8 | public void run(String... args) { 9 | System.out.println("=================Loading data...================="); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot-event/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | 7 | @Controller 8 | public class DemoController { 9 | 10 | @ResponseBody 11 | @RequestMapping("/index") 12 | public String index() { 13 | return "index"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-event/src/main/java/com/oven/event/EnvironmentPreparedEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class EnvironmentPreparedEvent implements ApplicationListener { 7 | 8 | @Override 9 | public void onApplicationEvent(ApplicationEnvironmentPreparedEvent applicationEnvironmentPreparedEvent) { 10 | System.out.println("=================2. EnvironmentPreparedEvent================="); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-event/src/main/java/com/oven/event/FailedEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationFailedEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class FailedEvent implements ApplicationListener { 7 | 8 | @Override 9 | public void onApplicationEvent(ApplicationFailedEvent applicationFailedEvent) { 10 | System.out.println("=================6. FailedEvent================="); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-event/src/main/java/com/oven/event/PreparedEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationPreparedEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class PreparedEvent implements ApplicationListener { 7 | 8 | @Override 9 | public void onApplicationEvent(ApplicationPreparedEvent applicationPreparedEvent) { 10 | System.out.println("=================3. PreparedEvent================="); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-event/src/main/java/com/oven/event/ReadyEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationReadyEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class ReadyEvent implements ApplicationListener { 7 | 8 | @Override 9 | public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) { 10 | System.out.println("=================5. ReadyEvent================="); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-event/src/main/java/com/oven/event/StartedEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationStartedEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class StartedEvent implements ApplicationListener { 7 | 8 | @Override 9 | public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) { 10 | System.out.println("=================4. StartedEvent================="); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-event/src/main/java/com/oven/event/StartingEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationStartingEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class StartingEvent implements ApplicationListener { 7 | 8 | 9 | @Override 10 | public void onApplicationEvent(ApplicationStartingEvent applicationStartingEvent) { 11 | System.out.println("=================1. StartingEvent================="); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-event/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.context.ApplicationListener=com.oven.event.EnvironmentPreparedEvent,\ 2 | com.oven.event.FailedEvent,\ 3 | com.oven.event.PreparedEvent,\ 4 | com.oven.event.ReadyEvent,\ 5 | com.oven.event.StartedEvent,\ 6 | com.oven.event.StartingEvent -------------------------------------------------------------------------------- /springboot-event/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/503612012/springboot-chowder/f929ecf95f73dad375364ef8a3fa668550317b5e/springboot-event/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-exception/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-exception/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class DemoController { 8 | 9 | @RequestMapping("/index") 10 | @SuppressWarnings({"NumericOverflow", "unused", "divzero"}) 11 | public String index() { 12 | int i = 1 / 0; 13 | return "请求成功"; 14 | } 15 | 16 | @RequestMapping("/err") 17 | public String err() { 18 | return "error"; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-extend/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | springboot-chowder 7 | com.oven 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | springboot-extend 13 | pom 14 | 15 | springboot-base 16 | springboot-individualization 17 | 18 | 19 | -------------------------------------------------------------------------------- /springboot-extend/springboot-base/src/main/java/com/oven/app/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication(scanBasePackages = "com.oven") 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-extend/springboot-base/src/main/java/com/oven/controller/SaveController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.ISaveService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class SaveController { 11 | 12 | @Resource 13 | private ISaveService saveService; 14 | 15 | @RequestMapping("/save") 16 | public String save() { 17 | saveService.save(); 18 | return "true"; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-extend/springboot-base/src/main/java/com/oven/service/ISaveIndividualizationService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | public interface ISaveIndividualizationService { 4 | 5 | void preSave(); 6 | 7 | void afterSave(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot-extend/springboot-base/src/main/java/com/oven/service/ISaveService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | public interface ISaveService { 4 | 5 | void save(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /springboot-extend/springboot-individualization/src/main/java/com/oven/app/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication(scanBasePackages = "com.oven") 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-extend/springboot-individualization/src/main/java/com/oven/service/impl/ServiceIndividualizationImpl.java: -------------------------------------------------------------------------------- 1 | package com.oven.service.impl; 2 | 3 | import com.oven.service.ISaveIndividualizationService; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class ServiceIndividualizationImpl implements ISaveIndividualizationService { 8 | @Override 9 | public void preSave() { 10 | System.out.println("preSaving..."); 11 | } 12 | 13 | @Override 14 | public void afterSave() { 15 | System.out.println("afterSaveing..."); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /springboot-factory/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-factory/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.context.ServiceContext; 4 | import com.oven.service.IService; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import javax.annotation.Resource; 9 | 10 | @RestController 11 | public class DemoController { 12 | 13 | @Resource 14 | private ServiceContext serviceContext; 15 | 16 | @RequestMapping("/test") 17 | public Object test(String serviceId) { 18 | IService service = serviceContext.getService(serviceId); 19 | return service.doSomething(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-factory/src/main/java/com/oven/service/IService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | public interface IService { 4 | 5 | String serviceId(); 6 | 7 | String doSomething(); 8 | 9 | } -------------------------------------------------------------------------------- /springboot-factory/src/main/java/com/oven/service/impl/DefaultServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.oven.service.impl; 2 | 3 | import com.oven.service.IService; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class DefaultServiceImpl implements IService { 8 | 9 | @Override 10 | public String serviceId() { 11 | return "00"; 12 | } 13 | 14 | @Override 15 | public String doSomething() { 16 | return "hello 00"; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /springboot-factory/src/main/java/com/oven/service/impl/Service01Impl.java: -------------------------------------------------------------------------------- 1 | package com.oven.service.impl; 2 | 3 | import com.oven.service.IService; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class Service01Impl implements IService { 8 | 9 | @Override 10 | public String serviceId() { 11 | return "01"; 12 | } 13 | 14 | @Override 15 | public String doSomething() { 16 | return "hello 01"; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /springboot-factory/src/main/java/com/oven/service/impl/Service02Impl.java: -------------------------------------------------------------------------------- 1 | package com.oven.service.impl; 2 | 3 | import com.oven.service.IService; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class Service02Impl implements IService { 8 | 9 | @Override 10 | public String serviceId() { 11 | return "02"; 12 | } 13 | 14 | @Override 15 | public String doSomething() { 16 | return "hello 02"; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /springboot-factory/src/main/java/com/oven/service/impl/Service03Impl.java: -------------------------------------------------------------------------------- 1 | package com.oven.service.impl; 2 | 3 | import com.oven.service.IService; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class Service03Impl implements IService { 8 | 9 | @Override 10 | public String serviceId() { 11 | return "03"; 12 | } 13 | 14 | @Override 15 | public String doSomething() { 16 | return "hello 03"; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /springboot-fastdfs/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-fastdfs/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | fdfs.connect-timeout=600 2 | fdfs.so-timeout=1500 3 | fdfs.thumb-image.height=150 4 | fdfs.thumb-image.width=150 5 | fdfs.tracker-list=192.168.63.2:22122 6 | fdfs.pool.jmx-enabled=false -------------------------------------------------------------------------------- /springboot-fastdfs/src/main/resources/templates/upload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | springboot炖fileUpload 5 | 6 | 7 | 8 |
9 |

10 |
11 | 12 |
13 |

14 | 15 |
16 | 17 |
18 | 19 |

20 |
21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /springboot-fileUpload/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-fileUpload/src/main/resources/templates/upload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |

7 |
8 | 9 |
10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 | 22 |
23 |
    24 |
  • 25 | 26 |
  • 27 |
28 |
29 | 30 | 31 | -------------------------------------------------------------------------------- /springboot-filter/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.servlet.ServletComponentScan; 6 | 7 | @ServletComponentScan 8 | @SpringBootApplication 9 | public class Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-filter/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class DemoController { 8 | 9 | @RequestMapping("/test") 10 | public Object test(String name) { 11 | return "hello " + name; 12 | } 13 | 14 | @RequestMapping("/test2") 15 | public Object test2(String name) { 16 | return "hello " + name; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /springboot-freemarker/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-freemarker/src/main/java/com/oven/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | @Controller 8 | public class DemoController { 9 | 10 | @RequestMapping("/test") 11 | public String index(Model model) { 12 | model.addAttribute("msg", "Oven"); 13 | return "index"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-freemarker/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | 3 | # 设置ftl文件路径 4 | spring.freemarker.template-loader-path=classpath:/templates 5 | # 设置静态文件(css、js、图片等)路径 6 | spring.mvc.static-path-pattern=/static/** -------------------------------------------------------------------------------- /springboot-freemarker/src/main/resources/static/css/index.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | border: 2px solid red; 3 | } -------------------------------------------------------------------------------- /springboot-freemarker/src/main/resources/static/js/index.js: -------------------------------------------------------------------------------- 1 | alert("Oven"); -------------------------------------------------------------------------------- /springboot-freemarker/src/main/resources/templates/index.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 |

${msg}

11 | 12 | -------------------------------------------------------------------------------- /springboot-getIp/src/main/java/com/oven/app/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication(scanBasePackages = "com.oven") 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-getIp/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=5221 -------------------------------------------------------------------------------- /springboot-graylog/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-graylog/src/main/java/com/oven/log/InfoLog.java: -------------------------------------------------------------------------------- 1 | package com.oven.log; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.joda.time.DateTime; 5 | import org.springframework.boot.CommandLineRunner; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | @Slf4j 11 | @Component 12 | public class InfoLog implements CommandLineRunner { 13 | 14 | @Override 15 | public void run(String... args) throws Exception { 16 | while (true) { 17 | log.info("--------------------------- 打印日志了。。。" + new DateTime().toString("HH:mm:ss")); 18 | TimeUnit.SECONDS.sleep(2); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-hbase/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-hbase/src/main/java/com/oven/config/HbaseProperties.java: -------------------------------------------------------------------------------- 1 | package com.oven.config; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | 5 | import java.util.Map; 6 | 7 | @ConfigurationProperties(prefix = "hbase") 8 | public class HbaseProperties { 9 | 10 | private Map config; 11 | 12 | public Map getConfig() { 13 | return config; 14 | } 15 | 16 | public void setConfig(Map config) { 17 | this.config = config; 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /springboot-hbase/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | hbase: 2 | config: 3 | hbase.zookeeper.quorum: 192.168.63.2 4 | hbase.zookeeper.port: 2181 5 | hbase.zookeeper.znode: /hbase 6 | hbase.client.keyvalue.maxsize: 1572864000 -------------------------------------------------------------------------------- /springboot-hibernate/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-hibernate/src/main/java/com/oven/dao/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.oven.dao; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface UserRepository extends JpaRepository { 9 | 10 | User getByUname(String uname); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot-hibernate/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/db_test?useUnicode=true&characterEncoding=utf-8 2 | spring.datasource.driverClassName=com.mysql.jdbc.Driver 3 | spring.datasource.username=root 4 | spring.datasource.password=root 5 | spring.jpa.show-sql=true -------------------------------------------------------------------------------- /springboot-i18n/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-i18n/src/main/java/com/oven/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | public class LoginController { 8 | 9 | @RequestMapping("/") 10 | public String index() { 11 | return "login"; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-i18n/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | messages: 3 | basename: static/i18n/messages -------------------------------------------------------------------------------- /springboot-i18n/src/main/resources/static/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | user.title= -------------------------------------------------------------------------------- /springboot-i18n/src/main/resources/static/i18n/messages_en_US.properties: -------------------------------------------------------------------------------- 1 | user.title=User Login 2 | user.welcome=Welcome 3 | user.username=Username 4 | user.password=Password 5 | user.login=Sign In -------------------------------------------------------------------------------- /springboot-i18n/src/main/resources/static/i18n/messages_zh_CN.properties: -------------------------------------------------------------------------------- 1 | user.title=用户登陆 2 | user.welcome=欢迎 3 | user.username=登陆用户 4 | user.password=登陆密码 5 | user.login=登陆 -------------------------------------------------------------------------------- /springboot-i18n/src/main/resources/static/i18n/messages_zh_TW.properties: -------------------------------------------------------------------------------- 1 | user.title=用戶登陸 2 | user.welcome=歡迎 3 | user.username=登陸用戶 4 | user.password=登陸密碼 5 | user.login=登陸 -------------------------------------------------------------------------------- /springboot-influxdb/src/main/java/com/oven/influxdb/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.influxdb; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableScheduling; 6 | 7 | /** 8 | *

docker run -d -p 2086:8086 --name influxdb influxdb:1.6.3

9 | * 10 | *

docker exec -it influxdb influx

11 | * 12 | *

create database test

13 | */ 14 | @EnableScheduling 15 | @SpringBootApplication 16 | public class Application { 17 | 18 | public static void main(String[] args) { 19 | SpringApplication.run(Application.class, args); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-influxdb/src/main/java/com/oven/influxdb/entity/Student.java: -------------------------------------------------------------------------------- 1 | package com.oven.influxdb.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Map; 6 | 7 | @Data 8 | public class Student { 9 | 10 | private Integer id; 11 | private String name; 12 | private Integer age; 13 | private String phone; 14 | 15 | private String time; 16 | private Map fields; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-influxdb/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | influx: 3 | url: http://192.168.63.2:2086 4 | user: admin 5 | password: -------------------------------------------------------------------------------- /springboot-interceptor/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-interceptor/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class DemoController { 8 | 9 | @RequestMapping("/test") 10 | public Object test(String name) { 11 | return "hello " + name; 12 | } 13 | 14 | @RequestMapping("/test2") 15 | public Object test2(String name) { 16 | return "hello " + name; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /springboot-jasypt/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-jasypt/src/main/java/com/oven/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class TestController { 9 | 10 | @Value("${com.name}") 11 | private String name; 12 | 13 | @RequestMapping("/get") 14 | public String get() { 15 | return name; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-jasypt/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 用来加密的salt值 2 | jasypt.encryptor.password=5217 3 | # 加密的算法 4 | jasypt.encryptor.iv-generator-classname=org.jasypt.salt.RandomIVGenerator 5 | com.name=ENC(kwYxvK1ssjcDMCMqMdRhvQ==) -------------------------------------------------------------------------------- /springboot-jayway-jsonpath/src/main/java/com/oven/jsonpath/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.jsonpath; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-jdbcTemplate/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-jdbcTemplate/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private Integer id; 9 | private String uname; 10 | private String pwd; 11 | private Integer age; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-jdbcTemplate/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/db_test?useUnicode=true&characterEncoding=utf-8 2 | spring.datasource.driverClassName=com.mysql.jdbc.Driver 3 | spring.datasource.username=root 4 | spring.datasource.password=root -------------------------------------------------------------------------------- /springboot-jsp/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-jsp/src/main/java/com/oven/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.servlet.ModelAndView; 6 | 7 | @Controller 8 | public class DemoController { 9 | 10 | @RequestMapping("/test") 11 | public ModelAndView text() { 12 | ModelAndView mv = new ModelAndView("index"); 13 | mv.addObject("msg", "Oven"); 14 | return mv; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /springboot-jsp/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.view.prefix=/WEB-INF/jsp/ 2 | spring.mvc.view.suffix=.jsp -------------------------------------------------------------------------------- /springboot-jsp/src/main/webapp/WEB-INF/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

${msg}

9 | 10 | -------------------------------------------------------------------------------- /springboot-jwt/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-jwt/src/main/java/com/oven/constants/AppConst.java: -------------------------------------------------------------------------------- 1 | package com.oven.constants; 2 | 3 | /** 4 | * 系统常量定义类 5 | */ 6 | public class AppConst { 7 | 8 | public static final String USER_INFO_KEY = "user_info_key"; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /springboot-jwt/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private Integer id; 9 | private String userName; 10 | private String password; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot-kafka/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-kafka/src/main/java/com/oven/consumer/KafkaConsumer.java: -------------------------------------------------------------------------------- 1 | package com.oven.consumer; 2 | 3 | import org.springframework.kafka.annotation.KafkaListener; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class KafkaConsumer { 8 | 9 | @KafkaListener(topics = {"springboot-kafka"}) 10 | public void consumer(String message) { 11 | System.out.printf("消费者接受到消息:%s", message); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-kafka/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.producer.KafkaProducer; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class DemoController { 11 | 12 | @Resource 13 | private KafkaProducer producer; 14 | 15 | @RequestMapping("/send") 16 | public String send(String msg) { 17 | producer.send("springboot-kafka", msg); 18 | return "发送成功"; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-kafka/src/main/java/com/oven/producer/KafkaProducer.java: -------------------------------------------------------------------------------- 1 | package com.oven.producer; 2 | 3 | import org.springframework.kafka.core.KafkaTemplate; 4 | import org.springframework.stereotype.Component; 5 | 6 | import javax.annotation.Resource; 7 | 8 | @Component 9 | public class KafkaProducer { 10 | 11 | @Resource 12 | private KafkaTemplate kafkaTemplate; 13 | 14 | public void send(String topic, String message) { 15 | kafkaTemplate.send(topic, message); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-kafka/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.kafka.producer.bootstrap-servers=192.168.63.2:9092 2 | spring.kafka.consumer.bootstrap-servers=${spring.kafka.producer.bootstrap-servers} 3 | spring.kafka.consumer.group-id=consumer_group 4 | spring.kafka.consumer.enable-auto-commit=true 5 | spring.kafka.consumer.auto-offset-reset=latest -------------------------------------------------------------------------------- /springboot-knife4j/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-knife4j/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | @Data 8 | @ApiModel(value = "用户实体类", description = "用户实体类信息") 9 | public class User { 10 | 11 | @ApiModelProperty(value = "用户主键", dataType = "int", example = "1") 12 | private Integer id; 13 | @ApiModelProperty(value = "用户名", dataType = "string", example = "admin") 14 | private String uname; 15 | @ApiModelProperty(value = "用户密码", dataType = "string", example = "123456") 16 | private String pwd; 17 | @ApiModelProperty(value = "用户年龄", dataType = "int", example = "18") 18 | private Integer age; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /springboot-lifecycle/src/main/java/com/oven/app/DataLoader.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.CommandLineRunner; 5 | 6 | @Slf4j 7 | public class DataLoader implements CommandLineRunner { 8 | 9 | @Override 10 | public void run(String... args) { 11 | log.info("=================Loading data...================="); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-lifecycle/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | 7 | @Controller 8 | public class DemoController { 9 | 10 | @ResponseBody 11 | @RequestMapping("/index") 12 | public String index() { 13 | return "index"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-lifecycle/src/main/java/com/oven/event/EnvironmentPreparedEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class EnvironmentPreparedEvent implements ApplicationListener { 7 | 8 | @Override 9 | public void onApplicationEvent(ApplicationEnvironmentPreparedEvent applicationEnvironmentPreparedEvent) { 10 | System.out.println("=================2. EnvironmentPreparedEvent================="); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-lifecycle/src/main/java/com/oven/event/FailedEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationFailedEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class FailedEvent implements ApplicationListener { 7 | 8 | @Override 9 | public void onApplicationEvent(ApplicationFailedEvent applicationFailedEvent) { 10 | System.out.println("=================6. FailedEvent================="); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-lifecycle/src/main/java/com/oven/event/PreparedEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationPreparedEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class PreparedEvent implements ApplicationListener { 7 | 8 | @Override 9 | public void onApplicationEvent(ApplicationPreparedEvent applicationPreparedEvent) { 10 | System.out.println("=================3. PreparedEvent================="); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-lifecycle/src/main/java/com/oven/event/ReadyEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationReadyEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class ReadyEvent implements ApplicationListener { 7 | 8 | @Override 9 | public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) { 10 | System.out.println("=================5. ReadyEvent================="); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-lifecycle/src/main/java/com/oven/event/StartedEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationStartedEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class StartedEvent implements ApplicationListener { 7 | 8 | @Override 9 | public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) { 10 | System.out.println("=================4. StartedEvent================="); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-lifecycle/src/main/java/com/oven/event/StartingEvent.java: -------------------------------------------------------------------------------- 1 | package com.oven.event; 2 | 3 | import org.springframework.boot.context.event.ApplicationStartingEvent; 4 | import org.springframework.context.ApplicationListener; 5 | 6 | public class StartingEvent implements ApplicationListener { 7 | 8 | 9 | @Override 10 | public void onApplicationEvent(ApplicationStartingEvent applicationStartingEvent) { 11 | System.out.println("=================1. StartingEvent================="); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-lifecycle/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.context.ApplicationListener=com.oven.event.EnvironmentPreparedEvent,\ 2 | com.oven.event.FailedEvent,\ 3 | com.oven.event.PreparedEvent,\ 4 | com.oven.event.ReadyEvent,\ 5 | com.oven.event.StartedEvent,\ 6 | com.oven.event.StartingEvent -------------------------------------------------------------------------------- /springboot-lifecycle/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/503612012/springboot-chowder/f929ecf95f73dad375364ef8a3fa668550317b5e/springboot-lifecycle/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-limit/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-limit/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.limitation.Limit; 4 | import com.oven.limitation.LimitType; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | @RestController 9 | public class DemoController { 10 | 11 | @RequestMapping("/limit") 12 | @Limit(key = "limit.key", period = 5, count = 5, errMsg = "限流异常", limitType = LimitType.IP_AND_METHOD) 13 | public String limit() { 14 | return "hello..."; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /springboot-limit/src/main/java/com/oven/limitation/LimitException.java: -------------------------------------------------------------------------------- 1 | package com.oven.limitation; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | 6 | /** 7 | * 自定义限流异常类 8 | */ 9 | @Data 10 | @EqualsAndHashCode(callSuper = true) 11 | public class LimitException extends RuntimeException { 12 | 13 | private static final long serialVersionUID = -1920795727304163167L; 14 | 15 | private Integer code; 16 | private String msg; 17 | 18 | LimitException(Integer code, String msg) { 19 | this.code = code; 20 | this.msg = msg; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /springboot-limit/src/main/java/com/oven/limitation/LimitType.java: -------------------------------------------------------------------------------- 1 | package com.oven.limitation; 2 | 3 | public enum LimitType { 4 | 5 | /** 6 | * ip+方法名 7 | */ 8 | IP_AND_METHOD, 9 | 10 | /** 11 | * 自定义key 12 | */ 13 | CUSTOMER, 14 | 15 | /** 16 | * 根据请求者IP 17 | */ 18 | IP 19 | 20 | } 21 | -------------------------------------------------------------------------------- /springboot-limit/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | redis: 3 | host: localhost 4 | port: 6379 5 | password: 5217 -------------------------------------------------------------------------------- /springboot-listener/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.servlet.ServletComponentScan; 6 | 7 | @ServletComponentScan 8 | @SpringBootApplication 9 | public class Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /springboot-listener/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class DemoController { 8 | 9 | @RequestMapping("/test") 10 | public Object test(String name) { 11 | return "hello " + name; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /springboot-listener/src/main/java/com/oven/listener/MyListener.java: -------------------------------------------------------------------------------- 1 | package com.oven.listener; 2 | 3 | import javax.servlet.ServletRequestEvent; 4 | import javax.servlet.ServletRequestListener; 5 | import javax.servlet.annotation.WebListener; 6 | 7 | @WebListener 8 | public class MyListener implements ServletRequestListener { 9 | 10 | @Override 11 | public void requestDestroyed(ServletRequestEvent servletRequestEvent) { 12 | System.out.println("监听器销毁。。。"); 13 | } 14 | 15 | @Override 16 | public void requestInitialized(ServletRequestEvent servletRequestEvent) { 17 | System.out.println("监听器初始化。。。"); 18 | String name = servletRequestEvent.getServletRequest().getParameter("name"); 19 | System.out.println(name); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-logback/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-logback/src/main/java/com/oven/log/DebugLog.java: -------------------------------------------------------------------------------- 1 | package com.oven.log; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.CommandLineRunner; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.concurrent.TimeUnit; 8 | 9 | @Slf4j 10 | @Component 11 | public class DebugLog implements CommandLineRunner { 12 | 13 | @Override 14 | public void run(String... args) { 15 | new Thread(() -> { 16 | while (true) { 17 | log.debug("debug日志。。。"); 18 | try { 19 | TimeUnit.SECONDS.sleep(2); 20 | } catch (InterruptedException e) { 21 | e.printStackTrace(); 22 | } 23 | } 24 | }).start(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /springboot-logback/src/main/java/com/oven/log/ErrorLog.java: -------------------------------------------------------------------------------- 1 | package com.oven.log; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.CommandLineRunner; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.concurrent.TimeUnit; 8 | 9 | @Slf4j 10 | @Component 11 | public class ErrorLog implements CommandLineRunner { 12 | 13 | @Override 14 | public void run(String... args) { 15 | new Thread(() -> { 16 | while (true) { 17 | log.error("error日志。。。"); 18 | try { 19 | TimeUnit.SECONDS.sleep(2); 20 | } catch (InterruptedException e) { 21 | e.printStackTrace(); 22 | } 23 | } 24 | }).start(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /springboot-lucene/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-lucene/src/main/java/com/oven/entity/Article.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Article { 7 | 8 | private Integer id; 9 | private String author; 10 | private String content; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot-memcached/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-memcached/src/main/java/com/oven/config/MemcacheSource.java: -------------------------------------------------------------------------------- 1 | package com.oven.config; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | @ConfigurationProperties(prefix = "springboot.memcache") 8 | public class MemcacheSource { 9 | 10 | private String ip; 11 | private int port; 12 | 13 | public String getIp() { 14 | return ip; 15 | } 16 | 17 | public void setIp(String ip) { 18 | this.ip = ip; 19 | } 20 | 21 | public int getPort() { 22 | return port; 23 | } 24 | 25 | public void setPort(int port) { 26 | this.port = port; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /springboot-memcached/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.config.MemcachedRunner; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class DemoController { 11 | 12 | @Resource 13 | private MemcachedRunner memcachedRunner; 14 | 15 | @RequestMapping("/set") 16 | public void set(String key, String value) { 17 | memcachedRunner.getClient().set(key, 1000, value); 18 | } 19 | 20 | @RequestMapping("/get") 21 | public String get(String key) { 22 | return memcachedRunner.getClient().get(key).toString(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /springboot-memcached/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | springboot.memcache.ip=192.168.63.2 2 | springboot.memcache.port=11211 -------------------------------------------------------------------------------- /springboot-minio/src/main/java/com/oven/minio/config/MinIoConfig.java: -------------------------------------------------------------------------------- 1 | package com.oven.minio.config; 2 | 3 | import io.minio.MinioClient; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class MinIoConfig { 9 | 10 | @Bean 11 | public MinioClient initMinioClient() { 12 | return MinioClient.builder() 13 | .endpoint("http://192.168.1.69:9000") 14 | .credentials("AC3EAkuaiyGASwgP0DIl", "uQZiWKrD5SxsjUWJdF7Ed9s6fs5LvtCKyzPgKzUX") 15 | .build(); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-mongodb/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mongodb/src/main/java/com/oven/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package com.oven.dao; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.data.mongodb.repository.MongoRepository; 5 | 6 | public interface UserDao extends MongoRepository { 7 | } 8 | -------------------------------------------------------------------------------- /springboot-mongodb/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private Integer id; 9 | private String name; 10 | private Integer age; 11 | private String pwd; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mongodb/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.dao.UserDao; 4 | import com.oven.entity.User; 5 | import org.springframework.stereotype.Service; 6 | 7 | import javax.annotation.Resource; 8 | import java.util.List; 9 | 10 | @Service 11 | public class UserService { 12 | 13 | @Resource 14 | private UserDao userDao; 15 | 16 | public void save(User user) { 17 | userDao.save(user); 18 | } 19 | 20 | public List findAll() { 21 | return userDao.findAll(); 22 | } 23 | 24 | public void delete(Integer id) { 25 | userDao.deleteById(id); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /springboot-mongodb/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | data: 3 | mongodb: 4 | host: 192.168.63.2 5 | port: 27017 6 | database: springboot_mongo -------------------------------------------------------------------------------- /springboot-mqtt/readme.md: -------------------------------------------------------------------------------- 1 | # springboot炖mqtt 2 | 3 | #### 启动mqtt服务 4 | 5 | ```shell 6 | docker run -d --name emqx -p 1883:1883 -p 8083:8083 -p 8084:8084 -p 8883:8883 -p 18083:18083 emqx/emqx 7 | ``` 8 | -------------------------------------------------------------------------------- /springboot-mqtt/src/main/java/com/oven/mqtt/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.mqtt; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mqtt/src/main/java/com/oven/mqtt/controller/MqttController.java: -------------------------------------------------------------------------------- 1 | package com.oven.mqtt.controller; 2 | 3 | import com.oven.mqtt.config.MQTTClient; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import javax.annotation.Resource; 9 | 10 | @RestController 11 | public class MqttController { 12 | 13 | @Resource 14 | private MQTTClient mqttClient; 15 | 16 | @ResponseBody 17 | @RequestMapping("/send") 18 | public void send(String msg) { 19 | mqttClient.publish(msg, "mqtt_topic"); 20 | mqttClient.publish(msg, "/aicam/aisp/1923fdb39294684f/state"); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /springboot-mqtt/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | publish.mqtt.host=tcp://10.19.32.162:7008 3 | publish.mqtt.username=admin 4 | publish.mqtt.password=public 5 | publish.mqtt.cleanSession=false 6 | publish.mqtt.clientId=mqtt_localhost 7 | publish.mqtt.default_topic=test 8 | publish.mqtt.timeout=1000 9 | publish.mqtt.keepalive=10 10 | publish.mqtt.connectionTimeout=3000 -------------------------------------------------------------------------------- /springboot-multi-tenant/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-multi-tenant/src/main/java/com/oven/config/DefaultDataSourceConfig.java: -------------------------------------------------------------------------------- 1 | package com.oven.config; 2 | 3 | import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.annotation.Primary; 8 | 9 | import javax.sql.DataSource; 10 | 11 | @Configuration 12 | public class DefaultDataSourceConfig { 13 | 14 | @Primary 15 | @Bean(name = "defaultDataSource") 16 | @ConfigurationProperties("spring.datasouce") 17 | public DataSource defaultDataSource() { 18 | return DruidDataSourceBuilder.create().build(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-multi-tenant/src/main/java/com/oven/config/entity/DataSourceConfig.java: -------------------------------------------------------------------------------- 1 | package com.oven.config.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class DataSourceConfig { 7 | 8 | private Long id; 9 | private String name; 10 | private String url; 11 | private String username; 12 | private String password; 13 | private String driverClassName; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-multi-tenant/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.service.UserService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class DemoController { 11 | 12 | @Resource 13 | private UserService userService; 14 | 15 | @RequestMapping("/get") 16 | public Object get() { 17 | return userService.get(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /springboot-multi-tenant/src/main/java/com/oven/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package com.oven.dao; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import java.util.List; 7 | 8 | @Repository 9 | public class UserDao extends BaseDao { 10 | 11 | public List get() { 12 | String sql = "select * from t_user"; 13 | return super.getJdbcTemplate().query(sql, (rs, rowNum) -> { 14 | User user = new User(); 15 | user.setId(rs.getInt("dbid")); 16 | user.setUname(rs.getString("uname")); 17 | user.setPwd(rs.getString("pwd")); 18 | user.setAge(rs.getInt("age")); 19 | return user; 20 | }); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /springboot-multi-tenant/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private Integer id; 9 | private String uname; 10 | private String pwd; 11 | private Integer age; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-multi-tenant/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.dao.UserDao; 4 | import com.oven.entity.User; 5 | import org.springframework.stereotype.Service; 6 | 7 | import javax.annotation.Resource; 8 | import java.util.List; 9 | 10 | @Service 11 | public class UserService { 12 | 13 | @Resource 14 | private UserDao userDao; 15 | 16 | public List get() { 17 | return userDao.get(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /springboot-multi-tenant/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/db_test?useUnicode=true&characterEncoding=utf-8 2 | spring.datasource.driverClassName=com.mysql.jdbc.Driver 3 | spring.datasource.username=root 4 | spring.datasource.password=root -------------------------------------------------------------------------------- /springboot-multiDatasource-jdbc/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-multiDatasource-jdbc/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private Integer id; 9 | private String uname; 10 | private String pwd; 11 | private Integer age; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-multiDatasource-jdbc/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.dao.UserDao; 4 | import com.oven.entity.User; 5 | import org.springframework.stereotype.Service; 6 | 7 | import javax.annotation.Resource; 8 | import java.util.List; 9 | 10 | @Service 11 | public class UserService { 12 | 13 | @Resource 14 | private UserDao userDao; 15 | 16 | public List getMysql() { 17 | return userDao.getMysql(); 18 | } 19 | 20 | public List getOracle() { 21 | return userDao.getOracle(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /springboot-multiDatasource-jdbc/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | druid: 4 | mysql: 5 | type: com.alibaba.druid.pool.DruidDataSource 6 | driver-class-name: com.mysql.jdbc.Driver 7 | url: jdbc:mysql://localhost:3306/db_test?useUnicode=true&characterEncoding=utf-8 8 | username: root 9 | password: root 10 | oracle: 11 | type: com.alibaba.druid.pool.DruidDataSource 12 | driver-class-name: com.mysql.jdbc.Driver 13 | url: jdbc:mysql://localhost:3306/db_test2?useUnicode=true&characterEncoding=utf-8 14 | username: root 15 | password: root -------------------------------------------------------------------------------- /springboot-multiDatasource-jpa/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-multiDatasource-jpa/src/main/java/com/oven/dao/mysql/MysqlUserDao.java: -------------------------------------------------------------------------------- 1 | package com.oven.dao.mysql; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface MysqlUserDao extends JpaRepository { 9 | } 10 | -------------------------------------------------------------------------------- /springboot-multiDatasource-jpa/src/main/java/com/oven/dao/oracle/OracleUserDao.java: -------------------------------------------------------------------------------- 1 | package com.oven.dao.oracle; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface OracleUserDao extends JpaRepository { 9 | } 10 | -------------------------------------------------------------------------------- /springboot-multiDatasource-jpa/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | import javax.persistence.*; 6 | 7 | @Data 8 | @Entity 9 | @Table(name = "t_user") 10 | public class User { 11 | 12 | @Id 13 | @Column(name = "dbid") 14 | @GeneratedValue(strategy = GenerationType.AUTO) 15 | private Integer id; 16 | @Column(name = "uname") 17 | private String uname; 18 | @Column(name = "pwd") 19 | private String pwd; 20 | @Column(name = "age") 21 | private Integer age; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /springboot-multiDatasource-jpa/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.dao.mysql.MysqlUserDao; 4 | import com.oven.dao.oracle.OracleUserDao; 5 | import com.oven.entity.User; 6 | import org.springframework.stereotype.Service; 7 | 8 | import javax.annotation.Resource; 9 | import java.util.List; 10 | 11 | @Service 12 | public class UserService { 13 | 14 | @Resource 15 | private MysqlUserDao mysqlUserDao; 16 | @Resource 17 | private OracleUserDao oracleUserDao; 18 | 19 | public List getMysql() { 20 | return mysqlUserDao.findAll(); 21 | } 22 | 23 | public List getOracle() { 24 | return oracleUserDao.findAll(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /springboot-multiDatasource-jpa/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | druid: 4 | mysql: 5 | type: com.alibaba.druid.pool.DruidDataSource 6 | driver-class-name: com.mysql.jdbc.Driver 7 | url: jdbc:mysql://localhost:3306/db_test?useUnicode=true&characterEncoding=utf-8 8 | username: root 9 | password: root 10 | oracle: 11 | type: com.alibaba.druid.pool.DruidDataSource 12 | driver-class-name: com.mysql.jdbc.Driver 13 | url: jdbc:mysql://localhost:3306/db_test2?useUnicode=true&characterEncoding=utf-8 14 | username: root 15 | password: root 16 | jpa: 17 | show-sql: true -------------------------------------------------------------------------------- /springboot-multiDatasource-mybatis/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-multiDatasource-mybatis/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private Integer id; 9 | private String uname; 10 | private String pwd; 11 | private Integer age; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-multiDatasource-mybatis/src/main/java/com/oven/mapper/mysql/MySqlMapper.java: -------------------------------------------------------------------------------- 1 | package com.oven.mapper.mysql; 2 | 3 | import com.oven.entity.User; 4 | import org.apache.ibatis.annotations.Mapper; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface MySqlMapper { 10 | 11 | List getUser(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-multiDatasource-mybatis/src/main/java/com/oven/mapper/oracle/OracleMapper.java: -------------------------------------------------------------------------------- 1 | package com.oven.mapper.oracle; 2 | 3 | import com.oven.entity.User; 4 | import org.apache.ibatis.annotations.Mapper; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface OracleMapper { 10 | 11 | List getUser(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-multiDatasource-mybatis/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.entity.User; 4 | import com.oven.mapper.mysql.MySqlMapper; 5 | import com.oven.mapper.oracle.OracleMapper; 6 | import org.springframework.stereotype.Service; 7 | 8 | import javax.annotation.Resource; 9 | import java.util.List; 10 | 11 | @Service 12 | public class UserService { 13 | 14 | @Resource 15 | private MySqlMapper mySqlMapper; 16 | @Resource 17 | private OracleMapper oracleMapper; 18 | 19 | public List getMysql() { 20 | return mySqlMapper.getUser(); 21 | } 22 | 23 | public List getOracle() { 24 | return oracleMapper.getUser(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /springboot-multiDatasource-mybatis/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | druid: 4 | mysql: 5 | type: com.alibaba.druid.pool.DruidDataSource 6 | driver-class-name: com.mysql.jdbc.Driver 7 | url: jdbc:mysql://localhost:3306/db_test 8 | username: root 9 | password: root 10 | oracle: 11 | type: com.alibaba.druid.pool.DruidDataSource 12 | driver-class-name: com.mysql.jdbc.Driver 13 | url: jdbc:mysql://localhost:3306/db_test2 14 | username: root 15 | password: root -------------------------------------------------------------------------------- /springboot-multiDatasource-mybatis/src/main/resources/mapper/mysql/MySqlMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /springboot-multiDatasource-mybatis/src/main/resources/mapper/oracle/OracleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /springboot-mybatis-annotation/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mybatis-annotation/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private Integer id; 9 | private String uname; 10 | private String pwd; 11 | private Integer age; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mybatis-annotation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/db_test?useUnicode=true&characterEncoding=utf-8 2 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 3 | spring.datasource.username=root 4 | spring.datasource.password=root 5 | pagehelper.helper-dialect=mysql 6 | pagehelper.reasonable=true 7 | pagehelper.support-methods-arguments=true -------------------------------------------------------------------------------- /springboot-mybatis-plus/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-mybatis-plus/src/main/java/com/oven/user/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.oven.user.controller; 2 | 3 | import com.oven.user.service.IUserService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class UserController { 11 | 12 | @Resource 13 | private IUserService userService; 14 | 15 | @RequestMapping("/test") 16 | public void test() { 17 | userService.test(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /springboot-mybatis-plus/src/main/java/com/oven/user/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.user.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @Builder 12 | @ToString 13 | @TableName("t_user") 14 | public class User { 15 | 16 | @TableId(value = "dbid", type = IdType.AUTO) 17 | private Integer id; 18 | private String uname; 19 | private String pwd; 20 | private Integer age; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-mybatis-plus/src/main/java/com/oven/user/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.oven.user.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.oven.user.entity.User; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface UserMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /springboot-mybatis-plus/src/main/java/com/oven/user/service/IUserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.user.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.oven.user.entity.User; 5 | 6 | public interface IUserService extends IService { 7 | 8 | void test(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /springboot-mybatis-plus/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.jdbc.Driver 4 | url: jdbc:mysql://localhost:3306/db_test?useUnicode=true&characterEncoding=utf-8 5 | username: root 6 | password: root 7 | mybatis-plus: 8 | mapper-locations: classpath*:/mapper/**/*.xml -------------------------------------------------------------------------------- /springboot-mybatis-plus/src/main/resources/mapper/user/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /springboot-mybatis-xml/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-mybatis-xml/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private Integer id; 9 | private String uname; 10 | private String pwd; 11 | private Integer age; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mybatis-xml/src/main/java/com/oven/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.oven.mapper; 2 | 3 | import com.oven.entity.User; 4 | import org.apache.ibatis.annotations.Mapper; 5 | 6 | @Mapper 7 | public interface UserMapper { 8 | 9 | void add(User user); 10 | 11 | void delete(Integer id); 12 | 13 | void update(User user); 14 | 15 | User getById(Integer id); 16 | 17 | User getByUname(String uname); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /springboot-mybatis-xml/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/db_test?useUnicode=true&characterEncoding=utf-8 2 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 3 | spring.datasource.username=root 4 | spring.datasource.password=root 5 | mybatis.type-aliases-package=com.oven.mapper 6 | mybatis.mapper-locations=classpath:mapper/*.xml -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-client/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | springboot-netty 7 | com.oven 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | springboot-netty-client 13 | 14 | 15 | -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-client/src/main/java/com/oven/netty/exception/ErrorParamsException.java: -------------------------------------------------------------------------------- 1 | package com.oven.netty.exception; 2 | 3 | /** 4 | * 参数错误异常 5 | */ 6 | public class ErrorParamsException extends RuntimeException { 7 | 8 | private static final long serialVersionUID = -623198335011996153L; 9 | 10 | public ErrorParamsException() { 11 | super(); 12 | } 13 | 14 | public ErrorParamsException(String message) { 15 | super(message); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-client/src/main/java/com/oven/netty/exception/NoUseableChannel.java: -------------------------------------------------------------------------------- 1 | package com.oven.netty.exception; 2 | 3 | /** 4 | * 没有可用的通道异常 5 | */ 6 | public class NoUseableChannel extends RuntimeException{ 7 | 8 | private static final long serialVersionUID = 7762465537123947683L; 9 | 10 | public NoUseableChannel() { 11 | super(); 12 | } 13 | 14 | public NoUseableChannel(String message) { 15 | super(message); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-client/src/main/java/com/oven/netty/study/StudyClientApplication.java: -------------------------------------------------------------------------------- 1 | package com.oven.netty.study; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | public class StudyClientApplication implements CommandLineRunner { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(StudyClientApplication.class, args); 12 | } 13 | 14 | @Override 15 | public void run(String... args) { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-client/src/main/java/com/oven/netty/study/websocket/WebSocketConstant.java: -------------------------------------------------------------------------------- 1 | package com.oven.netty.study.websocket; 2 | 3 | /** 4 | * WebSocket常量 5 | */ 6 | public interface WebSocketConstant { 7 | 8 | /** 9 | * 点对点 10 | */ 11 | String SEND_TO_USER = "send_to_user"; 12 | 13 | /** 14 | * 群发 广播 15 | */ 16 | String SEND_TO_USERS = "send_to_users"; 17 | 18 | /** 19 | * 请求成功 20 | */ 21 | String REQUEST_SUCCESS = "request_success"; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-client/src/main/java/com/oven/netty/study/websocket/WebSocketMessage.java: -------------------------------------------------------------------------------- 1 | package com.oven.netty.study.websocket; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * WebSocketMessage 9 | */ 10 | @Data 11 | public class WebSocketMessage implements Serializable { 12 | 13 | private static final long serialVersionUID = -4666429837358506065L; 14 | 15 | private String accept; 16 | private String content; 17 | private Type header; 18 | 19 | enum Type { 20 | send_user, send_users, request_success; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | springboot-netty 7 | com.oven 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | springboot-netty-server 13 | 14 | -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-server/src/main/java/com/oven/netty/exception/ErrorParamsException.java: -------------------------------------------------------------------------------- 1 | package com.oven.netty.exception; 2 | 3 | /** 4 | * 参数错误异常 5 | */ 6 | public class ErrorParamsException extends RuntimeException { 7 | 8 | private static final long serialVersionUID = -623198335011996153L; 9 | 10 | public ErrorParamsException() { 11 | super(); 12 | } 13 | 14 | public ErrorParamsException(String message) { 15 | super(message); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-server/src/main/java/com/oven/netty/exception/NoUseableChannel.java: -------------------------------------------------------------------------------- 1 | package com.oven.netty.exception; 2 | 3 | /** 4 | * 没有可用的通道异常 5 | */ 6 | public class NoUseableChannel extends RuntimeException { 7 | 8 | private static final long serialVersionUID = 7762465537123947683L; 9 | 10 | public NoUseableChannel() { 11 | super(); 12 | } 13 | 14 | public NoUseableChannel(String message) { 15 | super(message); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-server/src/main/java/com/oven/netty/study/StudyServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.oven.netty.study; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | public class StudyServerApplication implements CommandLineRunner { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(StudyServerApplication.class, args); 12 | } 13 | 14 | @Override 15 | public void run(String... args) { 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-server/src/main/java/com/oven/netty/study/websocket/WebSocketConstant.java: -------------------------------------------------------------------------------- 1 | package com.oven.netty.study.websocket; 2 | 3 | /** 4 | * WebSocket常量 5 | */ 6 | public interface WebSocketConstant { 7 | 8 | /** 9 | * 点对点 10 | */ 11 | String SEND_TO_USER = "send_to_user"; 12 | 13 | /** 14 | * 群发 广播 15 | */ 16 | String SEND_TO_USERS = "send_to_users"; 17 | 18 | /** 19 | * 请求成功 20 | */ 21 | String REQUEST_SUCCESS = "request_success"; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /springboot-netty/springboot-netty-server/src/main/java/com/oven/netty/study/websocket/WebSocketMessage.java: -------------------------------------------------------------------------------- 1 | package com.oven.netty.study.websocket; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * WebSocketMessage 9 | */ 10 | @Data 11 | public class WebSocketMessage implements Serializable { 12 | 13 | private static final long serialVersionUID = -4666429837358506065L; 14 | 15 | private String accept; 16 | private String content; 17 | private Type header; 18 | 19 | enum Type { 20 | send_user, send_users, request_success; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /springboot-nginx-loadBalanced/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-nginx-loadBalanced/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class DemoController { 9 | 10 | @Value("${server.port}") 11 | private String port; 12 | 13 | @RequestMapping("/test") 14 | public String test() { 15 | return "hello " + port; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-nginx-loadBalanced/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 -------------------------------------------------------------------------------- /springboot-oauth2/readme.md: -------------------------------------------------------------------------------- 1 | #### 1. 获取token 2 | ``` 3 | http://localhost:8080/oauth/token?username=admin&password=123456&client_id=dev&client_secret=password&grant_type=password 4 | ``` 5 | #### 2. 刷新token 6 | ``` 7 | http://localhost:8080/oauth/token?refresh_token=869dd3de-caf4-4e0b-a0e2-4ce13e91c4bd&client_id=dev&client_secret=dev&grant_type=refresh_token 8 | ``` 9 | 10 | #### 3. 获取资源 11 | ``` 12 | http://localhost:8080/hi?name=Oven&access_token=57794a40-86ac-4be1-9076-0da769ebae11 13 | ``` -------------------------------------------------------------------------------- /springboot-oauth2/src/main/java/com/oven/app/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.app; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | /** 8 | * 启动类 9 | * 10 | * @author Oven 11 | */ 12 | @MapperScan(basePackages = "com.oven.mapper") 13 | @SpringBootApplication(scanBasePackages = "com.oven") 14 | public class Application { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(Application.class, args); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /springboot-oauth2/src/main/java/com/oven/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloController { 8 | 9 | @GetMapping("/hi") 10 | public String hi(String name) { 11 | return "hi , " + name; 12 | } 13 | 14 | @GetMapping("/hello") 15 | public String hello(String name) { 16 | return "hello , " + name; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /springboot-oauth2/src/main/java/com/oven/controller/MainController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | @Controller 8 | public class MainController { 9 | 10 | @RequestMapping("/login") 11 | public String login() { 12 | return "login"; 13 | } 14 | 15 | @RequestMapping("/login-error") 16 | public String loginError(Model model) { 17 | model.addAttribute("loginError", true); 18 | return "login"; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-oauth2/src/main/java/com/oven/entity/Role.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | import org.springframework.security.core.GrantedAuthority; 5 | 6 | @Data 7 | public class Role implements GrantedAuthority { 8 | 9 | private Long id; 10 | private String name; 11 | 12 | @Override 13 | public String getAuthority() { 14 | return name; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /springboot-oauth2/src/main/java/com/oven/entity/RolePermisson.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class RolePermisson { 7 | 8 | private String url; 9 | private String roleName; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot-oauth2/src/main/java/com/oven/mapper/PermissionMapper.java: -------------------------------------------------------------------------------- 1 | package com.oven.mapper; 2 | 3 | import com.oven.entity.RolePermisson; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Select; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface PermissionMapper { 11 | 12 | @Select("select r.name as rolename, p.url from role r left join role_permission rp on r.id = rp.role_id left join permission p on rp.permission_id = p.id") 13 | List getRolePermissions(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-oauth2/src/main/java/com/oven/mapper/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.oven.mapper; 2 | 3 | import com.oven.entity.Role; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.apache.ibatis.annotations.Select; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface RoleMapper { 12 | 13 | @Select("select r.id, r.name from role r left join user_role ur on r.id = ur.role_id where ur.user_id = ${userId}") 14 | List getRolesByUserId(@Param("userId") Long userId); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-oauth2/src/main/java/com/oven/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.oven.mapper; 2 | 3 | import com.oven.entity.User; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.apache.ibatis.annotations.Select; 7 | 8 | @Mapper 9 | public interface UserMapper { 10 | 11 | @Select("select id, username, password from user where username = #{username}") 12 | User loadUserByUsername(@Param("username") String username); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-oauth2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/db_test?characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver -------------------------------------------------------------------------------- /springboot-oauth2/src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 登录 6 | 7 | 8 |

Login page

9 |

用户名或密码错误

10 |
11 | : 12 | 13 |
14 | : 15 | 16 |
17 | 18 |
19 | 20 | -------------------------------------------------------------------------------- /springboot-okhttp/src/main/java/com/oven/okhttp/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.okhttp; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-okhttp/src/main/java/com/oven/okhttp/entity/Student.java: -------------------------------------------------------------------------------- 1 | package com.oven.okhttp.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Student { 7 | 8 | private Integer id; 9 | private String name; 10 | private Integer age; 11 | private String phone; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-okhttp/src/main/java/com/oven/okhttp/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.oven.okhttp.service; 2 | 3 | import com.oven.okhttp.entity.Student; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class StudentService { 8 | 9 | public Student get(Integer id, Student student) { 10 | student.setId(id); 11 | return student; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-okhttp/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | remote: 2 | baseUrl: 3 | host: http://localhost:8080/ 4 | api: 5 | getStudent: student/get -------------------------------------------------------------------------------- /springboot-prometheus/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=springboot-prometheus 2 | management.endpoints.web.exposure.include=* 3 | management.metrics.tags.application=${spring.application.name} -------------------------------------------------------------------------------- /springboot-property/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private int id; 9 | private String name; 10 | private int age; 11 | private double score; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-property/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | driver=com.mysql.jdbc.Driver 2 | url=jdbc:mysql://127.0.0.1:3306/db_test 3 | username=root 4 | password=root -------------------------------------------------------------------------------- /springboot-quartz-web/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-quartz-web/src/main/java/com/oven/quartz/job/MyJob1.java: -------------------------------------------------------------------------------- 1 | package com.oven.quartz.job; 2 | 3 | import org.joda.time.DateTime; 4 | import org.quartz.JobExecutionContext; 5 | import org.springframework.scheduling.quartz.QuartzJobBean; 6 | 7 | public class MyJob1 extends QuartzJobBean { 8 | 9 | @Override 10 | protected void executeInternal(JobExecutionContext context) { 11 | System.out.println("任务111开始执行。。。" + new DateTime().toString("HH:mm:ss")); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-quartz-web/src/main/java/com/oven/quartz/job/MyJob2.java: -------------------------------------------------------------------------------- 1 | package com.oven.quartz.job; 2 | 3 | import org.joda.time.DateTime; 4 | import org.quartz.JobExecutionContext; 5 | import org.springframework.scheduling.quartz.QuartzJobBean; 6 | 7 | public class MyJob2 extends QuartzJobBean { 8 | 9 | @Override 10 | protected void executeInternal(JobExecutionContext context) { 11 | System.out.println("任务222开始执行。。。" + new DateTime().toString("HH:mm:ss")); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-quartz/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-quartz/src/main/java/com/oven/quartz/job/MyJob.java: -------------------------------------------------------------------------------- 1 | package com.oven.quartz.job; 2 | 3 | import org.joda.time.DateTime; 4 | import org.quartz.JobExecutionContext; 5 | import org.springframework.scheduling.quartz.QuartzJobBean; 6 | 7 | public class MyJob extends QuartzJobBean { 8 | 9 | @Override 10 | protected void executeInternal(JobExecutionContext context) { 11 | System.out.println("任务开始执行。。。" + new DateTime().toString("HH:mm:ss")); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-rabbitmq/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-rabbitmq/src/main/java/com/oven/consumer/RabbitMQConsumer.java: -------------------------------------------------------------------------------- 1 | package com.oven.consumer; 2 | 3 | import org.springframework.amqp.rabbit.annotation.RabbitHandler; 4 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | @RabbitListener(queues = "springboot-rabbitmq") 9 | public class RabbitMQConsumer { 10 | 11 | @RabbitHandler 12 | public void consumer(String message) { 13 | System.out.printf("消费者接受到消息:%s", message); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-rabbitmq/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import com.oven.producer.RabbitMQProducer; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class DemoController { 11 | 12 | @Resource 13 | private RabbitMQProducer producer; 14 | 15 | @RequestMapping("/send") 16 | public String send(String msg) { 17 | producer.send("springboot-rabbitmq", msg); 18 | return "发送成功"; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-rabbitmq/src/main/java/com/oven/producer/RabbitMQProducer.java: -------------------------------------------------------------------------------- 1 | package com.oven.producer; 2 | 3 | import org.springframework.amqp.core.AmqpTemplate; 4 | import org.springframework.stereotype.Component; 5 | 6 | import javax.annotation.Resource; 7 | 8 | @Component 9 | public class RabbitMQProducer { 10 | 11 | @Resource 12 | private AmqpTemplate amqpTemplate; 13 | 14 | public void send(String queue, String message) { 15 | amqpTemplate.convertAndSend(queue, message); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-rabbitmq/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | rabbitmq: 3 | host: 192.168.63.2 4 | port: 5672 5 | username: admin 6 | password: 123456 7 | -------------------------------------------------------------------------------- /springboot-redis/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-redis/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private int id; 9 | private String name; 10 | private int age; 11 | private double score; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-redis/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | redis: 3 | host: localhost 4 | port: 6379 5 | password: 5217 -------------------------------------------------------------------------------- /springboot-redisson/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot-redisson/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | redis: 3 | host: 127.0.0.1 4 | port: 6379 5 | password: 5217 6 | lettuce: 7 | pool: 8 | max-active: 8 9 | max-wait: -1 10 | min-idle: 0 -------------------------------------------------------------------------------- /springboot-restTemplate/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-restTemplate/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 -------------------------------------------------------------------------------- /springboot-restdoc/src/main/java/com/oven/Applaction.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Applaction { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Applaction.class, args); 11 | } 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /springboot-restdoc/src/main/java/com/oven/entity/ResultInfo.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResultInfo { 9 | 10 | private int code; 11 | private String message; 12 | private T data; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-restdoc/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class User { 9 | 10 | private Integer id; 11 | private String uname; 12 | private String pwd; 13 | private Integer age; 14 | 15 | } -------------------------------------------------------------------------------- /springboot-rocketmq/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-rocketmq/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | rocketmq.namesrvAddr=192.168.63.2:9876 2 | rocketmq.producer.groupName=producer 3 | rocketmq.consumer.groupName=consumer -------------------------------------------------------------------------------- /springboot-schedule/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableScheduling; 6 | 7 | @EnableScheduling 8 | @SpringBootApplication 9 | public class Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-schedule/src/main/java/com/oven/task/ScheduleTask.java: -------------------------------------------------------------------------------- 1 | package com.oven.task; 2 | 3 | import org.joda.time.DateTime; 4 | import org.springframework.scheduling.annotation.Scheduled; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class ScheduleTask { 9 | 10 | /** 11 | * (fixedRate = 2000) 上一次开始执行时间点之后2秒再执行 12 | * (fixedDelay = 2000) 上一次执行完毕时间点之后2秒再执行 13 | * (initialDelay = 1000, fixedRate = 2000) 第一次延迟1秒后执行,之后按fixedRate的规则每2秒执行一次 14 | * (cron="/10 * * * * ?") cron表达式 15 | */ 16 | @Scheduled(fixedRate = 2000) 17 | public void task() { 18 | System.out.println("do somthing..." + new DateTime().toString("HH:mm:ss")); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-sentinel/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-sentinel/src/main/java/com/oven/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class TestController { 8 | 9 | @RequestMapping("/test") 10 | public String test(String name) { 11 | return "hello " + name; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-sentinel/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8888 2 | spring.application.name=springboot-sentinel 3 | spring.cloud.sentinel.transport.dashboard=localhost:8080 -------------------------------------------------------------------------------- /springboot-session/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-session/src/main/java/com/oven/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | import javax.servlet.http.HttpSession; 7 | 8 | @RestController 9 | public class DemoController { 10 | 11 | @RequestMapping("/set") 12 | public String set(HttpSession session) { 13 | session.setAttribute("name", "Oven"); 14 | return "设置成功"; 15 | } 16 | 17 | @RequestMapping("/get") 18 | public String get(HttpSession session) { 19 | return (String) session.getAttribute("name"); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-session/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | redis: 3 | password: 5217 -------------------------------------------------------------------------------- /springboot-shiro/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-shiro/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class User { 9 | 10 | private Integer id; 11 | private String userName; 12 | private String password; 13 | private Integer age; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-shiro/src/main/java/com/oven/service/RoleMenuService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | @Service 9 | public class RoleMenuService { 10 | 11 | public List findByUserId(Integer id) { 12 | System.out.println("此处省略查询数据库过程" + id); 13 | List result = new ArrayList<>(); 14 | result.add("user:list"); 15 | result.add("user:add"); 16 | result.add("user:update"); 17 | return result; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /springboot-shiro/src/main/java/com/oven/service/RoleService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | @Service 9 | public class RoleService { 10 | 11 | public List findByUserId(Integer id) { 12 | System.out.println("此处省略查询数据库过程" + id); 13 | List result = new ArrayList<>(); 14 | result.add("超级管理员"); 15 | result.add("普通用户"); 16 | return result; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /springboot-shiro/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.entity.User; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class UserService { 8 | 9 | public User findByUserName(String userName) { 10 | return new User(1, userName, "123456", 18); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-shiro/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | index 6 | 7 | 8 |

index

9 |
    10 |
  • user:list
  • 11 |
  • user:add
  • 12 |
  • user:update
  • 13 |
  • user:delete
  • 14 |
15 | 16 | -------------------------------------------------------------------------------- /springboot-shiro/src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | login 6 | 7 | 8 |
9 | 10 | 11 | 12 |
13 | 14 | -------------------------------------------------------------------------------- /springboot-shiro/src/main/resources/templates/noauth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | noauth 6 | 7 | 8 |

noauth

9 | 10 | -------------------------------------------------------------------------------- /springboot-sqlite/src/main/java/com/oven/sqlite/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.sqlite; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /springboot-sqlite/src/main/java/com/oven/sqlite/entity/Student.java: -------------------------------------------------------------------------------- 1 | package com.oven.sqlite.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Student { 7 | 8 | private Integer id; 9 | 10 | private String name; 11 | 12 | private Integer age; 13 | 14 | private Integer gender; 15 | 16 | private String phone; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-sqlite/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | # url: jdbc:sqlite:/Users/oven/Downloads/sqlite/test.db 4 | url: jdbc:sqlite::resource:db/test.db 5 | driver-class-name: org.sqlite.JDBC 6 | type: org.sqlite.SQLiteDataSource 7 | schema: classpath:db/schema.sql 8 | data: classpath:db/data.sql 9 | initialization-mode: always 10 | continue-on-error: true -------------------------------------------------------------------------------- /springboot-sqlite/src/main/resources/db/data.sql: -------------------------------------------------------------------------------- 1 | insert into t_student values ('张三', 18, 1, '15700000001'); -------------------------------------------------------------------------------- /springboot-sqlite/src/main/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | drop table if exists t_student; 2 | 3 | create table t_student 4 | ( 5 | dbid integer primary key autoincrement not null, 6 | name varchar(32) not null, 7 | age integer null, 8 | gender integer null, 9 | phone varchar(32) not null 10 | ); 11 | -------------------------------------------------------------------------------- /springboot-sqlite/src/main/resources/db/test.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/503612012/springboot-chowder/f929ecf95f73dad375364ef8a3fa668550317b5e/springboot-sqlite/src/main/resources/db/test.db -------------------------------------------------------------------------------- /springboot-sse/src/main/java/com/oven/sse/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.sse; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-swagger2/src/main/java/com/oven/Appllication.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Appllication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Appllication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-swagger2/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | @Data 8 | @ApiModel(value = "用户实体类", description = "用户实体类信息") 9 | public class User { 10 | 11 | @ApiModelProperty(value = "用户主键", dataType = "int", example = "1") 12 | private Integer id; 13 | @ApiModelProperty(value = "用户名", dataType = "string", example = "admin") 14 | private String uname; 15 | @ApiModelProperty(value = "用户密码", dataType = "string", example = "123456") 16 | private String pwd; 17 | @ApiModelProperty(value = "用户年龄", dataType = "int", example = "18") 18 | private Integer age; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /springboot-task/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableScheduling; 6 | 7 | @EnableScheduling 8 | @SpringBootApplication 9 | public class Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-task/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/db_test 2 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 3 | spring.datasource.username=root 4 | spring.datasource.password=root -------------------------------------------------------------------------------- /springboot-thymeleaf/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-thymeleaf/src/main/java/com/oven/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | @Controller 8 | public class DemoController { 9 | 10 | @RequestMapping("/test") 11 | public String test(Model model) { 12 | model.addAttribute("msg", "Oven"); 13 | return "index"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-thymeleaf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false -------------------------------------------------------------------------------- /springboot-thymeleaf/src/main/resources/static/css/index.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | border: 1px solid red; 3 | } -------------------------------------------------------------------------------- /springboot-thymeleaf/src/main/resources/static/js/index.js: -------------------------------------------------------------------------------- 1 | alert("Oven"); -------------------------------------------------------------------------------- /springboot-thymeleaf/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 |

11 | 12 | -------------------------------------------------------------------------------- /springboot-webclient/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.oven 8 | springboot-chowder 9 | 1.0.0 10 | 11 | 12 | springboot-webclient 13 | pom 14 | 15 | 16 | springboot-webclient-server 17 | springboot-webclient-client 18 | 19 | 20 | -------------------------------------------------------------------------------- /springboot-webclient/springboot-webclient-client/src/main/java/com/oven/webclient/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.webclient; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-webclient/springboot-webclient-client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 -------------------------------------------------------------------------------- /springboot-webclient/springboot-webclient-server/src/main/java/com/oven/webclient/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven.webclient; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-webclient/springboot-webclient-server/src/main/java/com/oven/webclient/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.oven.webclient.controller; 2 | 3 | import com.oven.webclient.service.TestService; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @Resource 13 | private TestService testService; 14 | 15 | @RequestMapping("/test") 16 | public Object test() { 17 | return testService.test(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /springboot-webclient/springboot-webclient-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 -------------------------------------------------------------------------------- /springboot-webflux/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-webflux/src/main/java/com/oven/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | package com.oven.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | import reactor.core.publisher.Mono; 6 | 7 | @RestController 8 | public class HelloController { 9 | 10 | @GetMapping("/hello") 11 | public Mono hello() { 12 | return Mono.just("Welcome to reactive world ~"); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /springboot-webservice/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | springboot-chowder 7 | com.oven 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | springboot-webservice 13 | pom 14 | 15 | springboot-webservice-server 16 | springboot-webservice-client 17 | 18 | 19 | -------------------------------------------------------------------------------- /springboot-webservice/springboot-webservice-client/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-webservice/springboot-webservice-client/src/main/java/com/oven/wsdl/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.xml.bind.annotation.XmlSchema(namespace = "wsdl.oven.com") 2 | package com.oven.wsdl; 3 | -------------------------------------------------------------------------------- /springboot-webservice/springboot-webservice-client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 -------------------------------------------------------------------------------- /springboot-webservice/springboot-webservice-server/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-webservice/springboot-webservice-server/src/main/java/com/oven/entity/Gender.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | public enum Gender { 4 | 5 | MALE("男"), 6 | FEMALE("女"); 7 | 8 | String value; 9 | 10 | Gender(String value) { 11 | this.value = value; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-webservice/springboot-webservice-server/src/main/java/com/oven/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.Builder; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @Builder 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | public class User { 15 | 16 | private String name; 17 | private Gender gender; 18 | private int age; 19 | private List hobby; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-webservice/springboot-webservice-server/src/main/java/com/oven/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.oven.service; 2 | 3 | import com.oven.entity.User; 4 | 5 | import javax.jws.WebMethod; 6 | import javax.jws.WebParam; 7 | import javax.jws.WebService; 8 | import java.util.List; 9 | 10 | @WebService(targetNamespace = "wsdl.oven.com", name = "userPortType") 11 | public interface UserService { 12 | 13 | @WebMethod(operationName = "getUserByName") 14 | User getUserByName(@WebParam(name = "name") String name); 15 | 16 | @WebMethod 17 | List getList(); 18 | 19 | @WebMethod 20 | String getString(@WebParam(name = "msg") String msg); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-websocket/src/main/java/com/oven/Application.java: -------------------------------------------------------------------------------- 1 | package com.oven; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-websocket/src/main/java/com/oven/entity/Greeting.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | public class Greeting { 4 | 5 | private String content; 6 | 7 | public Greeting() { 8 | } 9 | 10 | public Greeting(String content) { 11 | this.content = content; 12 | } 13 | 14 | public String getContent() { 15 | return content; 16 | } 17 | 18 | public void setContent(String content) { 19 | this.content = content; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-websocket/src/main/java/com/oven/entity/Message.java: -------------------------------------------------------------------------------- 1 | package com.oven.entity; 2 | 3 | public class Message { 4 | 5 | private int id; 6 | private String content; 7 | 8 | public int getId() { 9 | return id; 10 | } 11 | 12 | public void setId(int id) { 13 | this.id = id; 14 | } 15 | 16 | public String getContent() { 17 | return content; 18 | } 19 | 20 | public void setContent(String content) { 21 | this.content = content; 22 | } 23 | 24 | @Override 25 | public String toString() { 26 | return "Message{" + 27 | "id=" + id + 28 | ", content='" + content + '\'' + 29 | '}'; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /springboot-websocket/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | servlet: 4 | context-path: / -------------------------------------------------------------------------------- /springboot-websocket/src/main/resources/static/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #f5f5f5; 3 | } 4 | 5 | #main-content { 6 | max-width: 940px; 7 | padding: 2em 3em; 8 | margin: 0 auto 20px; 9 | background-color: #fff; 10 | border: 1px solid #e5e5e5; 11 | -webkit-border-radius: 5px; 12 | -moz-border-radius: 5px; 13 | border-radius: 5px; 14 | } --------------------------------------------------------------------------------