├── _git_pull.cmd ├── spring-boot-18-MQ ├── .gitignore ├── spring-boot-18-MQ-kafka │ ├── .gitignore │ ├── README.md │ └── src │ │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── logback.xml │ │ └── java │ │ └── cn │ │ └── timebusker │ │ ├── mq │ │ ├── KafkaConsumerService.java │ │ └── KafkaProducerService.java │ │ ├── web │ │ └── indexController.java │ │ ├── task │ │ └── KafkaTaskService.java │ │ └── App.java ├── spring-boot-18-MQ-activemq │ ├── .gitignore │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── cn │ │ │ └── timebusker │ │ │ ├── mq │ │ │ ├── queue │ │ │ │ ├── ActiveMQQueueConsumerBackup.java │ │ │ │ ├── ActiveMQQueueConsumerMaster.java │ │ │ │ └── ActiveMQQueueProducer.java │ │ │ └── topic │ │ │ │ ├── ActiveMQTopicConsumerBackup.java │ │ │ │ ├── ActiveMQTopicConsumerMaster.java │ │ │ │ └── ActiveMQTopicProducer.java │ │ │ ├── web │ │ │ └── indexController.java │ │ │ ├── App.java │ │ │ └── ActiveMQConfiguration.java │ └── pom.xml ├── spring-boot-18-MQ-rabbitmq │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── logback.xml │ │ │ └── application-dev.properties │ │ │ └── java │ │ │ └── cn │ │ │ └── timebusker │ │ │ ├── App.java │ │ │ ├── web │ │ │ └── indexController.java │ │ │ ├── mq │ │ │ ├── topic │ │ │ │ └── TopicRabbitMQConsumer.java │ │ │ ├── fanout │ │ │ │ └── FanoutRabbitMQConsumer.java │ │ │ ├── sample │ │ │ │ ├── MessageConsumer.java │ │ │ │ └── MessageProducer.java │ │ │ └── direct │ │ │ │ └── DirectRabbitMQConsumer.java │ │ │ └── model │ │ │ └── MessageEntity.java │ └── pom.xml └── spring-boot-18-MQ-rocketmq │ ├── .gitignore │ ├── src │ └── main │ │ ├── java │ │ └── cn │ │ │ └── timebusker │ │ │ ├── App.java │ │ │ └── web │ │ │ └── indexController.java │ │ └── resources │ │ ├── application.properties │ │ └── logback.xml │ ├── README.md │ └── pom.xml ├── spring-boot-8-AOP ├── .gitignore └── src │ └── main │ ├── java │ └── cn │ │ └── timebusker │ │ ├── service │ │ ├── user │ │ │ ├── UserInfoService.java │ │ │ └── Impl │ │ │ │ └── UserInfoServiceImpl.java │ │ ├── order │ │ │ ├── OrderInfoService.java │ │ │ └── Impl │ │ │ │ └── OrderInfoServiceImpl.java │ │ └── CommonService.java │ │ ├── utils │ │ ├── CommonUtil.java │ │ └── DateUtil.java │ │ ├── annotation │ │ ├── timebuskerMethod.java │ │ └── timebuskerBean.java │ │ └── aop │ │ └── ServiceHandlerAop.java │ └── resources │ ├── logback.xml │ ├── application.properties │ └── application-dev.properties ├── static ├── 10 │ └── spring-data-jpa.png ├── 12 │ ├── 1.png │ └── 2.png ├── 15 │ └── redis.zip ├── 18 │ ├── MQ对比.jpg │ └── rabbitmq │ │ ├── direct.png │ │ ├── fanout.png │ │ └── topic.png ├── logo.png ├── 111111.png ├── spring-boot.png ├── spring-boot-8-AOP │ ├── aop.png │ ├── advice.png │ └── aop-mine.png ├── spring-boot-3-logs │ ├── SLF4J.png │ ├── logging.png │ ├── spring-boot-3-logs-Log4j │ │ ├── Log4j.png │ │ ├── log4j-mine.png │ │ └── log4j-root.png │ ├── spring-boot-3-logs-Log4j2 │ │ └── Log4j2.png │ └── spring-boot-3-logs-Logback │ │ ├── Logback.png │ │ └── logback_cn.pdf ├── spring-boot-2-RESTful │ ├── get.png │ ├── head.png │ ├── post.png │ ├── put.png │ ├── delete.png │ ├── get-all.png │ ├── get-one.png │ ├── add-post.png │ ├── delete-one.png │ ├── insert-post.png │ ├── restful-api.png │ └── update-put.png ├── spring-boot-7-EhCache │ └── ehcache.jpg ├── spring-boot-1-QuickStart │ └── app-main.png ├── spring-boot-5-Async │ └── async-test-res.png ├── spring-boot-13-MyBatis │ └── mybatis-logo.png ├── spring-boot-6-GlobalException │ └── error.png ├── spring-boot-4-Scheduled │ ├── spring-core-tast.png │ └── spring-core-tast-res.png └── spring-boot-17-monitor │ └── spring-boot-17-monitor-actuator │ └── spring-boot-actuator.png ├── spring-boot-13-MyBatis ├── .gitignore └── src │ └── main │ ├── resources │ ├── logback.xml │ └── application.properties │ └── java │ └── cn │ └── timebusker │ └── common │ └── DatasourceConfiguration.java ├── spring-boot-15-Redis ├── .gitignore ├── spring-boot-15-Redis-cache │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── cn │ │ │ │ └── timebusker │ │ │ │ ├── App.java │ │ │ │ └── service │ │ │ │ └── UserService.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ └── pom.xml ├── spring-boot-15-Redis-mq │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── cn │ │ │ │ └── timebusker │ │ │ │ ├── App.java │ │ │ │ └── web │ │ │ │ └── indexController.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ └── pom.xml └── spring-boot-15-Redis-sample │ ├── .gitignore │ ├── src │ └── main │ │ ├── java │ │ └── cn │ │ │ └── timebusker │ │ │ └── App.java │ │ └── resources │ │ ├── application.properties │ │ ├── logback.xml │ │ └── application-dev.properties │ └── pom.xml ├── spring-boot-17-monitor ├── .gitignore ├── spring-boot-17-monitor-AdminClient │ ├── .gitignore │ └── src │ │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── application-dev.properties │ │ └── java │ │ └── cn │ │ └── timebusker │ │ ├── util │ │ └── LoggingUtil.java │ │ ├── actuator │ │ └── MineHealthIndicators.java │ │ └── web │ │ └── LogsController.java ├── spring-boot-17-monitor-AdminServer │ ├── .gitignore │ ├── src │ │ └── main │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── application-dev.properties │ └── README.md ├── spring-boot-17-monitor-actuator │ ├── .gitignore │ └── src │ │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── application-dev.properties │ │ └── java │ │ └── cn │ │ └── timebusker │ │ ├── util │ │ └── LoggingUtil.java │ │ ├── actuator │ │ └── MineHealthIndicators.java │ │ ├── web │ │ └── LogsController.java │ │ └── metrics │ │ └── MineMetrics.java └── pom.xml ├── spring-boot-2-RESTful ├── .gitignore └── src │ └── main │ ├── resources │ ├── application-prod.properties │ ├── application-test.properties │ ├── application-dev.properties │ └── application.properties │ └── java │ └── cn │ └── timebusker │ ├── conf │ └── WebConfig.java │ ├── service │ ├── DemoInfoService.java │ └── Impl │ │ └── DemoInfoServiceImpl.java │ └── entity │ └── DemoInfo.java ├── spring-boot-3-logs ├── .gitignore ├── spring-boot-3-logs-Log4j │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── application-prod.properties │ │ │ ├── application-test.properties │ │ │ ├── application-dev.properties │ │ │ └── application.properties │ │ │ └── java │ │ │ └── cn │ │ │ └── timebusker │ │ │ ├── util │ │ │ └── LoggingUtil.java │ │ │ └── web │ │ │ └── LogsController.java │ └── .gitignore ├── spring-boot-3-logs-Log4j2 │ ├── .gitignore │ └── src │ │ └── main │ │ ├── resources │ │ ├── application-dev.properties │ │ ├── application-prod.properties │ │ ├── application-test.properties │ │ ├── log4j2-prod.xml │ │ ├── log4j2-test.xml │ │ └── application.properties │ │ └── java │ │ └── cn │ │ └── timebusker │ │ ├── util │ │ └── LoggingUtil.java │ │ └── web │ │ └── LogsController.java ├── spring-boot-3-logs-Logback │ ├── .gitignore │ └── src │ │ └── main │ │ ├── resources │ │ ├── application-dev.properties │ │ ├── application-prod.properties │ │ ├── application-test.properties │ │ └── application.properties │ │ └── java │ │ └── cn │ │ └── timebusker │ │ ├── util │ │ └── LoggingUtil.java │ │ └── web │ │ └── LogsController.java └── pom.xml ├── spring-boot-5-Async ├── .gitignore └── src │ └── main │ └── resources │ ├── application-dev.properties │ ├── application-prod.properties │ ├── application-test.properties │ └── application.properties ├── spring-boot-7-EhCache ├── .gitignore └── src │ └── main │ ├── resources │ └── application.properties │ └── java │ └── cn │ └── timebusker │ ├── dao │ └── UserRepository.java │ ├── service │ └── UserService.java │ └── entity │ └── User.java ├── spring-boot-1-QuickStart ├── .gitignore ├── src │ └── main │ │ ├── resources │ │ ├── application-prod.properties │ │ ├── application-test.properties │ │ ├── dubbo.properties │ │ └── application-dev.properties │ │ └── java │ │ └── cn │ │ └── timebusker │ │ └── web │ │ ├── ConfController.java │ │ └── HelloController.java └── README.md ├── spring-boot-10-SpringData ├── .gitignore └── src │ ├── test │ └── java │ │ └── cn │ │ └── timebusker │ │ └── test │ │ ├── One2manyTest.java │ │ ├── Many2manyTest.java │ │ └── CommonTest.java │ └── main │ ├── java │ └── cn │ │ └── timebusker │ │ ├── model │ │ ├── many2many │ │ │ ├── Commodity.java │ │ │ └── category.java │ │ ├── one2one │ │ │ └── test.java │ │ └── one2many │ │ │ ├── company.java │ │ │ ├── position.java │ │ │ ├── detailInfo.java │ │ │ └── department.java │ │ ├── repository │ │ ├── one2one │ │ │ ├── AddressRepository.java │ │ │ └── UserRepository.java │ │ ├── one2many │ │ │ ├── positionRepository.java │ │ │ ├── departmentRepository.java │ │ │ ├── detailInfoRepository.java │ │ │ ├── companyRepository.java │ │ │ └── employeeRepository.java │ │ └── BasicRepository.java │ │ ├── App.java │ │ └── web │ │ └── DownloadData.java │ └── resources │ ├── application.properties │ ├── logback.xml │ └── application-dev.properties ├── spring-boot-12-Swagger2 ├── .gitignore └── src │ └── main │ ├── resources │ ├── application-dev.properties │ ├── logback.xml │ └── application.properties │ └── java │ └── cn │ └── timebusker │ ├── web │ ├── SwaggerController.java │ └── LogsController.java │ └── domain │ └── User.java ├── spring-boot-14-JdbcTemplate ├── .gitignore └── src │ └── main │ ├── resources │ ├── application-dev.properties │ ├── logback.xml │ └── application.properties │ └── java │ └── cn │ └── timebusker │ ├── util │ └── LoggingUtil.java │ └── web │ └── LogsController.java ├── spring-boot-16-Transcation ├── .gitignore └── src │ └── main │ ├── resources │ ├── application-dev.properties │ ├── logback.xml │ └── application.properties │ └── java │ └── cn │ └── timebusker │ ├── util │ └── LoggingUtil.java │ └── web │ └── LogsController.java ├── spring-boot-4-Scheduled ├── .gitignore └── src │ └── main │ ├── resources │ ├── application-dev.properties │ ├── application-prod.properties │ ├── application-test.properties │ └── application.properties │ └── java │ └── cn │ └── timebusker │ ├── quartz │ └── AutoQuartz.java │ └── springTask │ └── SpringTaskSample.java ├── .gitignore ├── spring-boot-11-SpringSecurity ├── .gitignore └── src │ └── main │ ├── java │ └── cn │ │ └── timebusker │ │ ├── security │ │ └── constant │ │ │ └── RoleConstant.java │ │ ├── App.java │ │ ├── service │ │ └── UserService.java │ │ ├── web │ │ ├── UserController.java │ │ └── HomeController.java │ │ └── mapper │ │ └── UserMapper.java │ └── resources │ ├── logback.xml │ └── application.properties ├── spring-boot-6-GlobalException ├── .gitignore └── src │ └── main │ ├── resources │ ├── templates │ │ ├── index.html │ │ └── error.html │ ├── application-dev.properties │ └── application.properties │ └── java │ └── cn │ └── timebusker │ └── exception │ └── ErrorMassage.java ├── spring-boot-9-JavaMailSender ├── .gitignore ├── src │ └── main │ │ └── resources │ │ ├── static │ │ └── img │ │ │ └── logo.png │ │ ├── logback.xml │ │ ├── application.properties │ │ └── application-dev.properties └── README.md ├── spring-boot-19-Definition-Starter ├── .gitignore ├── spring-boot-19-Definition-Starter-Test │ ├── .gitignore │ └── src │ │ └── main │ │ └── resources │ │ ├── logback.xml │ │ └── application.properties └── spring-boot-19-Definition-Starter-Service │ ├── .gitignore │ └── src │ └── main │ ├── resources │ ├── META-INF │ │ └── spring.factories │ ├── application.properties │ └── logback.xml │ └── java │ └── cn │ └── timebusker │ ├── config │ └── CalculateProperties.java │ └── service │ └── CalculateService.java ├── spring-boot-20-Freemarker ├── doc │ ├── 1.png │ ├── Freemarker快速入门.pdf │ ├── freemarker中文手册.pdf │ └── 不错的FreeMarker教程.pdf ├── src │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── templates │ │ │ └── free5.html │ │ └── java │ │ └── com │ │ └── timebusker │ │ ├── App.java │ │ ├── method │ │ └── SortMethod.java │ │ ├── web │ │ ├── IndexController.java │ │ └── UserController.java │ │ └── entity │ │ └── UserInfo.java └── pom.xml ├── spring-boot-23-MongoDB ├── src │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── timebusker │ │ ├── repository │ │ ├── PersonRepository.java │ │ ├── AbstractBasicRepository.java │ │ └── UserRepository.java │ │ ├── App.java │ │ └── entity │ │ ├── PersonEntity.java │ │ └── UserEntity.java └── pom.xml ├── spring-boot-22-FarstPlus └── src │ └── main │ ├── resources │ ├── templates │ │ ├── static │ │ │ ├── logo.png │ │ │ ├── favicon.ico │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ ├── fontawesome-webfont.woff2 │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ ├── apple-icon-144x144.png │ │ │ ├── img │ │ │ │ └── logoin-background.png │ │ │ └── plugins │ │ │ │ ├── treegrid │ │ │ │ ├── img │ │ │ │ │ ├── file.png │ │ │ │ │ ├── expand.png │ │ │ │ │ ├── folder.png │ │ │ │ │ └── collapse.png │ │ │ │ ├── jquery.treegrid.bootstrap3.js │ │ │ │ └── jquery.treegrid.css │ │ │ │ ├── layer │ │ │ │ └── skin │ │ │ │ │ ├── default │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── icon-ext.png │ │ │ │ │ ├── loading-0.gif │ │ │ │ │ ├── loading-1.gif │ │ │ │ │ └── loading-2.gif │ │ │ │ │ └── moon │ │ │ │ │ └── default.png │ │ │ │ ├── ztree │ │ │ │ └── css │ │ │ │ │ ├── metroStyle │ │ │ │ │ └── img │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── metro.gif │ │ │ │ │ │ ├── metro.png │ │ │ │ │ │ └── line_conn.png │ │ │ │ │ ├── zTreeStyle │ │ │ │ │ └── img │ │ │ │ │ │ ├── diy │ │ │ │ │ │ ├── 2.png │ │ │ │ │ │ ├── 3.png │ │ │ │ │ │ ├── 4.png │ │ │ │ │ │ ├── 5.png │ │ │ │ │ │ ├── 6.png │ │ │ │ │ │ ├── 7.png │ │ │ │ │ │ ├── 8.png │ │ │ │ │ │ ├── 9.png │ │ │ │ │ │ ├── 1_close.png │ │ │ │ │ │ └── 1_open.png │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ ├── zTreeStandard.gif │ │ │ │ │ │ └── zTreeStandard.png │ │ │ │ │ └── awesomeStyle │ │ │ │ │ └── img │ │ │ │ │ └── loading.gif │ │ │ │ └── jqgrid │ │ │ │ └── ui.jqgrid-bootstrap-ui.css │ │ └── views │ │ │ └── main.html │ ├── logback-spring.xml │ └── application.properties │ └── java │ └── com │ └── timebusker │ ├── service │ ├── UserTokenService.java │ └── impl │ │ └── UserTokenServiceImpl.java │ ├── App.java │ ├── oauth2 │ └── OAuth2Token.java │ ├── exception │ └── ErrorMassage.java │ ├── entity │ └── OssEntity.java │ └── utils │ └── SQLFilter.java ├── spring-boot-24-WebSocket ├── src │ └── main │ │ └── java │ │ └── com │ │ └── timebusker │ │ ├── App.java │ │ └── conf │ │ └── WebSocketConfig.java └── pom.xml ├── _git_push.cmd ├── spring-boot-21-MultiDataSource ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── timebusker │ │ │ ├── repository │ │ │ ├── BaseRepository.java │ │ │ ├── qj │ │ │ │ └── QjSubInfoRepository.java │ │ │ └── km │ │ │ │ ├── KmSubInfoRepository.java │ │ │ │ ├── KmSubExpTaskRepository.java │ │ │ │ └── KmSubExportRepository.java │ │ │ └── App.java │ │ └── resources │ │ └── logback.xml └── README.md └── spring-boot-13-MyBatis-XML └── pom.xml /_git_pull.cmd: -------------------------------------------------------------------------------- 1 | color 0a 2 | @echo off & setlocal 3 | git pull -------------------------------------------------------------------------------- /spring-boot-18-MQ/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-8-AOP/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /static/12/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/12/1.png -------------------------------------------------------------------------------- /static/12/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/12/2.png -------------------------------------------------------------------------------- /static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/logo.png -------------------------------------------------------------------------------- /spring-boot-13-MyBatis/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-15-Redis/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-17-monitor/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-2-RESTful/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-3-logs/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spring-boot-5-Async/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-7-EhCache/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /static/111111.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/111111.png -------------------------------------------------------------------------------- /spring-boot-1-QuickStart/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-1-QuickStart/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | # 服务端口 2 | server.port=82 -------------------------------------------------------------------------------- /spring-boot-1-QuickStart/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | # 服务端口 2 | server.port=81 -------------------------------------------------------------------------------- /spring-boot-10-SpringData/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-12-Swagger2/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-14-JdbcTemplate/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-16-Transcation/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-2-RESTful/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | # 服务端口 2 | server.port=3333 -------------------------------------------------------------------------------- /spring-boot-2-RESTful/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | # 服务端口 2 | server.port=2222 -------------------------------------------------------------------------------- /spring-boot-4-Scheduled/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /static/15/redis.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/15/redis.zip -------------------------------------------------------------------------------- /static/18/MQ对比.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/18/MQ对比.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | logs/ 6 | ./logs/ 7 | .idea 8 | *.iml -------------------------------------------------------------------------------- /spring-boot-11-SpringSecurity/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-6-GlobalException/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-9-JavaMailSender/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /static/spring-boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot.png -------------------------------------------------------------------------------- /spring-boot-19-Definition-Starter/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j2/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Logback/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-kafka/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-cache/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-mq/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rocketmq/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /static/10/spring-data-jpa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/10/spring-data-jpa.png -------------------------------------------------------------------------------- /static/18/rabbitmq/direct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/18/rabbitmq/direct.png -------------------------------------------------------------------------------- /static/18/rabbitmq/fanout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/18/rabbitmq/fanout.png -------------------------------------------------------------------------------- /static/18/rabbitmq/topic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/18/rabbitmq/topic.png -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-sample/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /static/spring-boot-8-AOP/aop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-8-AOP/aop.png -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-AdminClient/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-AdminServer/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-actuator/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/doc/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-20-Freemarker/doc/1.png -------------------------------------------------------------------------------- /static/spring-boot-3-logs/SLF4J.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-3-logs/SLF4J.png -------------------------------------------------------------------------------- /static/spring-boot-8-AOP/advice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-8-AOP/advice.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/get.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/get.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/head.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/post.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/put.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/put.png -------------------------------------------------------------------------------- /static/spring-boot-3-logs/logging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-3-logs/logging.png -------------------------------------------------------------------------------- /static/spring-boot-8-AOP/aop-mine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-8-AOP/aop-mine.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/delete.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/get-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/get-all.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/get-one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/get-one.png -------------------------------------------------------------------------------- /static/spring-boot-7-EhCache/ehcache.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-7-EhCache/ehcache.jpg -------------------------------------------------------------------------------- /spring-boot-19-Definition-Starter/spring-boot-19-Definition-Starter-Test/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/add-post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/add-post.png -------------------------------------------------------------------------------- /spring-boot-19-Definition-Starter/spring-boot-19-Definition-Starter-Service/.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | *.iml -------------------------------------------------------------------------------- /static/spring-boot-1-QuickStart/app-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-1-QuickStart/app-main.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/delete-one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/delete-one.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/insert-post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/insert-post.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/restful-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/restful-api.png -------------------------------------------------------------------------------- /static/spring-boot-2-RESTful/update-put.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-2-RESTful/update-put.png -------------------------------------------------------------------------------- /static/spring-boot-5-Async/async-test-res.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-5-Async/async-test-res.png -------------------------------------------------------------------------------- /static/spring-boot-13-MyBatis/mybatis-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-13-MyBatis/mybatis-logo.png -------------------------------------------------------------------------------- /static/spring-boot-6-GlobalException/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-6-GlobalException/error.png -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/test/java/cn/timebusker/test/One2manyTest.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.test; 2 | 3 | public class One2manyTest { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/doc/Freemarker快速入门.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-20-Freemarker/doc/Freemarker快速入门.pdf -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/doc/freemarker中文手册.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-20-Freemarker/doc/freemarker中文手册.pdf -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/doc/不错的FreeMarker教程.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-20-Freemarker/doc/不错的FreeMarker教程.pdf -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j2/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | #开发环境 2 | 3 | # 应用自定义配置 4 | logging.config=classpath:log4j2-dev.xml -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j2/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | #生产环境 2 | 3 | # 应用自定义配置 4 | logging.config=classpath:log4j2-prod.xml -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j2/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | #测试环境 2 | 3 | # 应用自定义配置 4 | logging.config=classpath:log4j2-test.xml -------------------------------------------------------------------------------- /static/spring-boot-4-Scheduled/spring-core-tast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-4-Scheduled/spring-core-tast.png -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/test/java/cn/timebusker/test/Many2manyTest.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.test; 2 | 3 | public class Many2manyTest { 4 | 5 | 6 | } 7 | -------------------------------------------------------------------------------- /static/spring-boot-4-Scheduled/spring-core-tast-res.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-4-Scheduled/spring-core-tast-res.png -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/model/many2many/Commodity.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.model.many2many; 2 | 3 | public class Commodity { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/model/many2many/category.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.model.many2many; 2 | 3 | public class category { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /static/spring-boot-3-logs/spring-boot-3-logs-Log4j/Log4j.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-3-logs/spring-boot-3-logs-Log4j/Log4j.png -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j2/src/main/resources/log4j2-prod.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j2/src/main/resources/log4j2-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /static/spring-boot-3-logs/spring-boot-3-logs-Log4j2/Log4j2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-3-logs/spring-boot-3-logs-Log4j2/Log4j2.png -------------------------------------------------------------------------------- /static/spring-boot-3-logs/spring-boot-3-logs-Log4j/log4j-mine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-3-logs/spring-boot-3-logs-Log4j/log4j-mine.png -------------------------------------------------------------------------------- /static/spring-boot-3-logs/spring-boot-3-logs-Log4j/log4j-root.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-3-logs/spring-boot-3-logs-Log4j/log4j-root.png -------------------------------------------------------------------------------- /static/spring-boot-3-logs/spring-boot-3-logs-Logback/Logback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-3-logs/spring-boot-3-logs-Logback/Logback.png -------------------------------------------------------------------------------- /spring-boot-23-MongoDB/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # \u6570\u636E\u5E93\u4E0D\u5B58\u5728\u4F1A\u81EA\u52A8\u521B\u5EFA 2 | spring.data.mongodb.uri=mongodb://12.12.12.23:27017/test -------------------------------------------------------------------------------- /spring-boot-9-JavaMailSender/src/main/resources/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-9-JavaMailSender/src/main/resources/static/img/logo.png -------------------------------------------------------------------------------- /static/spring-boot-3-logs/spring-boot-3-logs-Logback/logback_cn.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-3-logs/spring-boot-3-logs-Logback/logback_cn.pdf -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/logo.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/favicon.ico -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /spring-boot-19-Definition-Starter/spring-boot-19-Definition-Starter-Service/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.timebusker.config.CalculateAutoConfigure -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/apple-icon-144x144.png -------------------------------------------------------------------------------- /spring-boot-24-WebSocket/src/main/java/com/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package com.timebusker; 2 | 3 | /** 4 | * @DESC:Application 5 | * @author:timebusker 6 | * @date:2018/10/30 7 | */ 8 | public class App { 9 | } 10 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | ## 配置多环境日志输出格式 2 | logging.config=classpath:log4j-dev.properties 3 | 4 | ## 配置包下日志输出格式,可在日志配置文件中直接引用 5 | logging.level.cn.timebusker=ERROR -------------------------------------------------------------------------------- /spring-boot-11-SpringSecurity/src/main/java/cn/timebusker/security/constant/RoleConstant.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.security.constant; 2 | 3 | public interface RoleConstant { 4 | 5 | String ROLE_USER = "ROLE_USER"; 6 | } 7 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/img/logoin-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/img/logoin-background.png -------------------------------------------------------------------------------- /static/spring-boot-17-monitor/spring-boot-17-monitor-actuator/spring-boot-actuator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/static/spring-boot-17-monitor/spring-boot-17-monitor-actuator/spring-boot-actuator.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/treegrid/img/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/treegrid/img/file.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/treegrid/img/expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/treegrid/img/expand.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/treegrid/img/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/treegrid/img/folder.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/treegrid/img/collapse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/treegrid/img/collapse.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/default/icon.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/moon/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/moon/default.png -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/java/cn/timebusker/service/user/UserInfoService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service.user; 2 | 3 | public interface UserInfoService { 4 | 5 | String addUserInfo(String name) throws IllegalArgumentException; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/default/icon-ext.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/default/loading-0.gif -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/default/loading-1.gif -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/layer/skin/default/loading-2.gif -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/metroStyle/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/metroStyle/img/loading.gif -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/metroStyle/img/metro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/metroStyle/img/metro.gif -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/metroStyle/img/metro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/metroStyle/img/metro.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/2.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/3.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/4.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/5.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/6.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/7.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/8.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/9.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/loading.gif -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/awesomeStyle/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/awesomeStyle/img/loading.gif -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/metroStyle/img/line_conn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/metroStyle/img/line_conn.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/line_conn.gif -------------------------------------------------------------------------------- /spring-boot-2-RESTful/src/main/java/cn/timebusker/conf/WebConfig.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.conf; 2 | 3 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 4 | 5 | public class WebConfig extends WebMvcConfigurerAdapter{ 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/1_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/1_close.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/1_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/diy/1_open.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/zTreeStandard.gif -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timebusker/spring-boot/HEAD/spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/ztree/css/zTreeStyle/img/zTreeStandard.png -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/treegrid/jquery.treegrid.bootstrap3.js: -------------------------------------------------------------------------------- 1 | $.extend($.fn.treegrid.defaults, { 2 | expanderExpandedClass: 'glyphicon glyphicon-chevron-down', 3 | expanderCollapsedClass: 'glyphicon glyphicon-chevron-right' 4 | }); 5 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/java/cn/timebusker/service/order/OrderInfoService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service.order; 2 | 3 | import cn.timebusker.annotation.timebuskerBean; 4 | 5 | @timebuskerBean 6 | public interface OrderInfoService { 7 | 8 | String addOrderInfo(String name); 9 | } 10 | -------------------------------------------------------------------------------- /_git_push.cmd: -------------------------------------------------------------------------------- 1 | color 0a 2 | @echo off & setlocal 3 | 4 | set var=":sun_with_face::sunflower::palm_tree::house_with_garden::office::octocat::guitar::meat_on_bone:" 5 | set d=%date:~0,10% 6 | set t=%time:~0,8% 7 | set m="springboot版本升级到2.1.3" 8 | 9 | git add . 10 | git commit -am "%d% %t% ____ %var% %m%" 11 | git push origin master -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/repository/one2one/AddressRepository.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.repository.one2one; 2 | 3 | import cn.timebusker.model.one2one.Address; 4 | import cn.timebusker.repository.BasicRepository; 5 | 6 | public interface AddressRepository extends BasicRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/repository/one2many/positionRepository.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.repository.one2many; 2 | 3 | import cn.timebusker.model.one2many.position; 4 | import cn.timebusker.repository.BasicRepository; 5 | 6 | public interface positionRepository extends BasicRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/repository/one2many/departmentRepository.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.repository.one2many; 2 | 3 | import cn.timebusker.model.one2many.department; 4 | import cn.timebusker.repository.BasicRepository; 5 | 6 | public interface departmentRepository extends BasicRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/repository/one2many/detailInfoRepository.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.repository.one2many; 2 | 3 | import cn.timebusker.model.one2many.detailInfo; 4 | import cn.timebusker.repository.BasicRepository; 5 | 6 | public interface detailInfoRepository extends BasicRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/repository/one2many/companyRepository.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.repository.one2many; 2 | 3 | import cn.timebusker.model.one2many.company; 4 | import cn.timebusker.repository.BasicRepository; 5 | 6 | 7 | public interface companyRepository extends BasicRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /spring-boot-21-MultiDataSource/src/main/java/com/timebusker/repository/BaseRepository.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.repository; 2 | 3 | import java.io.Serializable; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | public interface BaseRepository extends JpaRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /spring-boot-6-GlobalException/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 |

Hello Thymeleaf

9 |
10 |

Hello World

11 | 12 | -------------------------------------------------------------------------------- /spring-boot-1-QuickStart/src/main/resources/dubbo.properties: -------------------------------------------------------------------------------- 1 | ##自定义属性与加载 cn.timebusker.conf.DubboConfig.java 2 | dubbo.resAddress=zookeeper://10.10.10.30:2181?backup=10.10.10.40:2181,10.10.10.45:2181 3 | dubbo.appName=dsc-core 4 | dubbo.resUsername= 5 | dubbo.resPassowrd= 6 | dubbo.protocol=dubbo 7 | dubbo.port=57777 8 | dubbo.monAddress= 9 | dubbo.accepts=700 10 | dubbo.connections=2 -------------------------------------------------------------------------------- /spring-boot-5-Async/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/async 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-2-RESTful/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/restful 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-4-Scheduled/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/sheduled 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-4-Scheduled/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/logback 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-4-Scheduled/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/logback 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-5-Async/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/logback 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-5-Async/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/logback 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-1-QuickStart/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/quickstart 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-14-JdbcTemplate/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/logback 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-16-Transcation/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/logback 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-12-Swagger2/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | ## 项目contextPath,一般在正式发布版本中,我们不配置 2 | #server.context-path=/Swagger2 3 | ## 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | #server.error.path=/error 5 | ## 服务端口 6 | server.port=80 7 | ## session最大超时时间(分钟),默认为30 8 | #server.session-timeout=60 9 | ## 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | ## server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #\u670D\u52A1\u7AEF\u53E3 2 | server.port=80 3 | #freemarker\u914D\u7F6E 4 | spring.freemarker.cache=false 5 | spring.freemarker.checkTemplateLocation=true 6 | spring.freemarker.contentType=text/html 7 | spring.freemarker.suffix=.html 8 | spring.freemarker.templateEncoding=UTF-8 9 | spring.freemarker.templateLoaderPath=classpath:/templates/ -------------------------------------------------------------------------------- /spring-boot-6-GlobalException/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/exception 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Logback/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/logback 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Logback/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/logback 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Logback/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/logback 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-mq/src/main/java/cn/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class App { 8 | 9 | public static void main(String[] args) { 10 | // spring boot实践 11 | SpringApplication.run(App.class, args); 12 | } 13 | } -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rocketmq/src/main/java/cn/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class App { 8 | 9 | public static void main(String[] args) { 10 | // spring boot实践 11 | SpringApplication.run(App.class, args); 12 | } 13 | } -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-cache/src/main/java/cn/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class App { 8 | 9 | public static void main(String[] args) { 10 | // spring boot实践 11 | SpringApplication.run(App.class, args); 12 | } 13 | } -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-sample/src/main/java/cn/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class App { 8 | 9 | public static void main(String[] args) { 10 | // spring boot实践 11 | SpringApplication.run(App.class, args); 12 | } 13 | } -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-kafka/README.md: -------------------------------------------------------------------------------- 1 | ### [整合kafka示例](https://github.com/timebusker/spring-boot/tree/master/spring-boot-18-MQ/spring-boot-18-MQ-kafka/) 2 | 3 | ### 相关文章 4 | [ ActiveMQ安装部署(Windows)](http://blog.csdn.net/clj198606061111/article/details/38145597) 5 | [Spring Boot集成ActiveMQ](http://412887952-qq-com.iteye.com/blog/2319751) 6 | [Spring Boot集成ActiveMQ](http://412887952-qq-com.iteye.com/blog/2338176) 7 | 8 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/java/cn/timebusker/utils/CommonUtil.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.utils; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | public class CommonUtil { 7 | 8 | private final static Logger logger = LoggerFactory.getLogger(CommonUtil.class); 9 | 10 | public static int add(int i) { 11 | i = i + 1; 12 | logger.info("CommonUtil 的处理结果为:" + i); 13 | return i; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/README.md: -------------------------------------------------------------------------------- 1 | ### [整合ActiveMQ示例](https://github.com/timebusker/spring-boot/tree/master/spring-boot-18-MQ/spring-boot-18-MQ-activemq/) 2 | 3 | ### 相关文章 4 | [ ActiveMQ安装部署(Windows)](http://blog.csdn.net/clj198606061111/article/details/38145597) 5 | [Spring Boot集成ActiveMQ](http://412887952-qq-com.iteye.com/blog/2319751) 6 | [Spring Boot集成ActiveMQ](http://412887952-qq-com.iteye.com/blog/2338176) 7 | 8 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rocketmq/README.md: -------------------------------------------------------------------------------- 1 | ### [整合RocketMQ示例](https://github.com/timebusker/spring-boot/tree/master/spring-boot-18-MQ/spring-boot-18-MQ-rocketmq/) 2 | 3 | ### 相关文章 4 | [ ActiveMQ安装部署(Windows)](http://blog.csdn.net/clj198606061111/article/details/38145597) 5 | [Spring Boot集成ActiveMQ](http://412887952-qq-com.iteye.com/blog/2319751) 6 | [Spring Boot集成ActiveMQ](http://412887952-qq-com.iteye.com/blog/2338176) 7 | 8 | -------------------------------------------------------------------------------- /spring-boot-21-MultiDataSource/src/main/java/com/timebusker/repository/qj/QjSubInfoRepository.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.repository.qj; 2 | 3 | import com.timebusker.entity.qj.SubInfoPo; 4 | import com.timebusker.repository.BaseRepository; 5 | 6 | /** 7 | * @DESC:SubInfoRepository 8 | * @author:timebusker 9 | * @date:2018/7/7 10 | */ 11 | public interface QjSubInfoRepository extends BaseRepository { 12 | } 13 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/java/cn/timebusker/utils/DateUtil.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.utils; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | public class DateUtil { 7 | 8 | public static String now() { 9 | Date date = new Date(); 10 | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); 11 | String dateString = formatter.format(date); 12 | return dateString; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/java/cn/timebusker/annotation/timebuskerMethod.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | import java.lang.annotation.Target; 6 | 7 | @Retention(RetentionPolicy.RUNTIME) 8 | @Target({ java.lang.annotation.ElementType.METHOD }) 9 | public @interface timebuskerMethod { 10 | 11 | public abstract String value() default ""; 12 | } 13 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/java/com/timebusker/service/UserTokenService.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.service; 2 | 3 | import com.timebusker.common.R; 4 | 5 | /** 6 | * @DESC:UserTokenService 7 | * @author:timebusker 8 | * @date:2018/8/29 9 | */ 10 | public interface UserTokenService { 11 | 12 | /** 13 | * 登录token生成 14 | * 15 | * @param userId 16 | * @return 17 | */ 18 | public R createToken(String userId); 19 | } 20 | -------------------------------------------------------------------------------- /spring-boot-21-MultiDataSource/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-23-MongoDB/src/main/java/com/timebusker/repository/PersonRepository.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.repository; 2 | 3 | import com.timebusker.entity.PersonEntity; 4 | import org.springframework.data.mongodb.repository.MongoRepository; 5 | 6 | /** 7 | * @DESC:PersonRepository 8 | * @author:timebusker 9 | * @date:2018/9/6 10 | */ 11 | public interface PersonRepository extends AbstractBasicRepository, MongoRepository { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-23-MongoDB/src/main/java/com/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package com.timebusker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * @DESC:Application 8 | * @author:timebusker 9 | * @date:2018/9/5 10 | */ 11 | @SpringBootApplication 12 | public class App { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(App.class); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev -------------------------------------------------------------------------------- /spring-boot-11-SpringSecurity/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /spring-boot-11-SpringSecurity/src/main/java/cn/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker; 2 | 3 | import java.util.Arrays; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.ApplicationContext; 8 | 9 | @SpringBootApplication 10 | public class App { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(App.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-21-MultiDataSource/src/main/java/com/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package com.timebusker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * @DESC:Application 8 | * @author:timebusker 9 | * @date:2018/7/7 10 | */ 11 | @SpringBootApplication 12 | public class App { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-12-Swagger2/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-13-MyBatis/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-16-Transcation/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-kafka/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev -------------------------------------------------------------------------------- /spring-boot-14-JdbcTemplate/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-cache/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-mq/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rocketmq/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev -------------------------------------------------------------------------------- /spring-boot-9-JavaMailSender/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-sample/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spring-boot-11-SpringSecurity/src/main/java/cn/timebusker/service/UserService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service; 2 | 3 | import cn.timebusker.model.UserEntity; 4 | 5 | public interface UserService { 6 | 7 | /** 8 | * 添加新用户 9 | * 10 | * username 唯一, 默认 USER 权限 11 | */ 12 | boolean insert(UserEntity userEntity); 13 | 14 | /** 15 | * 查询用户信息 16 | * @param username 账号 17 | * @return UserEntity 18 | */ 19 | UserEntity getByUsername(String username); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-cache/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | %date [%thread] %-5level %logger{80} || %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-mq/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | %date [%thread] %-5level %logger{80} || %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | %date [%thread] %-5level %logger{80} || %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | %date [%thread] %-5level %logger{80} || %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rocketmq/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | %date [%thread] %-5level %logger{80} || %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-sample/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | %date [%thread] %-5level %logger{80} || %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-12-Swagger2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-13-MyBatis/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-19-Definition-Starter/spring-boot-19-Definition-Starter-Service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev -------------------------------------------------------------------------------- /spring-boot-2-RESTful/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-4-Scheduled/src/main/java/cn/timebusker/quartz/AutoQuartz.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.quartz; 2 | 3 | import java.util.Date; 4 | 5 | import org.quartz.Job; 6 | import org.quartz.JobExecutionContext; 7 | import org.quartz.JobExecutionException; 8 | 9 | /** 10 | * 任务类: 11 | */ 12 | public class AutoQuartz implements Job{ 13 | 14 | public void execute(JobExecutionContext context) throws JobExecutionException { 15 | // 执行响应的任务. 16 | System.out.println("AutoQuartz.execute:任务执行类 _______ ," + new Date()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /spring-boot-4-Scheduled/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-5-Async/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-7-EhCache/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-14-JdbcTemplate/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-16-Transcation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-19-Definition-Starter/spring-boot-19-Definition-Starter-Test/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | %date [%thread] %-5level %logger{80} || %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-7-EhCache/src/main/java/cn/timebusker/dao/UserRepository.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.dao; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import cn.timebusker.entity.User; 6 | 7 | public interface UserRepository extends JpaRepository { 8 | 9 | /** 10 | * 通过用户名查询用户 11 | * 12 | * @param name 13 | * @return 14 | */ 15 | User findByName(String name); 16 | 17 | /** 18 | * 通过用户ID查询用户 19 | * 20 | * @param id 21 | * @return 22 | */ 23 | User findById(String id); 24 | } 25 | -------------------------------------------------------------------------------- /spring-boot-9-JavaMailSender/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-16-Transcation/src/main/java/cn/timebusker/util/LoggingUtil.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | public class LoggingUtil { 7 | 8 | private final static Logger logger = LoggerFactory.getLogger(LoggingUtil.class); 9 | 10 | public static void creatLogging() { 11 | logger.info("----------------------------------INFO"); 12 | logger.debug("----------------------------------DEBUG"); 13 | logger.error("----------------------------------ERROR"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/java/cn/timebusker/mq/queue/ActiveMQQueueConsumerBackup.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.queue; 2 | 3 | import org.springframework.jms.annotation.JmsListener; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class ActiveMQQueueConsumerBackup { 8 | 9 | /** 10 | * @JmsListener进行监听 11 | */ 12 | @JmsListener(destination = "timebusker.queue") 13 | public void receiveQueue(String text) { 14 | System.out.println("Backup\t\t"+text); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/java/cn/timebusker/mq/queue/ActiveMQQueueConsumerMaster.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.queue; 2 | 3 | import org.springframework.jms.annotation.JmsListener; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class ActiveMQQueueConsumerMaster { 8 | 9 | /** 10 | * @JmsListener进行监听 11 | */ 12 | @JmsListener(destination = "timebusker.queue") 13 | public void receiveQueue(String text) { 14 | System.out.println("Master\t\t"+text); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/java/cn/timebusker/mq/topic/ActiveMQTopicConsumerBackup.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.topic; 2 | 3 | import org.springframework.jms.annotation.JmsListener; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class ActiveMQTopicConsumerBackup { 8 | 9 | /** 10 | * @JmsListener进行监听 11 | */ 12 | @JmsListener(destination = "timebusker.topic") 13 | public void receiveQueue(String text) { 14 | System.out.println("Backup\t\t"+text); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/java/cn/timebusker/mq/topic/ActiveMQTopicConsumerMaster.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.topic; 2 | 3 | import org.springframework.jms.annotation.JmsListener; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class ActiveMQTopicConsumerMaster { 8 | 9 | /** 10 | * @JmsListener进行监听 11 | */ 12 | @JmsListener(destination = "timebusker.topic") 13 | public void receiveQueue(String text) { 14 | System.out.println("Master\t\t"+text); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-19-Definition-Starter/spring-boot-19-Definition-Starter-Service/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | %date [%thread] %-5level %logger{80} || %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-6-GlobalException/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-14-JdbcTemplate/src/main/java/cn/timebusker/util/LoggingUtil.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | public class LoggingUtil { 7 | 8 | private final static Logger logger = LoggerFactory.getLogger(LoggingUtil.class); 9 | 10 | public static void creatLogging() { 11 | logger.info("----------------------------------INFO"); 12 | logger.debug("----------------------------------DEBUG"); 13 | logger.error("----------------------------------ERROR"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/aop 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 11 | 12 | # AOP 13 | # 是否支持@EnableAspectJAutoProxy,默认为: true 14 | spring.aop.auto= true 15 | # true为使用CGLIB代理,false为JDK代理,默认为false 16 | spring.aop.proxy-target-class=true -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/java/cn/timebusker/web/indexController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RequestMethod; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class indexController { 9 | 10 | 11 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 12 | public Long createLogs() { 13 | return System.currentTimeMillis(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Logback/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j/src/main/java/cn/timebusker/util/LoggingUtil.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | public class LoggingUtil { 7 | 8 | private static final Logger logger = LoggerFactory.getLogger(LoggingUtil.class); 9 | 10 | public static void creatLogging() { 11 | logger.info("----------------------------------INFO"); 12 | logger.debug("----------------------------------DEBUG"); 13 | logger.error("----------------------------------ERROR"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Logback/src/main/java/cn/timebusker/util/LoggingUtil.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | public class LoggingUtil { 7 | 8 | private final static Logger logger = LoggerFactory.getLogger(LoggingUtil.class); 9 | 10 | public static void creatLogging() { 11 | logger.info("----------------------------------INFO"); 12 | logger.debug("----------------------------------DEBUG"); 13 | logger.error("----------------------------------ERROR"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/model/one2one/test.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.model.one2one; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.Id; 7 | import javax.persistence.Table; 8 | 9 | /** 10 | * 设置符合逐渐 可以同时使用两个@Id进行注释到成员上 11 | */ 12 | @Entity 13 | @Table(name = "t_test") 14 | public class test implements Serializable { 15 | 16 | private static final long serialVersionUID = 5260045025079981216L; 17 | 18 | @Id 19 | private long teid; 20 | 21 | @Id 22 | private long stid; 23 | } 24 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-AdminClient/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-AdminServer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-actuator/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | 3 | 4 | ######################################################################################## 5 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 6 | #{profile}对应你的环境标识 7 | #application-dev.properties:开发环境 8 | #application-test.properties:测试环境 9 | #application-prod.properties:生产环境 10 | # 多环境配置文件激活属性---开发、测试、生产 11 | spring.profiles.active=dev 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j2/src/main/java/cn/timebusker/util/LoggingUtil.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | 7 | public class LoggingUtil { 8 | 9 | private static final Logger logger = LoggerFactory.getLogger(LoggingUtil.class); 10 | 11 | public static void creatLogging() { 12 | logger.info("----------------------------------INFO"); 13 | logger.debug("----------------------------------DEBUG"); 14 | logger.error("----------------------------------ERROR"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-actuator/src/main/java/cn/timebusker/util/LoggingUtil.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | public class LoggingUtil { 7 | 8 | private final static Logger logger = LoggerFactory.getLogger(LoggingUtil.class); 9 | 10 | public static void creatLogging() { 11 | logger.info("----------------------------------INFO"); 12 | logger.debug("----------------------------------DEBUG"); 13 | logger.error("----------------------------------ERROR"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-19-Definition-Starter/spring-boot-19-Definition-Starter-Service/src/main/java/cn/timebusker/config/CalculateProperties.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.config; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | 5 | /** 6 | * 服务配置类 7 | */ 8 | 9 | @ConfigurationProperties("calculate") 10 | public class CalculateProperties { 11 | 12 | private int scale; 13 | 14 | public int getScale() { 15 | return scale; 16 | } 17 | 18 | public void setScale(int scale) { 19 | this.scale = scale; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spring-boot-6-GlobalException/src/main/resources/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 统一异常处理 6 | 7 | 8 |

errorMassage Handler

9 |
1:错误编码 10 |
11 |
2:错误消息 12 |
13 |
3:错误的URL 14 |
15 |
4:异常信息 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class App { 8 | 9 | public static void main(String[] args) { 10 | // devtools:是spring boot的一个热部署工具 11 | //设置 spring.devtools.restart.enabled 属性为false,可以关闭该特性. 12 | //System.setProperty("spring.devtools.restart.enabled","false"); 13 | // 启动Sprign Boot 14 | SpringApplication.run(App.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-AdminClient/src/main/java/cn/timebusker/util/LoggingUtil.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | public class LoggingUtil { 7 | 8 | private final static Logger logger = LoggerFactory.getLogger(LoggingUtil.class); 9 | 10 | public static void creatLogging() { 11 | logger.info("----------------------------------INFO"); 12 | logger.debug("----------------------------------DEBUG"); 13 | logger.error("----------------------------------ERROR"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/java/cn/timebusker/service/CommonService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.stereotype.Service; 6 | 7 | import cn.timebusker.annotation.timebuskerBean; 8 | 9 | @Service 10 | @timebuskerBean 11 | public class CommonService { 12 | 13 | private final static Logger logger = LoggerFactory.getLogger(CommonService.class); 14 | 15 | public int add(int i) { 16 | i = i + 1; 17 | logger.info("CommonService 的处理结果为:" + i); 18 | return i; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/java/cn/timebusker/annotation/timebuskerBean.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | import org.springframework.stereotype.Component; 9 | 10 | 11 | @Target({ java.lang.annotation.ElementType.TYPE }) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Documented 14 | @Component 15 | public @interface timebuskerBean { 16 | 17 | public abstract String value() default ""; 18 | } 19 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/java/cn/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | import cn.timebusker.mq.sample.JmsConsumer; 7 | import cn.timebusker.mq.sample.JmsProducer; 8 | 9 | @SpringBootApplication 10 | public class App { 11 | 12 | public static void main(String[] args) { 13 | // MQ简单模型 14 | JmsProducer.run(); 15 | JmsConsumer.run(); 16 | // spring boot实践 17 | SpringApplication.run(App.class, args); 18 | } 19 | } -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/test/java/cn/timebusker/test/CommonTest.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.test; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @Description:CommonTest 10 | * @Author:Administrator 11 | * @Date2019/10/30 20:11 12 | **/ 13 | public class CommonTest { 14 | 15 | @Test 16 | public void test1() { 17 | Map map = new HashMap<>(); 18 | map.put("1", 1); 19 | 20 | System.out.println(map.get("1")); 21 | System.out.println(map.get("2").toString()); 22 | } 23 | } -------------------------------------------------------------------------------- /spring-boot-12-Swagger2/src/main/java/cn/timebusker/web/SwaggerController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestMethod; 6 | 7 | import io.swagger.annotations.Api; 8 | 9 | @Api("SwaggerController接口测试") 10 | @Controller 11 | @RequestMapping("/api") 12 | public class SwaggerController { 13 | 14 | @RequestMapping(value="",method = RequestMethod.GET) 15 | public String swagger() { 16 | return "index"; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /spring-boot-13-MyBatis-XML/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | spring-boot 7 | cn.timebusker 8 | 2.0.0 9 | 10 | 4.0.0 11 | 12 | spring-boot-13-MyBatis-XML 13 | 14 | 15 | -------------------------------------------------------------------------------- /spring-boot-2-RESTful/src/main/java/cn/timebusker/service/DemoInfoService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service; 2 | 3 | import java.util.List; 4 | 5 | import cn.timebusker.entity.DemoInfo; 6 | 7 | /** 8 | * 9 | * @author timebusker 10 | * 11 | * 2017年4月7日 12 | * 13 | * DemoInfoService 接口类 14 | */ 15 | public interface DemoInfoService { 16 | 17 | List insertDemoInfo(DemoInfo demo); 18 | 19 | DemoInfo findDemoInfo(String id); 20 | 21 | List updateDemoInfo(DemoInfo demo); 22 | 23 | List deleteDemoInfo(DemoInfo demo); 24 | 25 | List findAll(); 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | # server.context-path=/mq 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 11 | 12 | spring.application.name=rabbitmq 13 | spring.rabbitmq.host=127.0.0.1 14 | spring.rabbitmq.port=5672 15 | # 不配置,默认使用 guest账户 16 | #spring.rabbitmq.username=guest 17 | #spring.rabbitmq.password=guest -------------------------------------------------------------------------------- /spring-boot-24-WebSocket/src/main/java/com/timebusker/conf/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.conf; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.socket.server.standard.ServerEndpointExporter; 6 | 7 | /** 8 | * @DESC:WebSocketConfig 9 | * @author:timebusker 10 | * @date:2018/10/30 11 | */ 12 | 13 | @Configuration 14 | public class WebSocketConfig { 15 | 16 | @Bean 17 | public ServerEndpointExporter serverEndpointExporter() { 18 | return new ServerEndpointExporter(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-boot-21-MultiDataSource/src/main/java/com/timebusker/repository/km/KmSubInfoRepository.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.repository.km; 2 | 3 | import com.timebusker.entity.km.SubInfoPo; 4 | import com.timebusker.repository.BaseRepository; 5 | import org.springframework.data.jpa.repository.Query; 6 | 7 | /** 8 | * @DESC:SubInfoRepository 9 | * @author:timebusker 10 | * @date:2018/7/7 11 | */ 12 | public interface KmSubInfoRepository extends BaseRepository { 13 | 14 | @Query("select t from SubInfoPo t where subEnable=1 and execStatus='OK' and subId=?1") 15 | SubInfoPo getKmSubInfo(String subId); 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/java/cn/timebusker/service/order/Impl/OrderInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service.order.Impl; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.stereotype.Service; 6 | 7 | import cn.timebusker.service.order.OrderInfoService; 8 | 9 | @Service 10 | public class OrderInfoServiceImpl implements OrderInfoService { 11 | 12 | private final static Logger logger = LoggerFactory.getLogger(OrderInfoServiceImpl.class); 13 | 14 | @Override 15 | public String addOrderInfo(String name) { 16 | logger.info("新增的订单名称是:" + name); 17 | return name + "O"; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /spring-boot-21-MultiDataSource/src/main/java/com/timebusker/repository/km/KmSubExpTaskRepository.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.repository.km; 2 | 3 | import com.timebusker.entity.km.TbSubExpTask; 4 | import com.timebusker.repository.BaseRepository; 5 | import org.springframework.data.jpa.repository.Query; 6 | 7 | /** 8 | * @DESC:SubExpTaskRepository 9 | * @author:timebusker 10 | * @date:2018/7/7 11 | */ 12 | public interface KmSubExpTaskRepository extends BaseRepository { 13 | 14 | @Query("select count(t) from TbSubExpTask t where expStatus='OK' and subId=?1 and batchId=?2") 15 | int getLastSubExpTask(String subId,String batchId); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /spring-boot-9-JavaMailSender/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/email 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 11 | 12 | spring.mail.host=smtp.qq.com 13 | spring.mail.username=576697722@qq.com 14 | spring.mail.password=*********** 15 | spring.mail.properties.mail.smtp.auth=true 16 | spring.mail.properties.mail.smtp.starttls.enable=true 17 | spring.mail.properties.mail.smtp.starttls.required=true -------------------------------------------------------------------------------- /spring-boot-1-QuickStart/README.md: -------------------------------------------------------------------------------- 1 | ---- 2 | ## [spring boot的入门程序](https://github.com/timebusker/spring-boot/tree/master/spring-boot-1-QuickStart/) 3 | 4 | ### 项目阐述——实现多环境属性配置、自定义属性加载、快速搭建spring boot web项目 5 | 6 | ![image](https://github.com/timebusker/spring-boot/raw/master/static/spring-boot-1-QuickStart/app-main.png?raw=true) 7 | 8 | + spring-boot快速入门 9 | * 创建HelloController.java,显示输出web 输出 Hello spring-boot-1-QuickStart!!! 10 | 11 | + 属性配置文件详解 12 | * 多环境属性文件配置 13 | Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式,
14 | 其中{profile}对应你的环境标识。 15 | 16 | * 自定义属性加载 17 | 需要使用@Component注解将类注册到容器内就可以方便使用 18 | 19 | 20 | ---- -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.servlet.context-path=/data-jpa 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 11 | 12 | # 数据库连接 13 | spring.datasource.url=jdbc:postgresql://12.12.12.6:5432/db_test 14 | spring.datasource.username=postgres 15 | spring.datasource.password=timebusker 16 | spring.datasource.driver-class-name=org.postgresql.Driver 17 | spring.jpa.properties.hibernate.hbm2ddl.auto=update -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/java/com/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package com.timebusker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * @DESC:Application 8 | * @author:timebusker 9 | * @date:2018/8/22 10 | */ 11 | @SpringBootApplication 12 | public class App { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(App.class); 16 | System.err.println("\n**************************************\n"); 17 | System.err.println("\t\t\t服务启动成功..."); 18 | System.err.println("\n**************************************\n"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-boot-7-EhCache/src/main/java/cn/timebusker/service/UserService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service; 2 | 3 | import java.util.List; 4 | 5 | import cn.timebusker.entity.User; 6 | 7 | public interface UserService { 8 | 9 | /** 10 | * 使用ID查询用户 11 | * 12 | * @param id 13 | * @return 14 | */ 15 | public User findUserById(Long id); 16 | 17 | /** 18 | * 查询所有用户 19 | * 20 | * @return 21 | */ 22 | public List findAllUser(); 23 | 24 | 25 | /** 26 | * 更新或新增用户信息 27 | * 28 | * @param user 29 | */ 30 | public void saveAndFlush(User user); 31 | 32 | /** 33 | * 通过ID删除一个用户 34 | * 35 | * @param id 36 | */ 37 | public void deleteUserById(Long id); 38 | } 39 | -------------------------------------------------------------------------------- /spring-boot-12-Swagger2/src/main/java/cn/timebusker/domain/User.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.domain; 2 | 3 | public class User { 4 | 5 | private Long id; 6 | private String name; 7 | private Integer age; 8 | 9 | public Long getId() { 10 | return id; 11 | } 12 | 13 | public void setId(Long id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public Integer getAge() { 26 | return age; 27 | } 28 | 29 | public void setAge(Integer age) { 30 | this.age = age; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/repository/BasicRepository.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.repository; 2 | 3 | import java.io.Serializable; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.repository.NoRepositoryBean; 7 | 8 | /** 9 | * 使用同一接口继承需要标记为@NoRepositoryBean,避免被spring-data-jpa识别为repository接口 10 | *

11 | * 在做项目时创建对象的功能会交给Spring去管理在扫描Repository层包时会扫描到BaseRepository接口 ; 12 | * 所有对象类接口都会继承此接口 为了告诉JPA不要创建对应接口的bean对象 就在类上加注解@NoRepositoryBean 13 | * 14 | * @param 15 | * @param 16 | */ 17 | @NoRepositoryBean 18 | public interface BasicRepository extends JpaRepository { 19 | 20 | } -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/java/com/timebusker/oauth2/OAuth2Token.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.oauth2; 2 | 3 | 4 | import org.apache.shiro.authc.AuthenticationToken; 5 | 6 | /** 7 | * token 8 | * 9 | * @author chenshun 10 | * @email sunlightcs@gmail.com 11 | * @date 2017-05-20 13:22 12 | */ 13 | public class OAuth2Token implements AuthenticationToken { 14 | 15 | private String token; 16 | 17 | public OAuth2Token(String token) { 18 | this.token = token; 19 | } 20 | 21 | @Override 22 | public String getPrincipal() { 23 | return token; 24 | } 25 | 26 | @Override 27 | public Object getCredentials() { 28 | return token; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/java/cn/timebusker/service/user/Impl/UserInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service.user.Impl; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.stereotype.Service; 6 | 7 | import cn.timebusker.annotation.timebuskerMethod; 8 | import cn.timebusker.service.user.UserInfoService; 9 | 10 | @Service 11 | public class UserInfoServiceImpl implements UserInfoService { 12 | 13 | private final static Logger logger = LoggerFactory.getLogger(UserInfoServiceImpl.class); 14 | 15 | @Override 16 | @timebuskerMethod 17 | public String addUserInfo(String name) { 18 | logger.info("新增的用户姓名是:" + name); 19 | return name + "U"; 20 | } 21 | } -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/java/cn/timebusker/ActiveMQConfiguration.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker; 2 | 3 | import javax.jms.Queue; 4 | import javax.jms.Topic; 5 | 6 | import org.apache.activemq.command.ActiveMQQueue; 7 | import org.apache.activemq.command.ActiveMQTopic; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | @Configuration 12 | public class ActiveMQConfiguration { 13 | 14 | @Bean("mineQueue") 15 | public Queue queue() { 16 | return new ActiveMQQueue("timebusker.queue"); 17 | } 18 | 19 | @Bean("mineTopic") 20 | public Topic topic() { 21 | return new ActiveMQTopic("timebusker.topic"); 22 | } 23 | } -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-kafka/src/main/java/cn/timebusker/mq/KafkaConsumerService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.kafka.annotation.KafkaListener; 6 | import org.springframework.kafka.core.KafkaTemplate; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * @DESC:KafkaConsumerService:消息消费 11 | * @author:timebusker 12 | * @date:2018/9/13 13 | */ 14 | @Service 15 | public class KafkaConsumerService { 16 | 17 | @KafkaListener(topics = {"test"}) 18 | public void consume(String message){ 19 | System.out.println(message); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/src/main/java/com/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package com.timebusker; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | 8 | /** 9 | * @DESC:Application 10 | * @author:timebusker 11 | * @date:2018/6/23 12 | */ 13 | @SpringBootApplication 14 | public class App { 15 | private final static Logger LOG = LoggerFactory.getLogger(App.class); 16 | 17 | public static void main(String[] args) { 18 | SpringApplication.run(App.class, args); 19 | LOG.info("启动应用成功..."); 20 | LOG.info("设置参数是:" + args.toString()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /spring-boot-21-MultiDataSource/README.md: -------------------------------------------------------------------------------- 1 | #### Spring-Boot多数据源 2 | 使用JdbcTemplate和Spring-data-jpa时,都使用了单数据源。在单数据源的情况下,Spring Boot的配置非常简单, 3 | 只需要在application.properties文件中配置连接参数即可。但是往往随着业务量发展,我们通常会进行数据库拆分或是引入其他数据库, 4 | 从而我们需要配置多个数据源。 5 | 6 | #### 多数据源配置使用的核心是根据配置文件,初始化特定数据源,并绑定到特定的数据服务层,(dao、repository、mapper),因此 7 | spring-jdbc、Spring-data-jpa、Mybatis各自实现存在一定差异。其中多数据源又分静态数据源和动态数据源。 8 | 9 | - 静态数据源:跨库使用数据库比较常用 10 | - 动态数据源:读写分离操作比较常用 11 | 12 | ##### [JdbcTemplate和Spring-data-jpa](https://www.cnblogs.com/fengmao/p/7538854.html) 13 | ##### [Spring Boot 集成Mybatis实现多数据源](https://blog.csdn.net/maoyeqiu/article/details/74011626) 14 | ##### [Spring Boot 集成Mybatis实现多数据源](https://blog.csdn.net/neosmith/article/details/61202084) 15 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/repository/one2many/employeeRepository.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.repository.one2many; 2 | 3 | import org.springframework.data.jpa.repository.Modifying; 4 | import org.springframework.data.jpa.repository.Query; 5 | import org.springframework.data.repository.query.Param; 6 | 7 | import cn.timebusker.model.one2many.employee; 8 | import cn.timebusker.repository.BasicRepository; 9 | 10 | public interface employeeRepository extends BasicRepository { 11 | 12 | @Modifying(clearAutomatically = true) 13 | @Query("update employee set empName =?1 " 14 | + "where empId =?2") 15 | void updateName(@Param(value = "name")String name, 16 | @Param(value = "id")long id); 17 | } 18 | -------------------------------------------------------------------------------- /spring-boot-11-SpringSecurity/src/main/java/cn/timebusker/web/UserController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import org.springframework.security.access.prepost.PreAuthorize; 4 | import org.springframework.security.core.annotation.AuthenticationPrincipal; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.ui.Model; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | 9 | import java.security.Principal; 10 | 11 | @Controller 12 | public class UserController { 13 | 14 | @GetMapping("/user") 15 | public String user(@AuthenticationPrincipal Principal principal, Model model){ 16 | model.addAttribute("username", principal.getName()); 17 | return "user/user"; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/java/cn/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker; 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 App { 10 | 11 | public static void main(String[] args) { 12 | // spring boot实践 13 | SpringApplication.run(App.class, args); 14 | aut(); 15 | } 16 | 17 | private static void aut() { 18 | int x, y; 19 | for (x = 0; x <= 9; x++) { 20 | for (y = 1; y <= x; y++) { 21 | System.out.print(y + "*" + x + "=" + x * y + "\t"); 22 | } 23 | System.out.println(); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/java/cn/timebusker/web/indexController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class indexController { 11 | 12 | private final static Logger logger = LoggerFactory.getLogger(indexController.class); 13 | 14 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 15 | public Long createLogs() { 16 | logger.info("----------------------------------INFO"); 17 | return System.currentTimeMillis(); 18 | } 19 | } -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-mq/src/main/java/cn/timebusker/web/indexController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class indexController { 11 | 12 | private final static Logger logger = LoggerFactory.getLogger(indexController.class); 13 | 14 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 15 | public Long createLogs() { 16 | logger.info("----------------------------------INFO"); 17 | return System.currentTimeMillis(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-kafka/src/main/java/cn/timebusker/web/indexController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class indexController { 11 | 12 | private final static Logger logger = LoggerFactory.getLogger(indexController.class); 13 | 14 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 15 | public Long createLogs() { 16 | logger.info("----------------------------------INFO"); 17 | return System.currentTimeMillis(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rocketmq/src/main/java/cn/timebusker/web/indexController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class indexController { 11 | 12 | private final static Logger logger = LoggerFactory.getLogger(indexController.class); 13 | 14 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 15 | public Long createLogs() { 16 | logger.info("----------------------------------INFO"); 17 | return System.currentTimeMillis(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/repository/one2one/UserRepository.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.repository.one2one; 2 | 3 | import cn.timebusker.model.one2one.User; 4 | import cn.timebusker.repository.BasicRepository; 5 | import org.springframework.data.domain.Page; 6 | import org.springframework.data.domain.Pageable; 7 | import org.springframework.data.jpa.repository.Query; 8 | 9 | public interface UserRepository extends BasicRepository { 10 | 11 | // @Query("select userId,userName from t_user where userId >=?1") 12 | // Page queryWithPageByParams(Integer userId, Pageable pageable); 13 | 14 | 15 | Page queryByUserIdGreaterThan(Integer userId, Pageable pageable); 16 | 17 | Page findAll(Pageable pageable); 18 | } 19 | -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-mq/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cn.timebusker 7 | spring-boot-15-Redis 8 | 2.0.0 9 | 10 | spring-boot-15-Redis-mq 11 | spring-boot-15-Redis-mq 12 | http://maven.apache.org 13 | 14 | UTF-8 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rocketmq/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cn.timebusker 7 | spring-boot-18-MQ 8 | 2.0.0 9 | 10 | spring-boot-18-MQ-rocketmq 11 | spring-boot-18-MQ-rocketmq 12 | http://maven.apache.org 13 | 14 | UTF-8 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /spring-boot-11-SpringSecurity/src/main/java/cn/timebusker/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mapper; 2 | 3 | import cn.timebusker.model.UserEntity; 4 | import org.apache.ibatis.annotations.Insert; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.apache.ibatis.annotations.Select; 8 | import org.springframework.stereotype.Component; 9 | 10 | @Mapper 11 | @Component 12 | public interface UserMapper { 13 | 14 | @Insert("insert into tb_user(username, password, nickname, roles) values(#{username}, #{password}, #{nickname}, #{roles})") 15 | int insert(UserEntity userEntity); 16 | 17 | @Select("select * from tb_user where username = #{username}") 18 | UserEntity selectByUsername(@Param("username") String username); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /spring-boot-23-MongoDB/src/main/java/com/timebusker/repository/AbstractBasicRepository.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.repository; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | /** 7 | * @DESC:AbstratCommonRepository 8 | * @author:timebusker 9 | * @date:2018/9/6 10 | */ 11 | public interface AbstractBasicRepository { 12 | 13 | /** 14 | * 定义参数查询 15 | * @param params 16 | * @return 17 | */ 18 | T findOneByParams(Map params); 19 | 20 | /** 21 | * 定义参数查询 22 | * @param params 23 | * @return 24 | */ 25 | List findByParams(Map params); 26 | 27 | /** 28 | * 定义参数分页查询 29 | * @param params 30 | * @return 31 | */ 32 | List findWithPageByParams(Map params); 33 | } 34 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cn.timebusker 7 | spring-boot-18-MQ 8 | 2.0.0 9 | 10 | spring-boot-18-MQ-rabbitmq 11 | spring-boot-18-MQ-rabbitmq 12 | http://maven.apache.org 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-amqp 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-actuator/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/actuator 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 11 | 12 | 13 | # 新增应用配置信息,便于输出展示 14 | info.app.name=actuator 15 | info.app.version=2.0.0 16 | info.build.artifactId=@project.artifactId@ 17 | info.build.version=@project.version@ 18 | 19 | # endpoints 20 | endpoints.beans.id=springbeans 21 | endpoints.beans.sensitive=false 22 | # 需要使用POST发起请求 23 | endpoints.shutdown.enabled=true 24 | endpoints.health.sensitive=false 25 | endpoints.health.time-to-live=1000 -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cn.timebusker 7 | spring-boot-18-MQ 8 | 2.0.0 9 | 10 | spring-boot-18-MQ-activemq 11 | spring-boot-18-MQ-activemq 12 | http://maven.apache.org 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter-activemq 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /spring-boot-23-MongoDB/src/main/java/com/timebusker/entity/PersonEntity.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.entity; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | import org.springframework.data.annotation.Id; 6 | import org.springframework.data.mongodb.core.mapping.Document; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | * @DESC:PersonEntity 12 | * @author:timebusker 13 | * @date:2018/9/6 14 | */ 15 | @Document(collection = "tb_person") 16 | @Data 17 | @ToString 18 | public class PersonEntity implements Serializable { 19 | 20 | // 指定主键 21 | @Id 22 | private Integer id; 23 | private String name; 24 | private Integer age; 25 | 26 | public PersonEntity(Integer id, String name, Integer age) { 27 | this.id = id; 28 | this.name = name; 29 | this.age = age; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/model/one2many/company.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.model.one2many; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.OneToMany; 11 | import javax.persistence.Table; 12 | 13 | /** 14 | * 公司表 15 | * 16 | * @author Administrator 17 | */ 18 | @Entity 19 | @Table(name = "t_company") 20 | public class company { 21 | 22 | @Id 23 | @GeneratedValue(strategy = GenerationType.IDENTITY) 24 | private long comId; 25 | 26 | @Column(nullable = false, length = 32) 27 | private String comName; 28 | 29 | @OneToMany(mappedBy="company") 30 | private List department; 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-3-logs/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cn.timebusker 7 | spring-boot 8 | 2.0.0 9 | 10 | 11 | spring-boot-3-logs 12 | pom 13 | spring-boot-3-logs 14 | spring-boot整合多个Java日志框架 15 | 16 | 17 | spring-boot-3-logs-Log4j 18 | spring-boot-3-logs-Logback 19 | spring-boot-3-logs-Log4j2 20 | 21 | 22 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/views/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 欢迎页 7 | 8 | 9 | 10 | 11 |

12 |
基本信息
13 |
14 |

项目介绍

15 |
    16 |
  • 一个轻量级的Java快速开发平台
  • 17 |
  • 友好的代码结构及注释,便于阅读及二次开发
  • 18 |
  • 完善的XSS防范及脚本过滤,彻底杜绝XSS攻击
  • 19 |
  • 实现前后端分离,通过token进行数据交互
  • 20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | cn.timebusker 6 | spring-boot 7 | 2.0.0 8 | 9 | spring-boot-17-monitor 10 | pom 11 | spring-boot-17-monitor 12 | spring boot 集群监控 13 | 14 | 15 | spring-boot-17-monitor-actuator 16 | spring-boot-17-monitor-AdminServer 17 | spring-boot-17-monitor-AdminClient 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-sample/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cn.timebusker 7 | spring-boot-15-Redis 8 | 2.0.0 9 | 10 | spring-boot-15-Redis-sample 11 | spring-boot-15-Redis-sample 12 | http://maven.apache.org 13 | 14 | 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-data-redis 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /spring-boot-21-MultiDataSource/src/main/java/com/timebusker/repository/km/KmSubExportRepository.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.repository.km; 2 | 3 | import com.timebusker.entity.km.TbSubExport; 4 | import com.timebusker.repository.BaseRepository; 5 | import org.springframework.data.jpa.repository.Query; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @DESC:SubExpTaskRepository 11 | * @author:timebusker 12 | * @date:2018/7/7 13 | */ 14 | public interface KmSubExportRepository extends BaseRepository { 15 | 16 | @Query("select subId from TbSubExport t where onlineDbType='HIVE-HIVE' and exportEnable=1 group by subId") 17 | List getSubExportToHive(); 18 | 19 | @Query("select count(t) from TbSubExport t where onlineDbType='HIVE-HIVE' and exportEnable=1 and subId=?1") 20 | int getSubExportToHiveCnt(String subId); 21 | } 22 | -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/src/main/resources/templates/free5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | timebusker 6 | 7 | 15 | 16 |

自定义指令

17 |

1.用户123456 是否拥有admin角色,并且返回admin的权限

18 |
    19 | <@role user='123456' role='admin';result1,result2> 20 | <#if result1> 21 | 我的角色是admin
    22 | 23 | 我拥有的权限是: 24 | 25 | <#list result2 as item> 26 | ${item}, 27 | 28 | 29 |
30 | 31 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #\u670D\u52A1\u7AEF\u53E3 2 | server.port=80 3 | server.context-path=/fastplus 4 | server.error.path=/error 5 | server.jetty.acceptors=10 6 | 7 | #freemarker\u914D\u7F6E 8 | # jackson\u65F6\u95F4\u683C\u5F0F\u5316 9 | spring.jackson.time-zone=GMT+8 10 | spring.jackson.date-format=yyyy-MM-dd HH:mm:ss 11 | spring.http.multipart.max-file-size=100MB 12 | spring.http.multipart.max-request-size=100MB 13 | spring.http.multipart.enabled=true 14 | spring.resources.static-locations=classpath:/templates/static/,classpath:/templates/views/ 15 | 16 | spring.freemarker.cache=false 17 | spring.freemarker.checkTemplateLocation=true 18 | spring.freemarker.contentType=text/html 19 | spring.freemarker.suffix=.html 20 | spring.freemarker.templateEncoding=UTF-8 21 | spring.freemarker.templateLoaderPath=classpath:/templates/views/ -------------------------------------------------------------------------------- /spring-boot-12-Swagger2/src/main/java/cn/timebusker/web/LogsController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @RestController 11 | public class LogsController { 12 | 13 | private final static Logger logger = LoggerFactory.getLogger(LogsController.class); 14 | 15 | @RequestMapping(value = { "/", "/" }, method = RequestMethod.GET) 16 | public Long createLogs() { 17 | logger.info("----------------------------------INFO"); 18 | logger.debug("----------------------------------DEBUG"); 19 | logger.error("----------------------------------ERROR"); 20 | return System.currentTimeMillis(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | # 项目contextPath,一般在正式发布版本中,我们不配置 3 | server.context-path=/log4j 4 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 5 | server.error.path=/error 6 | # 服务端口 7 | server.port=80 8 | # session最大超时时间(分钟),默认为30 9 | server.session-timeout=60 10 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 11 | # server.address=192.168.16.11 12 | 13 | ######################################################################################## 14 | #Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式 15 | #{profile}对应你的环境标识 16 | #application-dev.properties:开发环境 17 | #application-test.properties:测试环境 18 | #application-prod.properties:生产环境 19 | # 多环境配置文件激活属性---开发、测试、生产 20 | spring.profiles.active=dev 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/jqgrid/ui.jqgrid-bootstrap-ui.css: -------------------------------------------------------------------------------- 1 | /* 2 | To change this license header, choose License Headers in Project Properties. 3 | To change this template file, choose Tools | Templates 4 | and open the template in the editor. 5 | */ 6 | /* 7 | Created on : Mar 16, 2015, 10:24:01 AM 8 | Author : tony 9 | */ 10 | 11 | .ui-jqgrid tr.jqgrow td { height: 26px;} 12 | .ui-jqgrid .ui-pg-input,.ui-jqgrid .ui-jqgrid-toppager .ui-pg-input { height:20px } 13 | .ui-state-hover 14 | { 15 | border: .15em solid; 16 | border-color: inherit; 17 | 18 | } 19 | .ui-jqdialog .ui-jqdialog-titlebar { 20 | height:29px; 21 | border-color: inherit; 22 | } 23 | 24 | .ui-jqdialog-content input.FormElement { 25 | padding: 0.25em; 26 | } 27 | 28 | .fm-button { 29 | height:30px; 30 | } 31 | #nData, #pData { height:20px; width:18px; } -------------------------------------------------------------------------------- /spring-boot-4-Scheduled/src/main/java/cn/timebusker/springTask/SpringTaskSample.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.springTask; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | import org.springframework.scheduling.annotation.Scheduled; 8 | 9 | /** 10 | * 11 | * spring task简单使用 12 | * 13 | */ 14 | @Configuration 15 | @EnableScheduling 16 | public class SpringTaskSample { 17 | 18 | /** 19 | * 每10秒打印一次:时间取决于运行系统时间 20 | */ 21 | @Scheduled(cron = "0/10 * * * * *") 22 | public void task1() { 23 | System.out.println(getClass()+ "----task1" + new Date()); 24 | } 25 | 26 | /** 27 | * 每1分钟打印一次:时间取决于运行系统时间 28 | */ 29 | @Scheduled(cron = "0 0/1 * * * *") 30 | public void task2() { 31 | System.out.println(getClass()+ "----task2" + new Date()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-boot-13-MyBatis/src/main/java/cn/timebusker/common/DatasourceConfiguration.java: -------------------------------------------------------------------------------- 1 | /*package cn.timebusker.common; 2 | 3 | import javax.sql.DataSource; 4 | 5 | import org.springframework.beans.factory.annotation.Qualifier; 6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; 7 | import org.springframework.boot.context.properties.ConfigurationProperties; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | import org.springframework.context.annotation.Primary; 11 | 12 | @Configuration 13 | public class DatasourceConfiguration { 14 | 15 | @Bean(name = "dataSource") 16 | @Qualifier(value = "dataSource") 17 | @Primary 18 | @ConfigurationProperties(prefix = "c3p0") 19 | public DataSource dataSource() { 20 | return DataSourceBuilder.create().type(com.mchange.v2.c3p0.ComboPooledDataSource.class).build(); 21 | } 22 | }*/ -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/model/one2many/position.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.model.one2many; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.CascadeType; 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import javax.persistence.ManyToMany; 12 | import javax.persistence.Table; 13 | 14 | /** 15 | * 职级表(一个员工可对应着多个职级) 16 | * 17 | * @author Administrator 18 | */ 19 | @Entity 20 | @Table(name = "t_position") 21 | public class position { 22 | 23 | @Id 24 | @GeneratedValue(strategy = GenerationType.IDENTITY) 25 | private long posId; 26 | 27 | @Column(nullable = false, length = 32) 28 | private String posName; 29 | 30 | @ManyToMany(cascade=CascadeType.ALL,mappedBy="position") 31 | private List employee; 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot 会自动扫描classpath下的application.properties文件,如果有就加载文件配置 2 | ######################################################################################## 3 | # 项目contextPath,一般在正式发布版本中,我们不配置 4 | server.context-path=/log4j2 5 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 6 | server.error.path=/error 7 | # 服务端口 8 | server.port=80 9 | # session最大超时时间(分钟),默认为30 10 | server.session-timeout=60 11 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 12 | 13 | 14 | ######################################################################################## 15 | #主配置文件,配置了这个会优先读取里面的属性覆盖主配置文件的属性 16 | spring.profiles.active=dev 17 | 18 | #时间格式化 19 | spring.jackson.date-format=yyyy-MM-dd HH:mm:ss 20 | #时区设置 21 | spring.jackson.time-zone=Asia/Chongqing 22 | 23 | # 应用自定义配置 24 | logging.config=classpath:log4j2-dev.xml 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-AdminClient/src/main/java/cn/timebusker/actuator/MineHealthIndicators.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.actuator; 2 | 3 | import org.springframework.boot.actuate.health.Health; 4 | import org.springframework.boot.actuate.health.HealthIndicator; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * 实现HealthIndicators接口,自定义监控检测项,并将类注入容器中 9 | * 10 | * spring boot 已经实现DiskSpaceHealthIndicator(低磁盘空间检测)、 11 | * DataSourceHealthIndicator(检查是否能从DataSource获取连接)等 12 | */ 13 | @Component 14 | public class MineHealthIndicators implements HealthIndicator { 15 | 16 | private int errorCode = 0; 17 | 18 | @Override 19 | public Health health() { 20 | if (checkDataSource() != 0) { 21 | return Health.down().withDetail("Error Code", errorCode).build(); 22 | } 23 | return Health.up().build(); 24 | } 25 | 26 | private int checkDataSource() { 27 | return errorCode; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-actuator/src/main/java/cn/timebusker/actuator/MineHealthIndicators.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.actuator; 2 | 3 | import org.springframework.boot.actuate.health.Health; 4 | import org.springframework.boot.actuate.health.HealthIndicator; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * 实现HealthIndicators接口,自定义监控检测项,并将类注入容器中 9 | * 10 | * spring boot 已经实现DiskSpaceHealthIndicator(低磁盘空间检测)、 11 | * DataSourceHealthIndicator(检查是否能从DataSource获取连接)等 12 | */ 13 | @Component 14 | public class MineHealthIndicators implements HealthIndicator { 15 | 16 | private int errorCode = 0; 17 | 18 | @Override 19 | public Health health() { 20 | if (checkDataSource() != 0) { 21 | return Health.down().withDetail("Error Code", errorCode).build(); 22 | } 23 | return Health.up().build(); 24 | } 25 | 26 | private int checkDataSource() { 27 | return errorCode; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/java/com/timebusker/exception/ErrorMassage.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.exception; 2 | 3 | public class ErrorMassage { 4 | 5 | public static final Integer OK = 0; 6 | public static final Integer ERROR = 100; 7 | 8 | private Integer code; 9 | private String message; 10 | private String url; 11 | private T data; 12 | 13 | public Integer getCode() { 14 | return code; 15 | } 16 | 17 | public void setCode(Integer code) { 18 | this.code = code; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public void setMessage(String message) { 26 | this.message = message; 27 | } 28 | 29 | public String getUrl() { 30 | return url; 31 | } 32 | 33 | public void setUrl(String url) { 34 | this.url = url; 35 | } 36 | 37 | public T getData() { 38 | return data; 39 | } 40 | 41 | public void setData(T data) { 42 | this.data = data; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /spring-boot-6-GlobalException/src/main/java/cn/timebusker/exception/ErrorMassage.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.exception; 2 | 3 | public class ErrorMassage { 4 | 5 | public static final Integer OK = 0; 6 | public static final Integer ERROR = 100; 7 | 8 | private Integer code; 9 | private String message; 10 | private String url; 11 | private T data; 12 | 13 | public Integer getCode() { 14 | return code; 15 | } 16 | 17 | public void setCode(Integer code) { 18 | this.code = code; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public void setMessage(String message) { 26 | this.message = message; 27 | } 28 | 29 | public String getUrl() { 30 | return url; 31 | } 32 | 33 | public void setUrl(String url) { 34 | this.url = url; 35 | } 36 | 37 | public T getData() { 38 | return data; 39 | } 40 | 41 | public void setData(T data) { 42 | this.data = data; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /spring-boot-2-RESTful/src/main/java/cn/timebusker/entity/DemoInfo.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * @author timebusker 7 | * 8 | * 2017年4月7日 9 | * 10 | * 示例Demo Entity 11 | */ 12 | public class DemoInfo implements Serializable { 13 | 14 | private static final long serialVersionUID = -1727537778826379384L; 15 | 16 | private String id; 17 | 18 | private String name; 19 | 20 | private String description; 21 | 22 | public String getId() { 23 | return id; 24 | } 25 | 26 | public void setId(String id) { 27 | this.id = id; 28 | } 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | public void setName(String name) { 35 | this.name = name; 36 | } 37 | 38 | public String getDescription() { 39 | return description; 40 | } 41 | 42 | public void setDescription(String description) { 43 | this.description = description; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-cache/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cn.timebusker 7 | spring-boot-15-Redis 8 | 2.0.0 9 | 10 | spring-boot-15-Redis-cache 11 | spring-boot-15-Redis-cache 12 | http://maven.apache.org 13 | 14 | UTF-8 15 | 16 | 17 | 18 | 19 | 20 | org.springframework.boot 21 | spring-boot-starter-data-redis 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /spring-boot-23-MongoDB/src/main/java/com/timebusker/entity/UserEntity.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.entity; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | import org.springframework.data.annotation.Id; 6 | import org.springframework.data.mongodb.core.mapping.Document; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | * @DESC:UserEntity 12 | * @author:timebusker 13 | * @date:2018/9/5 14 | */ 15 | 16 | /** 17 | * 指定MongoDB中集合名称,不指定默认使用类名。 18 | */ 19 | @Document(collection = "tb_user") 20 | @Data 21 | @ToString 22 | public class UserEntity implements Serializable { 23 | 24 | // 指定主键 25 | @Id 26 | private Integer id; 27 | private String name; 28 | private Integer age; 29 | 30 | public UserEntity() { 31 | super(); 32 | } 33 | 34 | public UserEntity(Integer id, String name, Integer age) { 35 | this.id = id; 36 | this.name = name; 37 | this.age = age; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-kafka/src/main/java/cn/timebusker/mq/KafkaProducerService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.kafka.core.KafkaTemplate; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * @DESC:KafkaProducer:消息投递 11 | * @author:timebusker 12 | * @date:2018/9/13 13 | */ 14 | @Service 15 | public class KafkaProducerService { 16 | 17 | private final static Logger logger = LoggerFactory.getLogger(KafkaProducerService.class); 18 | 19 | @Autowired 20 | private KafkaTemplate kafkaTemplate; 21 | 22 | public void produce(String topic,String message){ 23 | try { 24 | kafkaTemplate.send(topic,message); 25 | }catch (Exception e){ 26 | logger.info(e.getMessage()); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/java/com/timebusker/service/impl/UserTokenServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.service.impl; 2 | 3 | import com.timebusker.common.R; 4 | import com.timebusker.oauth2.TokenGenerator; 5 | import com.timebusker.service.UserTokenService; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * @DESC:UserTokenServiceImpl 11 | * @author:timebusker 12 | * @date:2018/8/29 13 | */ 14 | public class UserTokenServiceImpl implements UserTokenService { 15 | 16 | // 2小时后过期 17 | private final static int EXPIRE = 1000 * 60 * 60 * 2; 18 | 19 | @Override 20 | public R createToken(String userId) { 21 | // 生成一个token 22 | // String token = TokenGenerator.generateValue(); 23 | String token = userId; 24 | //过期时间 25 | Date expireTime = new Date(new Date().getTime() + EXPIRE); 26 | R r = R.ok().put("token", token).put("expire", expireTime); 27 | return r; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-AdminClient/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/client 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 11 | 12 | 13 | # 新增应用配置信息,便于输出展示 14 | info.app.name=actuator 15 | info.app.version=2.0.0 16 | info.build.artifactId=@project.artifactId@ 17 | info.build.version=@project.version@ 18 | 19 | # endpoints 20 | endpoints.beans.id=springbeans 21 | endpoints.beans.sensitive=false 22 | # 需要使用POST发起请求 23 | endpoints.shutdown.enabled=true 24 | endpoints.health.sensitive=false 25 | endpoints.health.time-to-live=1000 26 | 27 | spring.application.name=@project.artifactId@ 28 | # 服务注册链接与server端首页 地址一致 29 | spring.boot.admin.url=http://localhost:8080/admin -------------------------------------------------------------------------------- /spring-boot-23-MongoDB/src/main/java/com/timebusker/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.repository; 2 | 3 | import com.timebusker.entity.UserEntity; 4 | import org.springframework.data.mongodb.repository.MongoRepository; 5 | 6 | /** 7 | * @DESC:UserRepository 8 | * @author:timebusker 9 | * @date:2018/9/5 10 | */ 11 | public interface UserRepository extends MongoRepository { 12 | 13 | /* 14 | * MongoRepository与HibernateTemplete相似,提供一些基本的方法, 15 | * 实现的方法有findone(),save(),count(),findAll(),findAll(Pageable),delete(),deleteAll()..etc 16 | * 要使用Repository的功能,先继承MongoRepository接口 17 | * 其中T为仓库保存的bean类,TD为该bean的唯一标识的类型,一般为ObjectId。 18 | * 之后在spring-boot中注入该接口就可以使用,无需实现里面的方法,spring会根据定义的规则自动生成。 19 | * starter-data-mongodb 支持方法命名约定查询 findBy{User的name属性名}, 20 | * findBy后面的属性名一定要在User类中存在,否则会报错 21 | */ 22 | 23 | UserEntity findById(Integer key); 24 | 25 | void deleteById(Integer key); 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-1-QuickStart/src/main/java/cn/timebusker/web/ConfController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import cn.timebusker.conf.DefinitionConfig; 9 | import cn.timebusker.conf.DubboConfig; 10 | 11 | @RestController 12 | public class ConfController { 13 | 14 | @Resource 15 | DefinitionConfig conf; 16 | 17 | @Resource 18 | DubboConfig dubbo; 19 | 20 | /** 21 | * 测试自定义配置属性加载 22 | * @return 23 | */ 24 | @RequestMapping("/conf") 25 | public String getConfig() { 26 | System.out.println(conf.toString()); 27 | return conf.toString(); 28 | } 29 | 30 | /** 31 | * 测试自定义的额外文件的配置信息 32 | * @return 33 | */ 34 | @RequestMapping("/dubbo") 35 | public String dubboConfig() { 36 | System.out.println(dubbo.toString()); 37 | return dubbo.toString(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/model/one2many/detailInfo.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.model.one2many; 2 | 3 | import javax.persistence.CascadeType; 4 | import javax.persistence.Column; 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.OneToOne; 11 | import javax.persistence.Table; 12 | 13 | /** 14 | * 员工详细信息表(一个员工一条详细) 15 | * 16 | * @author Administrator 17 | */ 18 | @Entity 19 | @Table(name = "t_detailInfo") 20 | public class detailInfo { 21 | 22 | @Id 23 | @GeneratedValue(strategy = GenerationType.IDENTITY) 24 | private long detId; 25 | 26 | @Column(nullable = false, length = 32) 27 | private String detName; 28 | 29 | @OneToOne(cascade = CascadeType.ALL, optional = false) 30 | @JoinColumn(name = "empId") 31 | private employee employee; 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-boot-14-JdbcTemplate/src/main/java/cn/timebusker/web/LogsController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import cn.timebusker.util.LoggingUtil; 11 | 12 | 13 | @RestController 14 | public class LogsController { 15 | 16 | private final static Logger logger = LoggerFactory.getLogger(LogsController.class); 17 | 18 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 19 | public Long createLogs() { 20 | logger.info("----------------------------------INFO"); 21 | logger.debug("----------------------------------DEBUG"); 22 | logger.error("----------------------------------ERROR"); 23 | LoggingUtil.creatLogging(); 24 | return System.currentTimeMillis(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-16-Transcation/src/main/java/cn/timebusker/web/LogsController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import cn.timebusker.util.LoggingUtil; 11 | 12 | 13 | @RestController 14 | public class LogsController { 15 | 16 | private final static Logger logger = LoggerFactory.getLogger(LogsController.class); 17 | 18 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 19 | public Long createLogs() { 20 | logger.info("----------------------------------INFO"); 21 | logger.debug("----------------------------------DEBUG"); 22 | logger.error("----------------------------------ERROR"); 23 | LoggingUtil.creatLogging(); 24 | return System.currentTimeMillis(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/src/main/java/com/timebusker/method/SortMethod.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.method; 2 | 3 | import freemarker.template.*; 4 | 5 | import java.math.BigDecimal; 6 | import java.util.*; 7 | 8 | /** 9 | * @DESC:freeMethod 10 | * @author:timebusker 11 | * @date:2018/6/24 12 | */ 13 | public class SortMethod implements TemplateMethodModelEx { 14 | @Override 15 | public Object exec(List arguments) throws TemplateModelException { 16 | //获取第一个参数 17 | SimpleSequence arg0 = (SimpleSequence) arguments.get(0); 18 | List list = arg0.toList(); 19 | //Comparator接口 20 | Collections.sort(list, new Comparator() { 21 | 22 | @Override 23 | public int compare(BigDecimal o1, BigDecimal o2) { 24 | 25 | return o1.intValue() - o2.intValue(); //升序 26 | } 27 | 28 | }); 29 | return list; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j/src/main/java/cn/timebusker/web/LogsController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import cn.timebusker.util.LoggingUtil; 11 | 12 | @RestController 13 | public class LogsController { 14 | 15 | private static final Logger logger = LoggerFactory.getLogger(LogsController.class); 16 | 17 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 18 | public Long createLogs() { 19 | logger.info("----------------------------------INFO"); 20 | logger.debug("----------------------------------DEBUG"); 21 | logger.error("----------------------------------ERROR"); 22 | LoggingUtil.creatLogging(); 23 | return System.currentTimeMillis(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/src/main/java/com/timebusker/web/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.web; 2 | 3 | import com.timebusker.entity.UserInfo; 4 | import com.timebusker.service.UserInfoService; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.util.StringUtils; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | 12 | import java.util.*; 13 | 14 | /** 15 | * @DESC:IndexController 16 | * @author:timebusker 17 | * @date:2018/6/23 18 | */ 19 | @Controller 20 | public class IndexController { 21 | 22 | private final static Logger LOG = LoggerFactory.getLogger(IndexController.class); 23 | 24 | @GetMapping({"", "/", "index", "/home"}) 25 | public String index() { 26 | LOG.info("This is the First Page."); 27 | return "index"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Log4j2/src/main/java/cn/timebusker/web/LogsController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import cn.timebusker.util.LoggingUtil; 11 | 12 | 13 | @RestController 14 | public class LogsController { 15 | 16 | private static final Logger logger = LoggerFactory.getLogger(LogsController.class); 17 | 18 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 19 | public Long createLogs() { 20 | logger.info("----------------------------------INFO"); 21 | logger.debug("----------------------------------DEBUG"); 22 | logger.error("----------------------------------ERROR"); 23 | LoggingUtil.creatLogging(); 24 | return System.currentTimeMillis(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-3-logs/spring-boot-3-logs-Logback/src/main/java/cn/timebusker/web/LogsController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import cn.timebusker.util.LoggingUtil; 11 | 12 | 13 | @RestController 14 | public class LogsController { 15 | 16 | private final static Logger logger = LoggerFactory.getLogger(LogsController.class); 17 | 18 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 19 | public Long createLogs() { 20 | logger.info("----------------------------------INFO"); 21 | logger.debug("----------------------------------DEBUG"); 22 | logger.error("----------------------------------ERROR"); 23 | LoggingUtil.creatLogging(); 24 | return System.currentTimeMillis(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/java/cn/timebusker/mq/queue/ActiveMQQueueProducer.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.queue; 2 | 3 | import java.util.Date; 4 | 5 | import javax.jms.Queue; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.jms.core.JmsMessagingTemplate; 9 | import org.springframework.scheduling.annotation.EnableScheduling; 10 | import org.springframework.scheduling.annotation.Scheduled; 11 | import org.springframework.stereotype.Component; 12 | 13 | @Component 14 | @EnableScheduling 15 | public class ActiveMQQueueProducer { 16 | 17 | /** 18 | * 使用JmsMessagingTemplate 进行消息的操作 19 | */ 20 | @Autowired 21 | private JmsMessagingTemplate jmsMessagingTemplate; 22 | 23 | @Autowired 24 | private Queue mineQueue; 25 | 26 | // 每3s执行1次 27 | @Scheduled(fixedDelay = 7000) 28 | public void send() { 29 | this.jmsMessagingTemplate.convertAndSend(this.mineQueue, "this is mineQueue activeMQ!\t" + new Date()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-activemq/src/main/java/cn/timebusker/mq/topic/ActiveMQTopicProducer.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.topic; 2 | 3 | import java.util.Date; 4 | 5 | import javax.jms.Topic; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.jms.core.JmsMessagingTemplate; 9 | import org.springframework.scheduling.annotation.EnableScheduling; 10 | import org.springframework.scheduling.annotation.Scheduled; 11 | import org.springframework.stereotype.Component; 12 | 13 | @Component 14 | @EnableScheduling 15 | public class ActiveMQTopicProducer { 16 | 17 | /** 18 | * 使用JmsMessagingTemplate 进行消息的操作 19 | */ 20 | @Autowired 21 | private JmsMessagingTemplate jmsMessagingTemplate; 22 | 23 | @Autowired 24 | private Topic mineTopic; 25 | 26 | // 每3s执行1次 27 | @Scheduled(fixedDelay = 5000) 28 | public void send() { 29 | this.jmsMessagingTemplate.convertAndSend(this.mineTopic, "this is mineTopic activeMQ!\t" + new Date()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-AdminServer/README.md: -------------------------------------------------------------------------------- 1 | ---- 2 | ## [使用spring-boot-admin应用监控服务端](https://github.com/timebusker/spring-boot/tree/master/spring-boot-17-monitor/spring-boot-17-monitor-AdminServer/) 3 | 4 | ### 项目构建 5 | + 新建简单的 spring boot web项目 6 | 7 | + 在pom文件中添加spring-boot-starter-admin依赖 8 | ```xml 9 | 10 | de.codecentric 11 | spring-boot-admin-server 12 | 1.5.0 13 | 14 | 15 | de.codecentric 16 | spring-boot-admin-server-ui 17 | 1.5.0 18 | 19 | ``` 20 | 21 | + 在主类上添加 @EnableAdminServer 注解 22 | 23 | + 在application.properties文件中添加如下配置 24 | ``` 25 | server.port = 8080 26 | spring.application.name=Spring Boot Admin Web 27 | spring.boot.admin.url=http://localhost:${server.port} 28 | spring.jackson.serialization.indent_output=true 29 | endpoints.health.sensitive=false 30 | ``` 31 | 32 | ---- -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-AdminClient/src/main/java/cn/timebusker/web/LogsController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import cn.timebusker.util.LoggingUtil; 11 | 12 | 13 | @RestController 14 | public class LogsController { 15 | 16 | private final static Logger logger = LoggerFactory.getLogger(LogsController.class); 17 | 18 | @RequestMapping(value = { "/" }, method = RequestMethod.GET) 19 | public String createLogs() { 20 | logger.info("----------------------------------INFO"); 21 | logger.debug("----------------------------------DEBUG"); 22 | logger.error("----------------------------------ERROR"); 23 | LoggingUtil.creatLogging(); 24 | return "Hello,this is spring-boot-starter-actuator"; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-actuator/src/main/java/cn/timebusker/web/LogsController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import cn.timebusker.util.LoggingUtil; 11 | 12 | 13 | @RestController 14 | public class LogsController { 15 | 16 | private final static Logger logger = LoggerFactory.getLogger(LogsController.class); 17 | 18 | @RequestMapping(value = { "/**", "/" }, method = RequestMethod.GET) 19 | public String createLogs() { 20 | logger.info("----------------------------------INFO"); 21 | logger.debug("----------------------------------DEBUG"); 22 | logger.error("----------------------------------ERROR"); 23 | LoggingUtil.creatLogging(); 24 | return "Hello,this is spring-boot-starter-actuator"; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/web/DownloadData.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import java.util.Date; 4 | 5 | import com.alibaba.excel.annotation.ExcelProperty; 6 | 7 | /** 8 | * 基础数据类 9 | * 10 | * @author Jiaju Zhuang 11 | **/ 12 | public class DownloadData { 13 | @ExcelProperty("字符串标题") 14 | private String string; 15 | @ExcelProperty("日期标题") 16 | private Date date; 17 | @ExcelProperty("数字标题") 18 | private Double doubleData; 19 | 20 | public String getString() { 21 | return string; 22 | } 23 | 24 | public void setString(String string) { 25 | this.string = string; 26 | } 27 | 28 | public Date getDate() { 29 | return date; 30 | } 31 | 32 | public void setDate(Date date) { 33 | this.date = date; 34 | } 35 | 36 | public Double getDoubleData() { 37 | return doubleData; 38 | } 39 | 40 | public void setDoubleData(Double doubleData) { 41 | this.doubleData = doubleData; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-sample/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | # server.context-path=/mq 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=80 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 11 | 12 | # REDIS (RedisProperties) 13 | #其中spring.redis.database的配置通常使用0即可, 14 | #Redis在配置的时候可以设置数据库数量,默认为16,可以理解为数据库的schema 15 | # Redis数据库索引(默认为0) 16 | spring.redis.database=0 17 | # Redis服务器地址 18 | spring.redis.host=127.0.0.1 19 | # Redis服务器连接端口 20 | spring.redis.port=6379 21 | # Redis服务器连接密码(默认为空) 22 | spring.redis.password= 23 | #123456789 24 | # 连接池最大连接数(使用负值表示没有限制) 25 | spring.redis.pool.max-active=8 26 | # 连接池最大阻塞等待时间(使用负值表示没有限制) 27 | spring.redis.pool.max-wait=-1 28 | # 连接池中的最大空闲连接 29 | spring.redis.pool.max-idle=8 30 | # 连接池中的最小空闲连接 31 | spring.redis.pool.min-idle=0 32 | # 连接超时时间(毫秒) 33 | spring.redis.timeout=0 -------------------------------------------------------------------------------- /spring-boot-24-WebSocket/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | spring-boot 7 | cn.timebusker 8 | 2.0.0 9 | 10 | 4.0.0 11 | 12 | spring-boot-24-WebSocket 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter-websocket 18 | 19 | 20 | org.springframework.boot 21 | spring-boot-starter-test 22 | test 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /spring-boot-19-Definition-Starter/spring-boot-19-Definition-Starter-Test/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Spring Boot \u4F1A\u81EA\u52A8\u626B\u63CFclasspath\u4E0B\u7684application.properties\u6587\u4EF6\uFF0C\u5982\u679C\u6709\u5C31\u52A0\u8F7D\u6587\u4EF6\u914D\u7F6E 2 | 3 | # \u8BBE\u7F6E\u7B97\u672F\u8FD0\u7B97\u7C7B\u7684\u8BA1\u7B97\u7CBE\u5EA6 4 | calculate.enabled = true 5 | calculate.scale = 1 6 | 7 | ######################################################################################## 8 | #Spring Boot\u4E2D\u591A\u73AF\u5883\u914D\u7F6E\u6587\u4EF6\u540D\u9700\u8981\u6EE1\u8DB3application-{profile}.properties\u7684\u683C\u5F0F 9 | #{profile}\u5BF9\u5E94\u4F60\u7684\u73AF\u5883\u6807\u8BC6 10 | #application-dev.properties\uFF1A\u5F00\u53D1\u73AF\u5883 11 | #application-test.properties\uFF1A\u6D4B\u8BD5\u73AF\u5883 12 | #application-prod.properties\uFF1A\u751F\u4EA7\u73AF\u5883 13 | # \u591A\u73AF\u5883\u914D\u7F6E\u6587\u4EF6\u6FC0\u6D3B\u5C5E\u6027---\u5F00\u53D1\u3001\u6D4B\u8BD5\u3001\u751F\u4EA7 14 | spring.profiles.active=dev -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-AdminServer/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # 项目contextPath,一般在正式发布版本中,我们不配置 2 | server.context-path=/admin 3 | # 错误页,指定发生错误时,跳转的URL。请查看BasicErrorController源码便知 4 | server.error.path=/error 5 | # 服务端口 6 | server.port=8080 7 | # session最大超时时间(分钟),默认为30 8 | server.session-timeout=60 9 | # 该服务绑定IP地址,启动服务器时如本机不是该IP地址则抛出异常启动失败,只有特殊需求的情况下才配置 10 | # server.address=192.168.16.11 11 | 12 | 13 | # 新增应用配置信息,便于输出展示 14 | info.app.name=actuator 15 | info.app.version=2.0.0 16 | info.build.artifactId=@project.artifactId@ 17 | info.build.version=@project.version@ 18 | 19 | # endpoints 20 | endpoints.beans.id=springbeans 21 | endpoints.beans.sensitive=false 22 | # 需要使用POST发起请求 23 | endpoints.shutdown.enabled=true 24 | endpoints.health.sensitive=false 25 | endpoints.health.time-to-live=1000 26 | 27 | # spring boot admin config 28 | spring.application.name=Spring Boot Admin Web 29 | spring.boot.admin.url=http://localhost:${server.port}/${server.context-path} 30 | spring.jackson.serialization.indent_output=true 31 | -------------------------------------------------------------------------------- /spring-boot-9-JavaMailSender/README.md: -------------------------------------------------------------------------------- 1 | ---- 2 | ## [spring-boot-9-JavaMailSender 实现简单的邮件发送](https://github.com/timebusker/spring-boot/tree/master/spring-boot-9-JavaMailSender/) 3 | 4 | - #### 项目阐述 5 | 相信使用过Spring的众多开发者都知道Spring提供了非常好用的JavaMailSender接口实现邮件发送。 6 | 在Spring Boot的Starter模块中也为此提供了自动化配置。下面通过实例看看如何在Spring Boot中 7 | 使用JavaMailSender发送邮件。 8 | 9 | - #### 快速入门 10 | 11 | + 在Spring Boot的工程中的pom.xml中引入spring-boot-starter-mail依赖: 12 | ``` 13 | 14 | org.springframework.boot 15 | spring-boot-starter-mail 16 | 17 | ``` 18 | 19 | + 以QQ邮箱为例,配置发送邮件示例: 20 | ``` 21 | spring.mail.host=smtp.qq.com 22 | spring.mail.username=用户名 23 | spring.mail.password=密码 24 | spring.mail.properties.mail.smtp.auth=true 25 | spring.mail.properties.mail.smtp.starttls.enable=true 26 | spring.mail.properties.mail.smtp.starttls.required=true 27 | ``` 28 | 29 | - #### 进阶使用 30 | 31 | + 发送附件 32 | 33 | 34 | + 嵌入静态资源 35 | 36 | 37 | + 模板邮件 38 | 39 | 40 | ---- -------------------------------------------------------------------------------- /spring-boot-10-SpringData/src/main/java/cn/timebusker/model/one2many/department.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.model.one2many; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.CascadeType; 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import javax.persistence.JoinColumn; 12 | import javax.persistence.ManyToOne; 13 | import javax.persistence.OneToMany; 14 | import javax.persistence.Table; 15 | 16 | /** 17 | * 部门表 18 | * 19 | * @author Administrator 20 | */ 21 | @Entity 22 | @Table(name = "t_department") 23 | public class department { 24 | 25 | @Id 26 | @GeneratedValue(strategy = GenerationType.IDENTITY) 27 | private long depId; 28 | 29 | @Column(nullable = false, length = 32) 30 | private String depName; 31 | 32 | @ManyToOne(cascade=CascadeType.ALL) 33 | @JoinColumn(name = "comId") 34 | private company company; 35 | 36 | @OneToMany(mappedBy="department") 37 | private List employee; 38 | } 39 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-kafka/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %date [%thread] %-5level %logger{80} || %msg%n 8 | 9 | 10 | 11 | /logs/timebusker.log 12 | 13 | /logs/timebusker-%d{yyyy-MM-dd}.log 14 | 30 15 | 16 | 17 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 18 | 19 | false 20 | false 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/java/cn/timebusker/mq/topic/TopicRabbitMQConsumer.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.topic; 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 | import cn.timebusker.TopicRabbitConfiguration; 8 | 9 | @Component 10 | public class TopicRabbitMQConsumer { 11 | 12 | /** 13 | * 监听方法传入的参数需要和消息生产者的一致 14 | */ 15 | @RabbitHandler 16 | @RabbitListener(queues = TopicRabbitConfiguration.TOPIC_ROUTING_KEY_YUJIAOJIAO) 17 | public void processt(String context) { 18 | System.out.println("Y\t"+context); 19 | } 20 | 21 | @RabbitHandler 22 | @RabbitListener(queues = TopicRabbitConfiguration.TOPIC_ROUTING_KEY_MINE) 23 | public void processy(String context) { 24 | System.out.println("M\t"+context.toString()); 25 | } 26 | 27 | @RabbitHandler 28 | @RabbitListener(queues = TopicRabbitConfiguration.TOPIC_ROUTING_KEY_TIMEBUSKER) 29 | public void processo(String context) { 30 | System.out.println("T\t"+context); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/java/cn/timebusker/mq/fanout/FanoutRabbitMQConsumer.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.fanout; 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 | import cn.timebusker.FanoutRabbitConfiguration; 8 | 9 | @Component 10 | public class FanoutRabbitMQConsumer { 11 | 12 | /** 13 | * 监听方法传入的参数需要和消息生产者的一致 14 | */ 15 | @RabbitHandler 16 | @RabbitListener(queues = FanoutRabbitConfiguration.FANOUT_ROUTING_KEY_YUJIAOJIAO) 17 | public void processt(String context) { 18 | System.out.println("Y\t"+context); 19 | } 20 | 21 | @RabbitHandler 22 | @RabbitListener(queues = FanoutRabbitConfiguration.FANOUT_ROUTING_KEY_MINE) 23 | public void processy(String context) { 24 | System.out.println("M\t"+context.toString()); 25 | } 26 | 27 | @RabbitHandler 28 | @RabbitListener(queues = FanoutRabbitConfiguration.FANOUT_ROUTING_KEY_TIMEBUSKER) 29 | public void processo(String context) { 30 | System.out.println("T\t"+context); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/java/cn/timebusker/mq/sample/MessageConsumer.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.sample; 2 | 3 | import com.rabbitmq.client.*; 4 | 5 | import java.io.IOException; 6 | 7 | public class MessageConsumer { 8 | 9 | private final static String ROUTING_KEY = "SAMPLE_RABBITMQ"; 10 | 11 | public static void main(String[] argv) throws Exception { 12 | ConnectionFactory factory = new ConnectionFactory(); 13 | factory.setHost("127.0.0.1"); 14 | Connection connection = factory.newConnection(); 15 | Channel channel = connection.createChannel(); 16 | channel.queueDeclare(ROUTING_KEY, false, false, false, null); 17 | System.out.println("C [*] Waiting for messages. To exit press CTRL+C"); 18 | Consumer consumer = new DefaultConsumer(channel) { 19 | @Override 20 | public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { 21 | String message = new String(body, "UTF-8"); 22 | System.out.println("Consumer [x] Received '" + message + "'"); 23 | } 24 | }; 25 | channel.basicConsume(ROUTING_KEY, true, consumer); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-boot-1-QuickStart/src/main/java/cn/timebusker/web/HelloController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * 快速启动 spring-boot 8 | */ 9 | @RestController 10 | public class HelloController { 11 | 12 | /** 13 | * The class is flagged as a @RestController,meaning it’s ready for use by Spring MVC to handle web requests. 14 | * @RequestMapping maps / to the index() method. When invoked(调用) from a browser or using curl on the command line, 15 | * the method returns pure(单纯的) text. 16 | * 17 | * That’s because @RestController combines(结合) @Controller and @ResponseBody, 18 | * two annotations that results in web requests returning data rather than a view. 19 | * 20 | * 那是因为@RestController联合了@Controller and @ResponseBody两个注解导致返回的是数据而不是视图 21 | */ 22 | 23 | /** 24 | * Hello spring-boot-1-QuickStart!!! 25 | * @return 26 | */ 27 | @RequestMapping("/hello") 28 | public String hello() { 29 | System.out.println("Hello Spring-Boot"); 30 | return "Hello spring-boot-1-QuickStart!!!"; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | spring-boot 7 | cn.timebusker 8 | 2.0.0 9 | 10 | 4.0.0 11 | 12 | spring-boot-20-Freemarker 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter-freemarker 18 | 19 | 20 | org.springframework.boot 21 | spring-boot-starter-web 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /spring-boot-8-AOP/src/main/java/cn/timebusker/aop/ServiceHandlerAop.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.aop; 2 | 3 | import org.aspectj.lang.annotation.Aspect; 4 | import org.aspectj.lang.annotation.Before; 5 | import org.aspectj.lang.annotation.Pointcut; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.core.annotation.Order; 9 | import org.springframework.stereotype.Component; 10 | 11 | import cn.timebusker.utils.DateUtil; 12 | 13 | /** 14 | * 面向切面编程 主要功能:日志记录、性能统计、安全控制、事务处理、异常处理等等 15 | */ 16 | @Component 17 | @Aspect 18 | @Order(10) 19 | public class ServiceHandlerAop { 20 | 21 | private final static Logger logger = LoggerFactory.getLogger(ServiceHandlerAop.class); 22 | 23 | /** 24 | * AOP切面中的同步问题 25 | */ 26 | ThreadLocal startTime = new ThreadLocal<>(); 27 | 28 | /** 29 | * 切入点:匹配连接点的断言 30 | */ 31 | @Pointcut("execution(public * *..service..*(..))") 32 | public void service() { 33 | } 34 | 35 | /** 36 | * 前置通知:在连接点执行前的通知,但不能阻止连接点前的执行(除非它抛出一个异常) 37 | */ 38 | @Before("service()") 39 | public void beforeAdvice() { 40 | logger.info("ServiceHandlerAop.beforeAdvice...time:" + DateUtil.now()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/java/com/timebusker/entity/OssEntity.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.entity; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | * @DESC:OssEntity:OSS对象存储文件实体 7 | * @author:timebusker 8 | * @date:2018/8/30 9 | */ 10 | public class OssEntity { 11 | 12 | private String id; 13 | //URL地址 14 | private String url; 15 | //创建时间 16 | private Date createDate; 17 | 18 | /** 19 | * 设置: 20 | */ 21 | public void setId(String id) { 22 | this.id = id; 23 | } 24 | 25 | /** 26 | * 获取: 27 | */ 28 | public String getId() { 29 | return id; 30 | } 31 | 32 | /** 33 | * 设置:URL地址 34 | */ 35 | public void setUrl(String url) { 36 | this.url = url; 37 | } 38 | 39 | /** 40 | * 获取:URL地址 41 | */ 42 | public String getUrl() { 43 | return url; 44 | } 45 | 46 | /** 47 | * 设置:创建时间 48 | */ 49 | public void setCreateDate(Date createDate) { 50 | this.createDate = createDate; 51 | } 52 | 53 | /** 54 | * 获取:创建时间 55 | */ 56 | public Date getCreateDate() { 57 | return createDate; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-kafka/src/main/java/cn/timebusker/task/KafkaTaskService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.task; 2 | 3 | import cn.timebusker.mq.KafkaProducerService; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | import org.springframework.scheduling.annotation.Scheduled; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.text.SimpleDateFormat; 11 | import java.util.Date; 12 | 13 | /** 14 | * @DESC:KafkaTaskService 15 | * @author:timebusker 16 | * @date:2018/9/13 17 | */ 18 | @Service 19 | @Configuration 20 | @EnableScheduling 21 | public class KafkaTaskService { 22 | 23 | @Autowired 24 | private KafkaProducerService service; 25 | 26 | private final static String TOPIC = "test"; 27 | 28 | @Scheduled(fixedDelay = 1000) 29 | public void testKafka() { 30 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS"); 31 | String date = sdf.format(new Date()); 32 | String obj = "当前测试消息时间是:\t" + date; 33 | service.produce(TOPIC, obj); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /spring-boot-15-Redis/spring-boot-15-Redis-cache/src/main/java/cn/timebusker/service/UserService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service; 2 | 3 | import cn.timebusker.mapper.UserMapper; 4 | import cn.timebusker.model.UserEntity; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.cache.annotation.*; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @DESC:UserService:用户操作业务类 13 | * @author:timebusker 14 | * @date:2019/4/1 15 | */ 16 | @Service 17 | @CacheConfig(cacheNames = "users") 18 | public class UserService { 19 | 20 | @Autowired 21 | private UserMapper mapper; 22 | 23 | @Cacheable() 24 | public List getList() { 25 | return mapper.queryUsers(); 26 | } 27 | 28 | @CachePut() 29 | public List addUser(UserEntity user) { 30 | return mapper.addUser(user); 31 | } 32 | 33 | @CacheEvict(allEntries = true) 34 | public List deleteUser(UserEntity user) { 35 | return mapper.deleteUsers(user); 36 | } 37 | 38 | @CachePut() 39 | public List updateUser(UserEntity user) { 40 | return mapper.updateUser(user); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-boot-11-SpringSecurity/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.context-path=/ 2 | server.port=80 3 | 4 | # Thymeleaf \u7F16\u7801 5 | # spring.thymeleaf.encoding=UTF-8 6 | # \u70ED\u90E8\u7F72\u9759\u6001\u6587\u4EF6 7 | # spring.thymeleaf.cache=false 8 | # \u4F7F\u7528HTML5\u6807\u51C6 9 | # spring.thymeleaf.mode=HTML5 10 | # \u4F7F\u7528 H2 \u63A7\u5236\u53F0 11 | # spring.h2.console.enabled=true 12 | # DataSource 13 | spring.datasource.url=jdbc:mysql://mysql.db.server/test?useSSL=false&serverTimezone=UTC&characterEncoding=utf-8 14 | spring.datasource.username=root 15 | spring.datasource.password=timebusker 16 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 17 | 18 | #\u5F00\u542F\u9A7C\u5CF0\u547D\u540D\u8F6C\u6362 19 | mybatis.configuration.map-underscore-to-camel-case=true 20 | 21 | spring.thymeleaf.prefix=classpath:templates/ 22 | spring.thymeleaf.suffix=.html 23 | spring.thymeleaf.mode=LEGACYHTML5 24 | spring.thymeleaf.encoding=UTF-8 25 | spring.thymeleaf.content-type=text/html 26 | spring.thymeleaf.cache=false 27 | 28 | 29 | # JPA 30 | # \u6570\u636E\u65B9\u8A00\u914D\u7F6E 31 | spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect 32 | spring.jpa.show-sql=true 33 | spring.jpa.hibernate.ddl-auto=update 34 | -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/src/main/java/com/timebusker/web/UserController.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.web; 2 | 3 | import com.timebusker.entity.UserInfo; 4 | import com.timebusker.service.UserInfoService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.servlet.ModelAndView; 9 | 10 | import java.util.*; 11 | 12 | /** 13 | * @DESC:UserController 14 | * @author:timebusker 15 | * @date:2018/7/5 16 | */ 17 | 18 | @Controller 19 | public class UserController { 20 | 21 | @Autowired 22 | UserInfoService service; 23 | 24 | @RequestMapping("/entity") 25 | public ModelAndView index() { 26 | ModelAndView mv = new ModelAndView(); 27 | int sum = 12 + 13; 28 | UserInfo u = service.getUser(); 29 | Map hu = service.allUser(); 30 | Collection cu = service.allUser().values(); 31 | List lu = new ArrayList<>(cu); 32 | mv.addObject("sum", sum); 33 | mv.addObject("u", u); 34 | mv.addObject("hu", hu); 35 | mv.addObject("lu", lu); 36 | return mv; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spring-boot-23-MongoDB/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | spring-boot 7 | cn.timebusker 8 | 2.0.0 9 | 10 | 4.0.0 11 | 12 | spring-boot-23-MongoDB 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter-data-mongodb 18 | 19 | 20 | org.springframework.boot 21 | spring-boot-starter-test 22 | 23 | 24 | 25 | org.projectlombok 26 | lombok 27 | provided 28 | 29 | 30 | -------------------------------------------------------------------------------- /spring-boot-11-SpringSecurity/src/main/java/cn/timebusker/web/HomeController.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.web; 2 | 3 | import cn.timebusker.model.UserEntity; 4 | import cn.timebusker.service.UserService; 5 | import lombok.AllArgsConstructor; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | 11 | @Controller 12 | @AllArgsConstructor 13 | public class HomeController { 14 | 15 | @Autowired 16 | private UserService userService; 17 | 18 | @GetMapping({"/", "/index", "/home"}) 19 | public String root() { 20 | return "index"; 21 | } 22 | 23 | @GetMapping("/login") 24 | public String login() { 25 | return "login"; 26 | } 27 | 28 | @GetMapping("/register") 29 | public String register() { 30 | return "register"; 31 | } 32 | 33 | @PostMapping("/register") 34 | public String doRegister(UserEntity userEntity) { 35 | // 此处省略校验逻辑 36 | if (userService.insert(userEntity)) 37 | return "redirect:register?success"; 38 | return "redirect:register?error"; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/java/com/timebusker/utils/SQLFilter.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.utils; 2 | 3 | import com.timebusker.exception.CommonException; 4 | import org.apache.commons.lang.StringUtils; 5 | 6 | /** 7 | * SQL过滤 8 | * @author chenshun 9 | * @email sunlightcs@gmail.com 10 | * @date 2017-04-01 16:16 11 | */ 12 | public class SQLFilter { 13 | 14 | /** 15 | * SQL注入过滤 16 | * @param str 待验证的字符串 17 | */ 18 | public static String sqlInject(String str){ 19 | if(StringUtils.isBlank(str)){ 20 | return null; 21 | } 22 | //去掉'|"|;|\字符 23 | str = StringUtils.replace(str, "'", ""); 24 | str = StringUtils.replace(str, "\"", ""); 25 | str = StringUtils.replace(str, ";", ""); 26 | str = StringUtils.replace(str, "\\", ""); 27 | //转换成小写 28 | str = str.toLowerCase(); 29 | //非法字符 30 | String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alert", "drop"}; 31 | //判断是否包含非法字符 32 | for(String keyword : keywords){ 33 | if(str.indexOf(keyword) != -1){ 34 | throw new CommonException("包含非法字符"); 35 | } 36 | } 37 | return str; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-boot-22-FarstPlus/src/main/resources/templates/static/plugins/treegrid/jquery.treegrid.css: -------------------------------------------------------------------------------- 1 | .treegrid-indent {width:16px; height: 16px; display: inline-block; position: relative;} 2 | 3 | .treegrid-expander {width:16px; height: 16px; display: inline-block; position: relative; cursor: pointer;} 4 | 5 | .treegrid-expander-expanded{background-image: url(img/collapse.png); } 6 | .treegrid-expander-collapsed{background-image: url(img/expand.png);} 7 | .treegrid-selected{background: #f5f5f5 !important;} 8 | .treegrid-table{border:0 !important;margin-bottom:0} 9 | .treegrid-table tbody {display:block;height:auto;overflow-y:auto;} 10 | .treegrid-table thead, .treegrid-table tbody tr {display:table;width:100%;table-layout:fixed;} 11 | .treegrid-thead th{line-height:40px;border: 0 !important;background:#fff !important;border-radius: 4px;border-left:1px solid #e7eaec !important;border-bottom:2px solid #e7eaec !important;text-align: center;} 12 | .treegrid-thead tr :first-child{border-left:0 !important} 13 | .treegrid-tbody td{border: 0 !important;border-left:1px solid #e7eaec !important;border-bottom:1px solid #e7eaec !important;overflow: hidden; 14 | white-space: nowrap; 15 | text-overflow: ellipsis;} 16 | .treegrid-tbody tr :first-child{border-left:0 !important} 17 | 18 | -------------------------------------------------------------------------------- /spring-boot-17-monitor/spring-boot-17-monitor-actuator/src/main/java/cn/timebusker/metrics/MineMetrics.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.metrics; 2 | 3 | import java.util.Collection; 4 | import java.util.LinkedList; 5 | import java.util.List; 6 | 7 | import org.springframework.boot.actuate.endpoint.PublicMetrics; 8 | import org.springframework.boot.actuate.metrics.Metric; 9 | import org.springframework.stereotype.Component; 10 | 11 | /** 12 | * 实现PublicMetrics接口,做自定义开发 13 | * 14 | * @author Administrator 15 | * 16 | */ 17 | @Component 18 | public class MineMetrics implements PublicMetrics { 19 | 20 | /** 21 | * 手动注入CrudRepository 22 | */ 23 | // private Collection repositories; 24 | // 25 | // public DbCountMetrics(Collection repositories) { 26 | // this.repositories = repositories; 27 | // } 28 | 29 | @SuppressWarnings({ "unchecked", "rawtypes" }) 30 | @Override 31 | public Collection> metrics() { 32 | List> metrics = new LinkedList<>(); 33 | for (int i=0;i<10;i++) { 34 | String name = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; 35 | String metricName = "counter.datasource." + name; 36 | metrics.add(new Metric(metricName, name.length())); 37 | } 38 | return metrics; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/java/cn/timebusker/mq/direct/DirectRabbitMQConsumer.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.direct; 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 | import cn.timebusker.DirectRabbitConfiguration; 8 | import cn.timebusker.model.MessageEntity; 9 | 10 | @Component 11 | public class DirectRabbitMQConsumer { 12 | 13 | /** 14 | * 监听方法传入的参数需要和消息生产者的一致 15 | * 16 | * @param obj 17 | */ 18 | @RabbitHandler 19 | @RabbitListener(queues = DirectRabbitConfiguration.DIRECT_ROUTING_KEY_TIMEBUSKER) 20 | public void processt(Object obj) { 21 | System.out.println("T\t Receiver : " + obj.toString()); 22 | } 23 | 24 | @RabbitHandler 25 | @RabbitListener(queues = DirectRabbitConfiguration.DIRECT_ROUTING_KEY_YUJIAOJIAO) 26 | public void processy(String context) { 27 | System.out.println("Y\t Receiver : " + context.toString()); 28 | } 29 | 30 | @RabbitHandler 31 | @RabbitListener(queues = DirectRabbitConfiguration.DIRECT_ROUTING_KEY_OBJECT) 32 | public void processo(MessageEntity message) { 33 | System.out.println("O\t Receiver : " + message.toString()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/java/cn/timebusker/mq/sample/MessageProducer.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.mq.sample; 2 | 3 | import java.util.Date; 4 | import java.util.Random; 5 | 6 | import com.alibaba.fastjson.JSON; 7 | import com.rabbitmq.client.Channel; 8 | import com.rabbitmq.client.Connection; 9 | import com.rabbitmq.client.ConnectionFactory; 10 | 11 | public class MessageProducer { 12 | 13 | private final static String ROUTING_KEY = "SAMPLE_RABBITMQ"; 14 | 15 | @SuppressWarnings("unused") 16 | public static void main(String[] argv) throws Exception { 17 | ConnectionFactory factory = new ConnectionFactory(); 18 | factory.setHost("127.0.0.1"); 19 | String pf = JSON.toJSONString(factory); 20 | Connection connection = factory.newConnection(); 21 | Channel channel = connection.createChannel(); 22 | channel.queueDeclare(ROUTING_KEY, false, false, false, null); 23 | for (;;) { 24 | Random random = new Random(); 25 | Thread.sleep(random.nextInt(10000)); 26 | String message = "Hello World,this time is " + new Date(); 27 | channel.basicPublish("", ROUTING_KEY, null, message.getBytes("UTF-8")); 28 | System.out.println("Producer [x] Sent '" + message + "'"); 29 | } 30 | // channel.close(); 31 | // connection.close(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-kafka/src/main/java/cn/timebusker/App.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker; 2 | 3 | import org.apache.kafka.clients.consumer.ConsumerConfig; 4 | import org.apache.kafka.clients.producer.ProducerConfig; 5 | import org.apache.kafka.common.serialization.StringDeserializer; 6 | import org.apache.kafka.common.serialization.StringSerializer; 7 | import org.springframework.beans.factory.annotation.Value; 8 | import org.springframework.boot.SpringApplication; 9 | import org.springframework.boot.autoconfigure.SpringBootApplication; 10 | import org.springframework.context.annotation.Bean; 11 | import org.springframework.context.annotation.Configuration; 12 | import org.springframework.kafka.annotation.EnableKafka; 13 | import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory; 14 | import org.springframework.kafka.config.KafkaListenerContainerFactory; 15 | import org.springframework.kafka.core.*; 16 | import org.springframework.kafka.listener.ConcurrentMessageListenerContainer; 17 | 18 | import java.util.HashMap; 19 | import java.util.Map; 20 | 21 | @SpringBootApplication 22 | @Configuration 23 | @EnableKafka 24 | public class App { 25 | 26 | public static void main(String[] args) { 27 | // spring boot实践 28 | SpringApplication.run(App.class, args); 29 | } 30 | } -------------------------------------------------------------------------------- /spring-boot-7-EhCache/src/main/java/cn/timebusker/entity/User.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.Id; 9 | 10 | @Entity 11 | public class User implements Serializable { 12 | 13 | private static final long serialVersionUID = 1352188299317199595L; 14 | 15 | @Id 16 | @GeneratedValue 17 | private Long id; 18 | 19 | @Column(nullable = false) 20 | private String name; 21 | 22 | @Column(nullable = false) 23 | private Integer age; 24 | 25 | public User() { 26 | } 27 | 28 | public User(String name, Integer age) { 29 | this.name = name; 30 | this.age = age; 31 | } 32 | 33 | public Long getId() { 34 | return id; 35 | } 36 | 37 | public void setId(Long id) { 38 | this.id = id; 39 | } 40 | 41 | public String getName() { 42 | return name; 43 | } 44 | 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | public Integer getAge() { 50 | return age; 51 | } 52 | 53 | public void setAge(Integer age) { 54 | this.age = age; 55 | } 56 | 57 | @Override 58 | public String toString() { 59 | return "User[id=" + id + ";name=" + name + ";age=" + age + "]"; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /spring-boot-18-MQ/spring-boot-18-MQ-rabbitmq/src/main/java/cn/timebusker/model/MessageEntity.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.model; 2 | 3 | import java.io.Serializable; 4 | 5 | public class MessageEntity implements Serializable { 6 | 7 | private static final long serialVersionUID = -6686366912012590475L; 8 | 9 | /** 10 | * 消息编号 11 | */ 12 | private Long messgeId; 13 | 14 | /** 15 | * 消息内容 16 | */ 17 | private String context; 18 | 19 | /** 20 | * 消息备注 21 | */ 22 | private String remark; 23 | 24 | public MessageEntity() { 25 | this.messgeId = System.currentTimeMillis(); 26 | this.context = "今天一直下雨,在家编代码,时间戳为:" + messgeId; 27 | this.remark = "这是一个测试消息"; 28 | } 29 | 30 | public Long getMessgeId() { 31 | return messgeId; 32 | } 33 | 34 | public void setMessgeId(Long messgeId) { 35 | this.messgeId = messgeId; 36 | } 37 | 38 | public String getContext() { 39 | return context; 40 | } 41 | 42 | public void setContext(String context) { 43 | this.context = context; 44 | } 45 | 46 | public String getRemark() { 47 | return remark; 48 | } 49 | 50 | public void setRemark(String remark) { 51 | this.remark = remark; 52 | } 53 | 54 | @Override 55 | public String toString() { 56 | return "消息信息为:\t 消息编号" + messgeId + "\t消息内容" + context + "\t消息备注信息" + remark; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /spring-boot-19-Definition-Starter/spring-boot-19-Definition-Starter-Service/src/main/java/cn/timebusker/service/CalculateService.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service; 2 | 3 | /** 4 | * 算术运算类 5 | */ 6 | public interface CalculateService { 7 | 8 | /** 9 | * 加法. 10 | * 11 | * @param a 12 | * @param b 13 | * @return 14 | */ 15 | double add(double arg1, double arg2); 16 | 17 | /** 18 | * 减法 19 | * 20 | * @param a 21 | * @param b 22 | * @return 23 | */ 24 | double sub(double arg1, double arg2); 25 | 26 | /** 27 | * 除法. 28 | * 29 | * @param a 30 | * @param b 31 | * @return 32 | */ 33 | double div(double arg1, double arg2); 34 | 35 | /** 36 | * 乘法. 37 | * 38 | * @param a 39 | * @param b 40 | * @return 41 | */ 42 | double mul(double arg1, double arg2); 43 | 44 | /** 45 | * 精确到小数点以后scale位,以后的数字四舍五入。 46 | * 47 | * @param arg1 数 48 | * @param scale 保留精度. 49 | * @return两个参数的商 50 | */ 51 | double setScale(double arg, int scale); 52 | 53 | /** 54 | * 精确到小数点以后scale位,以后的数字四舍五入。 55 | * 56 | * @param arg1 数 57 | * @param scale 保留精度. 58 | * @return两个参数的商 59 | */ 60 | double setScale(double arg); 61 | } 62 | -------------------------------------------------------------------------------- /spring-boot-20-Freemarker/src/main/java/com/timebusker/entity/UserInfo.java: -------------------------------------------------------------------------------- 1 | package com.timebusker.entity; 2 | 3 | /** 4 | * @DESC:UserInfo 5 | * @author:timebusker 6 | * @date:2018/6/23 7 | */ 8 | public class UserInfo { 9 | private final static int st = 0; 10 | private String username; 11 | private String password; 12 | private String uid; 13 | 14 | public UserInfo(String uid, String username, String password) { 15 | this.username = username; 16 | this.password = password; 17 | this.uid = uid; 18 | } 19 | 20 | public String getUsername() { 21 | return username; 22 | } 23 | 24 | public void setUsername(String username) { 25 | this.username = username; 26 | } 27 | 28 | public String getPassword() { 29 | return password; 30 | } 31 | 32 | public void setPassword(String password) { 33 | this.password = password; 34 | } 35 | 36 | public String getUid() { 37 | return uid; 38 | } 39 | 40 | public void setUid(String uid) { 41 | this.uid = uid; 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | return String.format("UserInfo:[uid:%s,username:%s,password:%s]", uid, username, password); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /spring-boot-2-RESTful/src/main/java/cn/timebusker/service/Impl/DemoInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.timebusker.service.Impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Service; 8 | 9 | import cn.timebusker.dao.DemoInfoDAO; 10 | import cn.timebusker.entity.DemoInfo; 11 | import cn.timebusker.service.DemoInfoService; 12 | 13 | @Service 14 | public class DemoInfoServiceImpl implements DemoInfoService { 15 | 16 | @Resource 17 | DemoInfoDAO dao; 18 | 19 | @Override 20 | public List insertDemoInfo(DemoInfo demo) { 21 | // TODO Auto-generated method stub 22 | return dao.insertDemoInfo(demo); 23 | } 24 | 25 | @Override 26 | public DemoInfo findDemoInfo(String id) { 27 | // TODO Auto-generated method stub 28 | return dao.findDemoInfo(id); 29 | } 30 | 31 | @Override 32 | public List updateDemoInfo(DemoInfo demo) { 33 | // TODO Auto-generated method stub 34 | return dao.updateDemoInfo(demo); 35 | } 36 | 37 | @Override 38 | public List deleteDemoInfo(DemoInfo demo) { 39 | // TODO Auto-generated method stub 40 | return dao.deleteDemoInfo(demo); 41 | } 42 | 43 | @Override 44 | public List findAll() { 45 | // TODO Auto-generated method stub 46 | return dao.findAll(); 47 | } 48 | 49 | } 50 | --------------------------------------------------------------------------------