├── .gitattributes ├── .gitignore ├── README.md ├── SpringBoot入门教程.md ├── SpringBoot高级教程.md ├── annotation ├── notes01.md ├── notes02.md └── notes03.md ├── images ├── 1537439192685.png ├── 1537443412214.png ├── 1537515512779.png ├── 1537515666575.png ├── 1537583437482.png ├── 1537583796091.png ├── 1537584063974.png ├── 1537584332537.png ├── 1537584525195.png ├── 2018-02-04_123955.png ├── concrete-bindings.png ├── legacy.png ├── template-engine.png ├── 搜狗截图20180129151045.png ├── 搜狗截图20180129151112.png ├── 搜狗截图20180129224104.png ├── 搜狗截图20180130161620.png ├── 搜狗截图20180131220946.png ├── 搜狗截图20180131221411.png ├── 搜狗截图20180203164743.png ├── 搜狗截图20180203181108.png ├── 搜狗截图20180203181751.png ├── 搜狗截图20180211130621.png ├── 搜狗截图20180211130721.png ├── 搜狗截图20180211134506.png ├── 搜狗截图20180226173408.png ├── 搜狗截图20180226173527.png ├── 搜狗截图20180226180347.png ├── 搜狗截图20180226180504.png ├── 搜狗截图20180228135513.png ├── 搜狗截图20180301142915.png ├── 搜狗截图20180302114401.png ├── 搜狗截图20180302144835.png ├── 搜狗截图20180302144910.png ├── 搜狗截图20180302221835.png ├── 搜狗截图20180303145450.png ├── 搜狗截图20180303145531.png ├── 搜狗截图20180303165113.png ├── 搜狗截图20180305194443.png ├── 搜狗截图20180306105412.png ├── 搜狗截图20180306145727.png └── 搜狗截图20180306145855.png ├── images2 ├── 01.postman.jpg ├── 02.postmanget.jpg ├── 03.dubbo.jpg ├── 03.dubbo2.jpg ├── 04.dubbo+zk3.jpg ├── 05.springCloud.jpg ├── 06.EurekaServer.jpg ├── 07.provider-ticket.jpg ├── 07.provider-ticket02.jpg ├── 08.consumer.jpg ├── 09.同步.png ├── 10.异步.png ├── 11.消息.png ├── 12.应用解耦.jpg ├── 13.RabbitMQ结构.png ├── 13.rabbitmq.jpg ├── 14.RabbitMQDirect.png ├── 14.RabbitMQfaout.png ├── 14.RabbitMQtopic.png ├── 15.exchanges.jpg ├── 1537977987703.png ├── 1537978564086.png ├── 1537978866933.png ├── 1538014904085.png ├── 1538014945402.png ├── 1538014962349.png ├── 1538015017658.png ├── 1538015030893.png ├── 1538017074040.png ├── 1538025981287.png ├── 1538026463893.png ├── 1538026685431.png ├── 1538026888673.png ├── 1538027064701.png ├── 1538027184098.png ├── 1538027253860.png ├── 1538027361895.png ├── 1538027504700.png ├── 1538027617120.png ├── 1538027814872.png ├── 1538027905832.png ├── 1538028010175.png ├── 1538028600301.png ├── 1538029298810.png ├── 1538037936258.png ├── 1538038492112.png ├── 1538038561249.png ├── 1538038658381.png ├── 1538043139689.png ├── 1538283974802.png ├── 1539052352126.png ├── 1539052417144.png ├── 1539053281813.png ├── 1539057611119.png ├── 1539057685865.png ├── 1539057816841.png ├── 16.queues.jpg ├── 17.bind.jpg ├── 18,bindfanout.jpg ├── 19,bind_topic.jpg ├── 20.publish-direct.jpg ├── 21.queue-direct.jpg ├── 22.msg-direct.jpg ├── 23.pub-fanout.jpg ├── 24.queue-fanout.jpg ├── 25.msg-fanout.jpg ├── 26.pub-topic.jpg ├── 27.que-topic.jpg ├── 28.msg-topic.jpg ├── 29.dir-idea.jpg ├── 30.dir-idea-json.jpg ├── 31.createAMQP.jpg ├── 32.createQueue.jpg ├── 33.createBinding.jpg ├── 34.elastic-head.jpg ├── 35.cache.jpg ├── 35.cache.png ├── 36.importcache.jpg ├── 37.redis.jpg ├── 38.redis02.jpg ├── 38.redis03.jpg └── 39.redis04.jpg ├── springboot-01-helloworld ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── cuzz │ ├── Application.java │ └── HelloController.java ├── springboot-02-autoconfig ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── springboot │ │ │ └── SpringbootApplication.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── cuzz │ └── springboot │ └── SpringbootApplicationTests.java ├── springboot-02-config ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── springboot │ │ │ ├── SpringbootApplication.java │ │ │ ├── bean │ │ │ ├── Dog.java │ │ │ └── Person.java │ │ │ ├── config │ │ │ └── MyAppConfig.java │ │ │ ├── controller │ │ │ └── PersonController.java │ │ │ └── service │ │ │ └── HelloService.java │ └── resources │ │ ├── application-dev.properties │ │ ├── application-prod.properties │ │ ├── application.yml │ │ ├── beans.xml │ │ └── person.properties │ └── test │ └── java │ └── com │ └── cuzz │ └── springboot │ ├── SpringbootApplicationTests.java │ └── service │ └── TestHelloService.java ├── springboot-03-logging ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── springboot │ │ │ └── SpringbootApplication.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── cuzz │ └── springboot │ └── SpringbootApplicationTests.java ├── springboot-04-web-jsp ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── springboot │ │ │ ├── ServletInitializer.java │ │ │ └── SpringbootApplication.java │ ├── resources │ │ └── application.properties │ └── webapp │ │ ├── WEB-INF │ │ └── web.xml │ │ └── hello.jsp │ └── test │ └── java │ └── com │ └── cuzz │ └── springboot │ └── SpringbootApplicationTests.java ├── springboot-04-web-restful ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── web │ │ │ ├── WebApplication.java │ │ │ ├── component │ │ │ ├── LoginHandlerInterceptor.java │ │ │ └── MyLocaleResolver.java │ │ │ ├── config │ │ │ ├── MyMvcConfig.java │ │ │ └── MyServerConfig.java │ │ │ ├── controller │ │ │ ├── EmployeeController.java │ │ │ ├── HelloController.java │ │ │ └── LoginController.java │ │ │ ├── dao │ │ │ ├── DepartmentDao.java │ │ │ └── EmployeeDao.java │ │ │ ├── entities │ │ │ ├── Department.java │ │ │ └── Employee.java │ │ │ ├── exception │ │ │ └── UserNotExistException.java │ │ │ ├── filter │ │ │ └── MyFilter.java │ │ │ ├── listener │ │ │ └── MyListener.java │ │ │ └── servlet │ │ │ └── MyServlet.java │ └── resources │ │ ├── application.properties │ │ ├── i18n │ │ ├── login.properties │ │ ├── login_en_US.properties │ │ └── login_zh_CN.properties │ │ ├── public │ │ └── index.html │ │ ├── resources │ │ └── favicon.ico │ │ ├── springmvc.xml │ │ ├── static │ │ └── asserts │ │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ ├── dashboard.css │ │ │ └── signin.css │ │ │ ├── img │ │ │ └── bootstrap-solid.svg │ │ │ └── js │ │ │ ├── Chart.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── feather.min.js │ │ │ ├── jquery-3.2.1.slim.min.js │ │ │ └── popper.min.js │ │ └── templates │ │ ├── commons │ │ └── bar.html │ │ ├── dashboard.html │ │ ├── emp │ │ ├── add.html │ │ └── list.html │ │ ├── error │ │ ├── 404.html │ │ ├── 4xx.html │ │ └── 5xx.html │ │ ├── login.html │ │ └── success.html │ └── test │ └── java │ └── com │ └── cuzz │ └── web │ └── WebApplicationTests.java ├── springboot-06-data-jdbc ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── springboot │ │ │ ├── SpringbootApplication.java │ │ │ └── controller │ │ │ └── HelloController.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── cuzz │ └── springboot │ └── SpringbootApplicationTests.java ├── springboot-06-data-jpa ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── springboot │ │ │ ├── SpringbootApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── cuzz │ └── springboot │ └── SpringbootApplicationTests.java ├── springboot-06-data-mybatis ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── springboot │ │ │ ├── SpringbootApplication.java │ │ │ ├── bean │ │ │ ├── Department.java │ │ │ └── Employee.java │ │ │ ├── config │ │ │ ├── DruidConfig.java │ │ │ └── MyBatisConfig.java │ │ │ ├── controller │ │ │ └── DeptController.java │ │ │ └── mapper │ │ │ ├── DepartmentMapper.java │ │ │ └── EmployeeMapper.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ ├── mybatis │ │ ├── mapper │ │ │ └── EmployeeMapper.xml │ │ └── mybatis-config.xml │ │ └── sql │ │ ├── department.sql │ │ └── employee.sql │ └── test │ └── java │ └── com │ └── cuzz │ └── springboot │ └── SpringbootApplicationTests.java ├── springboot-09-cache ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── cache │ │ │ ├── Springboot07CacheApplication.java │ │ │ ├── bean │ │ │ ├── Department.java │ │ │ └── Employee.java │ │ │ ├── config │ │ │ ├── MyCacheConfig.java │ │ │ └── MyRedisConfig.java │ │ │ ├── controller │ │ │ └── EmployeeController.java │ │ │ ├── mapper │ │ │ ├── DepartmentMapper.java │ │ │ └── EmployeeMapper.java │ │ │ └── service │ │ │ └── EmployeeService.java │ └── resources │ │ ├── application.properties │ │ └── sql │ │ ├── department.sql │ │ └── employee.sql │ └── test │ └── java │ └── com │ └── cuzz │ └── cache │ ├── Springboot07CacheApplicationTests.java │ └── mapper │ └── DepartmentMapper.java ├── springboot-10-amqp ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── amqp │ │ │ ├── Springboot10AmqpApplication.java │ │ │ ├── bean │ │ │ └── Book.java │ │ │ ├── config │ │ │ └── MyAMQPConfig.java │ │ │ └── service │ │ │ └── BookService.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── cuzz │ └── amqp │ └── Springboot10AmqpApplicationTests.java ├── springboot-11-elastic ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── elastic │ │ │ ├── Springboot11ElasticApplication.java │ │ │ ├── bean │ │ │ ├── Article.java │ │ │ └── Book.java │ │ │ └── repository │ │ │ └── BookRepository.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── cuzz │ └── elastic │ └── Springboot11ElasticApplicationTests.java ├── springboot-12-task ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── task │ │ │ ├── Springboot12TaskApplication.java │ │ │ ├── controller │ │ │ └── AsynController.java │ │ │ └── service │ │ │ ├── AsynSerivce.java │ │ │ └── ScheduledService.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── cuzz │ └── task │ └── Springboot12TaskApplicationTests.java ├── springboot-13-security ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── security │ │ │ ├── Springboot13SecurityApplication.java │ │ │ ├── config │ │ │ └── MySecurityConfig.java │ │ │ └── controller │ │ │ └── KungfuController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── pages │ │ ├── level1 │ │ │ ├── 1.html │ │ │ ├── 2.html │ │ │ └── 3.html │ │ ├── level2 │ │ │ ├── 1.html │ │ │ ├── 2.html │ │ │ └── 3.html │ │ ├── level3 │ │ │ ├── 1.html │ │ │ ├── 2.html │ │ │ └── 3.html │ │ └── login.html │ │ └── welcome.html │ └── test │ └── java │ └── com │ └── cuzz │ └── security │ └── Springboot13SecurityApplicationTests.java ├── springboot-14-consumer-user ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ ├── ticket │ │ │ └── service │ │ │ │ └── TicketService.java │ │ │ └── user │ │ │ ├── Springboot14ConsumerUserApplication.java │ │ │ └── service │ │ │ └── UserService.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── cuzz │ └── user │ └── Springboot14ConsumerUserApplicationTests.java ├── springboot-14-provider-ticket ├── .gitignore ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── ticket │ │ │ ├── Springboot14ProviderTicketApplication.java │ │ │ └── service │ │ │ ├── TicketService.java │ │ │ └── TicketServiceImpl.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── cuzz │ └── ticket │ └── Springboot14ProviderTicketApplicationTests.java ├── springboot-14-springcloud-consumer-user ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── consumeruser │ │ │ ├── Springboot14SpringcloudConsumerUserApplication.java │ │ │ └── controller │ │ │ └── UserController.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── cuzz │ └── consumeruser │ └── Springboot14SpringcloudConsumerUserApplicationTests.java ├── springboot-14-springcloud-eureka-server ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── eurekaserver │ │ │ └── Springboot14SpringcloudEurekaServerApplication.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── cuzz │ └── eurekaserver │ └── Springboot14SpringcloudEurekaServerApplicationTests.java ├── springboot-14-springcloud-provider-ticket ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cuzz │ │ │ └── providerticket │ │ │ ├── Springboot14SpringcloudProviderTicketApplication.java │ │ │ ├── controller │ │ │ └── TicketController.java │ │ │ └── service │ │ │ └── TicketSerivce.java │ └── resources │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── com │ └── cuzz │ └── providerticket │ └── Springboot14SpringcloudProviderTicketApplicationTests.java └── supporting ├── SpringBoot初级.pdf ├── SpringBoot高级.pdf └── SpringSecurity实验 ├── java └── KungfuController.java └── templates ├── pages ├── level1 │ ├── 1.html │ ├── 2.html │ └── 3.html ├── level2 │ ├── 1.html │ ├── 2.html │ └── 3.html ├── level3 │ ├── 1.html │ ├── 2.html │ └── 3.html └── login.html └── welcome.html /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=Java 2 | *.css linguist-language=Java 3 | *.html linguist-language=Java 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Java template 3 | # Compiled class file 4 | *.class 5 | 6 | # Log file 7 | *.log 8 | 9 | # BlueJ files 10 | *.ctxt 11 | # idea files 12 | .idea/ 13 | .idea 14 | *.iml 15 | target/ 16 | target 17 | 18 | # Mobile Tools for Java (J2ME) 19 | .mtj.tmp/ 20 | 21 | # Package Files # 22 | *.jar 23 | *.war 24 | *.ear 25 | *.zip 26 | *.tar.gz 27 | *.rar 28 | 29 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 30 | hs_err_pid* 31 | 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SpringBoot 2 | 这是尚硅谷的SpringBoot教程,自己过了敲了一遍代码,下面是整理的笔记和课件,用于自己学习,如有侵权请告知 3 | 4 | 如果你喜欢,给个star哈~ 5 | 6 | ## 内容概要 7 | 8 | | **初级** | **高级** | 9 | | ----------------------------- | ----------------------------- | 10 | | 一、Spring Boot入门 | 九、Spring Boot与缓存 | 11 | | 二、Spring Boot配置 | 十、Spring Boot与消息 | 12 | | 三、Spring Boot与日记 | 十一、Spring Boot与检索 | 13 | | 四、Spring Boot与Web开发 | 十二、Spring Boot与任务 | 14 | | 五、Spring Boot与Docker | 十三、Spring Boot与安全 | 15 | | 六、Spring Boot与数据访问 | 十四、Spring Boot与分布式 | 16 | | 七、Spring Boot启动配置原理 | 十五、Spring Boot与开发热部署 | 17 | | 八、Spring Boot自定义starters | 十六、Spring Boot与监控管理 | 18 | 19 | ## 笔记课件 20 | - [SpringBoot初级笔记](/SpringBoot入门教程.md) 21 | - [SpringBoot高级笔记](/SpringBoot高级教程.md) 22 | - [课件一](/supporting/SpringBoot初级.pdf) 23 | - [课件二](/supporting/SpringBoot高级.pdf) 24 | 25 | ## 视频和资料 26 | - 可以去尚硅谷的官网获取 27 | - B站上也有[视频](https://www.bilibili.com/video/av23478787),源代码和软件,下载地址: [百度云](https://pan.baidu.com/s/1mWz3z886d2Br3Mp6TekPHA) 密码:13nn 28 | - 推荐提前看看Spring注解驱动开发 :[百度云](https://pan.baidu.com/s/1ei1mZVrDXrJA67qB_HOC3A) 密码:8oo1,代码:[地址](https://github.com/cuzz1/learn-demo/tree/master/demo-05-spring-annotation),笔记:[地址](http://blog.cuzz.site/tags/%E6%B3%A8%E8%A7%A3/) 29 | - [SpringSecurity实验](/supporting/SpringSecurity实验) 30 | 31 | -------------------------------------------------------------------------------- /images/1537439192685.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/1537439192685.png -------------------------------------------------------------------------------- /images/1537443412214.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/1537443412214.png -------------------------------------------------------------------------------- /images/1537515512779.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/1537515512779.png -------------------------------------------------------------------------------- /images/1537515666575.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/1537515666575.png -------------------------------------------------------------------------------- /images/1537583437482.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/1537583437482.png -------------------------------------------------------------------------------- /images/1537583796091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/1537583796091.png -------------------------------------------------------------------------------- /images/1537584063974.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/1537584063974.png -------------------------------------------------------------------------------- /images/1537584332537.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/1537584332537.png -------------------------------------------------------------------------------- /images/1537584525195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/1537584525195.png -------------------------------------------------------------------------------- /images/2018-02-04_123955.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/2018-02-04_123955.png -------------------------------------------------------------------------------- /images/concrete-bindings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/concrete-bindings.png -------------------------------------------------------------------------------- /images/legacy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/legacy.png -------------------------------------------------------------------------------- /images/template-engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/template-engine.png -------------------------------------------------------------------------------- /images/搜狗截图20180129151045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180129151045.png -------------------------------------------------------------------------------- /images/搜狗截图20180129151112.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180129151112.png -------------------------------------------------------------------------------- /images/搜狗截图20180129224104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180129224104.png -------------------------------------------------------------------------------- /images/搜狗截图20180130161620.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180130161620.png -------------------------------------------------------------------------------- /images/搜狗截图20180131220946.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180131220946.png -------------------------------------------------------------------------------- /images/搜狗截图20180131221411.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180131221411.png -------------------------------------------------------------------------------- /images/搜狗截图20180203164743.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180203164743.png -------------------------------------------------------------------------------- /images/搜狗截图20180203181108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180203181108.png -------------------------------------------------------------------------------- /images/搜狗截图20180203181751.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180203181751.png -------------------------------------------------------------------------------- /images/搜狗截图20180211130621.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180211130621.png -------------------------------------------------------------------------------- /images/搜狗截图20180211130721.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180211130721.png -------------------------------------------------------------------------------- /images/搜狗截图20180211134506.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180211134506.png -------------------------------------------------------------------------------- /images/搜狗截图20180226173408.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180226173408.png -------------------------------------------------------------------------------- /images/搜狗截图20180226173527.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180226173527.png -------------------------------------------------------------------------------- /images/搜狗截图20180226180347.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180226180347.png -------------------------------------------------------------------------------- /images/搜狗截图20180226180504.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180226180504.png -------------------------------------------------------------------------------- /images/搜狗截图20180228135513.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180228135513.png -------------------------------------------------------------------------------- /images/搜狗截图20180301142915.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180301142915.png -------------------------------------------------------------------------------- /images/搜狗截图20180302114401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180302114401.png -------------------------------------------------------------------------------- /images/搜狗截图20180302144835.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180302144835.png -------------------------------------------------------------------------------- /images/搜狗截图20180302144910.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180302144910.png -------------------------------------------------------------------------------- /images/搜狗截图20180302221835.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180302221835.png -------------------------------------------------------------------------------- /images/搜狗截图20180303145450.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180303145450.png -------------------------------------------------------------------------------- /images/搜狗截图20180303145531.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180303145531.png -------------------------------------------------------------------------------- /images/搜狗截图20180303165113.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180303165113.png -------------------------------------------------------------------------------- /images/搜狗截图20180305194443.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180305194443.png -------------------------------------------------------------------------------- /images/搜狗截图20180306105412.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180306105412.png -------------------------------------------------------------------------------- /images/搜狗截图20180306145727.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180306145727.png -------------------------------------------------------------------------------- /images/搜狗截图20180306145855.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images/搜狗截图20180306145855.png -------------------------------------------------------------------------------- /images2/01.postman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/01.postman.jpg -------------------------------------------------------------------------------- /images2/02.postmanget.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/02.postmanget.jpg -------------------------------------------------------------------------------- /images2/03.dubbo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/03.dubbo.jpg -------------------------------------------------------------------------------- /images2/03.dubbo2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/03.dubbo2.jpg -------------------------------------------------------------------------------- /images2/04.dubbo+zk3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/04.dubbo+zk3.jpg -------------------------------------------------------------------------------- /images2/05.springCloud.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/05.springCloud.jpg -------------------------------------------------------------------------------- /images2/06.EurekaServer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/06.EurekaServer.jpg -------------------------------------------------------------------------------- /images2/07.provider-ticket.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/07.provider-ticket.jpg -------------------------------------------------------------------------------- /images2/07.provider-ticket02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/07.provider-ticket02.jpg -------------------------------------------------------------------------------- /images2/08.consumer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/08.consumer.jpg -------------------------------------------------------------------------------- /images2/09.同步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/09.同步.png -------------------------------------------------------------------------------- /images2/10.异步.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/10.异步.png -------------------------------------------------------------------------------- /images2/11.消息.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/11.消息.png -------------------------------------------------------------------------------- /images2/12.应用解耦.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/12.应用解耦.jpg -------------------------------------------------------------------------------- /images2/13.RabbitMQ结构.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/13.RabbitMQ结构.png -------------------------------------------------------------------------------- /images2/13.rabbitmq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/13.rabbitmq.jpg -------------------------------------------------------------------------------- /images2/14.RabbitMQDirect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/14.RabbitMQDirect.png -------------------------------------------------------------------------------- /images2/14.RabbitMQfaout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/14.RabbitMQfaout.png -------------------------------------------------------------------------------- /images2/14.RabbitMQtopic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/14.RabbitMQtopic.png -------------------------------------------------------------------------------- /images2/15.exchanges.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/15.exchanges.jpg -------------------------------------------------------------------------------- /images2/1537977987703.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1537977987703.png -------------------------------------------------------------------------------- /images2/1537978564086.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1537978564086.png -------------------------------------------------------------------------------- /images2/1537978866933.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1537978866933.png -------------------------------------------------------------------------------- /images2/1538014904085.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538014904085.png -------------------------------------------------------------------------------- /images2/1538014945402.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538014945402.png -------------------------------------------------------------------------------- /images2/1538014962349.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538014962349.png -------------------------------------------------------------------------------- /images2/1538015017658.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538015017658.png -------------------------------------------------------------------------------- /images2/1538015030893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538015030893.png -------------------------------------------------------------------------------- /images2/1538017074040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538017074040.png -------------------------------------------------------------------------------- /images2/1538025981287.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538025981287.png -------------------------------------------------------------------------------- /images2/1538026463893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538026463893.png -------------------------------------------------------------------------------- /images2/1538026685431.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538026685431.png -------------------------------------------------------------------------------- /images2/1538026888673.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538026888673.png -------------------------------------------------------------------------------- /images2/1538027064701.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538027064701.png -------------------------------------------------------------------------------- /images2/1538027184098.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538027184098.png -------------------------------------------------------------------------------- /images2/1538027253860.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538027253860.png -------------------------------------------------------------------------------- /images2/1538027361895.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538027361895.png -------------------------------------------------------------------------------- /images2/1538027504700.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538027504700.png -------------------------------------------------------------------------------- /images2/1538027617120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538027617120.png -------------------------------------------------------------------------------- /images2/1538027814872.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538027814872.png -------------------------------------------------------------------------------- /images2/1538027905832.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538027905832.png -------------------------------------------------------------------------------- /images2/1538028010175.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538028010175.png -------------------------------------------------------------------------------- /images2/1538028600301.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538028600301.png -------------------------------------------------------------------------------- /images2/1538029298810.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538029298810.png -------------------------------------------------------------------------------- /images2/1538037936258.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538037936258.png -------------------------------------------------------------------------------- /images2/1538038492112.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538038492112.png -------------------------------------------------------------------------------- /images2/1538038561249.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538038561249.png -------------------------------------------------------------------------------- /images2/1538038658381.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538038658381.png -------------------------------------------------------------------------------- /images2/1538043139689.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538043139689.png -------------------------------------------------------------------------------- /images2/1538283974802.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1538283974802.png -------------------------------------------------------------------------------- /images2/1539052352126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1539052352126.png -------------------------------------------------------------------------------- /images2/1539052417144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1539052417144.png -------------------------------------------------------------------------------- /images2/1539053281813.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1539053281813.png -------------------------------------------------------------------------------- /images2/1539057611119.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1539057611119.png -------------------------------------------------------------------------------- /images2/1539057685865.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1539057685865.png -------------------------------------------------------------------------------- /images2/1539057816841.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/1539057816841.png -------------------------------------------------------------------------------- /images2/16.queues.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/16.queues.jpg -------------------------------------------------------------------------------- /images2/17.bind.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/17.bind.jpg -------------------------------------------------------------------------------- /images2/18,bindfanout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/18,bindfanout.jpg -------------------------------------------------------------------------------- /images2/19,bind_topic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/19,bind_topic.jpg -------------------------------------------------------------------------------- /images2/20.publish-direct.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/20.publish-direct.jpg -------------------------------------------------------------------------------- /images2/21.queue-direct.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/21.queue-direct.jpg -------------------------------------------------------------------------------- /images2/22.msg-direct.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/22.msg-direct.jpg -------------------------------------------------------------------------------- /images2/23.pub-fanout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/23.pub-fanout.jpg -------------------------------------------------------------------------------- /images2/24.queue-fanout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/24.queue-fanout.jpg -------------------------------------------------------------------------------- /images2/25.msg-fanout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/25.msg-fanout.jpg -------------------------------------------------------------------------------- /images2/26.pub-topic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/26.pub-topic.jpg -------------------------------------------------------------------------------- /images2/27.que-topic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/27.que-topic.jpg -------------------------------------------------------------------------------- /images2/28.msg-topic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/28.msg-topic.jpg -------------------------------------------------------------------------------- /images2/29.dir-idea.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/29.dir-idea.jpg -------------------------------------------------------------------------------- /images2/30.dir-idea-json.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/30.dir-idea-json.jpg -------------------------------------------------------------------------------- /images2/31.createAMQP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/31.createAMQP.jpg -------------------------------------------------------------------------------- /images2/32.createQueue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/32.createQueue.jpg -------------------------------------------------------------------------------- /images2/33.createBinding.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/33.createBinding.jpg -------------------------------------------------------------------------------- /images2/34.elastic-head.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/34.elastic-head.jpg -------------------------------------------------------------------------------- /images2/35.cache.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/35.cache.jpg -------------------------------------------------------------------------------- /images2/35.cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/35.cache.png -------------------------------------------------------------------------------- /images2/36.importcache.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/36.importcache.jpg -------------------------------------------------------------------------------- /images2/37.redis.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/37.redis.jpg -------------------------------------------------------------------------------- /images2/38.redis02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/38.redis02.jpg -------------------------------------------------------------------------------- /images2/38.redis03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/38.redis03.jpg -------------------------------------------------------------------------------- /images2/39.redis04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/images2/39.redis04.jpg -------------------------------------------------------------------------------- /springboot-01-helloworld/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.cuzz 8 | springboot-01-helloworld 9 | 1.0-SNAPSHOT 10 | 11 | 12 | org.springframework.boot 13 | spring-boot-starter-parent 14 | 1.5.4.RELEASE 15 | 16 | 17 | 18 | org.springframework.boot 19 | spring-boot-starter-web 20 | 21 | 22 | 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-maven-plugin 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /springboot-01-helloworld/src/main/java/com/cuzz/Application.java: -------------------------------------------------------------------------------- 1 | package com.cuzz; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * @Author: cuzz 8 | * @Date: 2018/9/20 18:06 9 | * @Description: @SpringBootApplication 来标注一个主程序,说明这是一个SpringBoot应用 10 | */ 11 | @SpringBootApplication 12 | public class Application { 13 | 14 | public static void main(String[] args) { 15 | 16 | // Spring应用启动起来 17 | SpringApplication.run(Application.class, args); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /springboot-01-helloworld/src/main/java/com/cuzz/HelloController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestMethod; 6 | import org.springframework.web.bind.annotation.ResponseBody; 7 | 8 | /** 9 | * @Author: cuzz 10 | * @Date: 2018/9/20 18:12 11 | * @Description: 12 | */ 13 | @Controller 14 | public class HelloController { 15 | 16 | @ResponseBody 17 | @GetMapping(value = "/hello") 18 | public String hello() { 19 | return "Hello World"; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-02-autoconfig/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.5.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-test 36 | test 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.springframework.boot 44 | spring-boot-maven-plugin 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /springboot-02-autoconfig/src/main/java/com/cuzz/springboot/SpringbootApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-02-autoconfig/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-02-autoconfig/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-02-autoconfig/src/test/java/com/cuzz/springboot/SpringbootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringbootApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-02-config/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-02-config/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.3.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-test 36 | test 37 | 38 | 39 | 40 | org.springframework.boot 41 | spring-boot-configuration-processor 42 | true 43 | 44 | 45 | 46 | org.projectlombok 47 | lombok 48 | 1.16.22 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-maven-plugin 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /springboot-02-config/src/main/java/com/cuzz/springboot/SpringbootApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.ImportAutoConfiguration; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.ImportResource; 7 | 8 | //@ImportResource(locations = {"classpath:beans.xml"}) 9 | @SpringBootApplication 10 | public class SpringbootApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringbootApplication.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /springboot-02-config/src/main/java/com/cuzz/springboot/bean/Dog.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.bean; 2 | 3 | import lombok.Data; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * @Author: cuzz 8 | * @Date: 2018/9/20 19:34 9 | * @Description: 10 | */ 11 | @Data 12 | @Component 13 | public class Dog { 14 | private String name; 15 | private Integer age; 16 | } 17 | -------------------------------------------------------------------------------- /springboot-02-config/src/main/java/com/cuzz/springboot/bean/Person.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.bean; 2 | 3 | import com.cuzz.springboot.bean.Dog; 4 | import lombok.Data; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | import org.springframework.context.annotation.PropertySource; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.util.Date; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | /** 14 | * @Author: cuzz 15 | * @Date: 2018/9/20 19:34 16 | * @Description: 17 | */ 18 | @PropertySource(value = {"classpath:person.properties"}) 19 | @Data 20 | @Component 21 | @ConfigurationProperties(prefix = "person") 22 | public class Person { 23 | 24 | /** 25 | * 26 | * 27 | * 28 | * 29 | */ 30 | 31 | //lastName必须是邮箱格式 32 | // @Email 33 | //@Value("${person.last-name}") 34 | private String lastName; 35 | //@Value("#{11*2}") 36 | private Integer age; 37 | //@Value("true") 38 | private Boolean boss; 39 | 40 | private Date birth; 41 | //@Value("${person.maps}") 42 | private Map maps; 43 | private List lists; 44 | private Dog dog; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /springboot-02-config/src/main/java/com/cuzz/springboot/config/MyAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.config; 2 | 3 | import com.cuzz.springboot.service.HelloService; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * @Author: cuzz 9 | * @Date: 2018/9/20 20:49 10 | * @Description: 指明当前类是一个配置类,来代替以前的Spring配置文件 11 | * 在配置文件中用来添加组件的 12 | */ 13 | @Configuration 14 | public class MyAppConfig { 15 | 16 | // 将方法的返回值添加到容器中;容器中这个组件默认的id就是方法名 17 | @Bean 18 | public HelloService helloService() { 19 | System.out.println("配置类@Bean给容器中添加组件了..."); 20 | return new HelloService(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /springboot-02-config/src/main/java/com/cuzz/springboot/controller/PersonController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.controller; 2 | 3 | import com.cuzz.springboot.bean.Person; 4 | import org.springframework.beans.factory.annotation.Autowired; 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 | /** 10 | * @Author: cuzz 11 | * @Date: 2018/9/20 19:46 12 | * @Description: 13 | */ 14 | @RestController 15 | public class PersonController { 16 | 17 | @Autowired 18 | Person person; 19 | 20 | @RequestMapping(value = "/person", method = RequestMethod.GET) 21 | public String person() { 22 | return person.toString(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /springboot-02-config/src/main/java/com/cuzz/springboot/service/HelloService.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.service; 2 | 3 | /** 4 | * @Author: cuzz 5 | * @Date: 2018/9/20 20:38 6 | * @Description: 7 | */ 8 | public class HelloService { 9 | } 10 | -------------------------------------------------------------------------------- /springboot-02-config/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-02-config/src/main/resources/application-dev.properties -------------------------------------------------------------------------------- /springboot-02-config/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-02-config/src/main/resources/application-prod.properties -------------------------------------------------------------------------------- /springboot-02-config/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | #person: 2 | # lastName: hello 3 | # age: 18 4 | # boss: false 5 | # birth: 2017/12/12 6 | # maps: {k1: v1, k2: 12} 7 | # lists: 8 | # - lisi 9 | # - zhaoliu 10 | # dog: 11 | # name: 小狗 12 | # age: 12 13 | -------------------------------------------------------------------------------- /springboot-02-config/src/main/resources/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /springboot-02-config/src/main/resources/person.properties: -------------------------------------------------------------------------------- 1 | person.last-name=\u674E\u56DB 2 | person.age=12 3 | person.birth=2017/12/15 4 | person.boss=false 5 | person.maps.k1=v1 6 | person.maps.k2=14 7 | person.lists=a,b,c 8 | person.dog.name=dog 9 | person.dog.age=15 -------------------------------------------------------------------------------- /springboot-02-config/src/test/java/com/cuzz/springboot/SpringbootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import com.cuzz.springboot.bean.Person; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.context.ApplicationContext; 9 | import org.springframework.test.context.junit4.SpringRunner; 10 | 11 | @RunWith(SpringRunner.class) 12 | @SpringBootTest 13 | public class SpringbootApplicationTests { 14 | 15 | @Autowired 16 | Person person; 17 | 18 | @Autowired 19 | ApplicationContext ioc; 20 | 21 | public void contextLoads() { 22 | System.out.println(person); 23 | } 24 | 25 | @Test 26 | public void testHelloService() { 27 | boolean b = ioc.containsBean("helloService"); 28 | System.out.println(b); 29 | } 30 | 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /springboot-02-config/src/test/java/com/cuzz/springboot/service/TestHelloService.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.service; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.context.ApplicationContext; 8 | import org.springframework.test.context.junit4.SpringRunner; 9 | 10 | /** 11 | * @Author: cuzz 12 | * @Date: 2018/9/20 20:41 13 | * @Description: 14 | */ 15 | @RunWith(SpringRunner.class) 16 | @SpringBootTest 17 | public class TestHelloService { 18 | 19 | 20 | @Autowired 21 | ApplicationContext ioc; 22 | 23 | 24 | @Test 25 | public void testHelloService() { 26 | boolean b = ioc.containsBean("helloService"); 27 | System.out.println(b); // true 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /springboot-03-logging/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.5.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-test 36 | test 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.springframework.boot 44 | spring-boot-maven-plugin 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /springboot-03-logging/src/main/java/com/cuzz/springboot/SpringbootApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-03-logging/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-03-logging/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-03-logging/src/test/java/com/cuzz/springboot/SpringbootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringbootApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-04-web-jsp/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot 8 | 0.0.1-SNAPSHOT 9 | war 10 | 11 | springboot 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.5.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-tomcat 36 | provided 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-test 41 | test 42 | 43 | 44 | 45 | 46 | 47 | 48 | org.springframework.boot 49 | spring-boot-maven-plugin 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /springboot-04-web-jsp/src/main/java/com/cuzz/springboot/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(SpringbootApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-04-web-jsp/src/main/java/com/cuzz/springboot/SpringbootApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-04-web-jsp/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-04-web-jsp/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-04-web-jsp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /springboot-04-web-jsp/src/main/webapp/hello.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: my 4 | Date: 2018/9/22 5 | Time: 10:52 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | Title 12 | 13 | 14 |

Hello JSP

15 | 16 | 17 | -------------------------------------------------------------------------------- /springboot-04-web-jsp/src/test/java/com/cuzz/springboot/SpringbootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringbootApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/WebApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class WebApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(WebApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/component/LoginHandlerInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.component; 2 | 3 | import org.springframework.web.servlet.HandlerInterceptor; 4 | import org.springframework.web.servlet.ModelAndView; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | /** 10 | * 登陆检查, 11 | */ 12 | public class LoginHandlerInterceptor implements HandlerInterceptor { 13 | //目标方法执行之前 14 | @Override 15 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 16 | Object user = request.getSession().getAttribute("loginUser"); 17 | if(user == null){ 18 | //未登陆,返回登陆页面 19 | request.setAttribute("msg","没有权限请先登陆"); 20 | request.getRequestDispatcher("/index.html").forward(request,response); 21 | return false; 22 | }else{ 23 | //已登陆,放行请求 24 | return true; 25 | } 26 | 27 | } 28 | 29 | @Override 30 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { 31 | 32 | } 33 | 34 | @Override 35 | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/component/MyLocaleResolver.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.component; 2 | 3 | import org.springframework.util.StringUtils; 4 | import org.springframework.web.servlet.LocaleResolver; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | import java.util.Locale; 9 | 10 | /** 11 | * 可以在连接上携带区域信息 12 | */ 13 | public class MyLocaleResolver implements LocaleResolver { 14 | 15 | @Override 16 | public Locale resolveLocale(HttpServletRequest request) { 17 | String l = request.getParameter("l"); 18 | Locale locale = Locale.getDefault(); 19 | if(!StringUtils.isEmpty(l)){ 20 | String[] split = l.split("_"); 21 | locale = new Locale(split[0],split[1]); 22 | } 23 | return locale; 24 | } 25 | 26 | @Override 27 | public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) { 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/config/MyMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.config; 2 | 3 | import com.cuzz.web.component.LoginHandlerInterceptor; 4 | import com.cuzz.web.component.MyLocaleResolver; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.web.servlet.LocaleResolver; 8 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 9 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 10 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 11 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 12 | 13 | /** 14 | * @Author: cuzz 15 | * @Date: 2018/9/21 14:29 16 | * @Description: 17 | */ 18 | @Configuration 19 | // WebMvcConfigurerAdapter过时,使用WebMvcConfigurer接口 20 | public class MyMvcConfig implements WebMvcConfigurer { 21 | @Override 22 | public void addViewControllers(ViewControllerRegistry registry) { 23 | registry.addViewController("/cuzz").setViewName("success"); 24 | } 25 | //注册拦截器 26 | @Override 27 | public void addInterceptors(InterceptorRegistry registry) { 28 | //super.addInterceptors(registry); 29 | //静态资源; *.css , *.js 30 | //SpringBoot已经做好了静态资源映射 31 | registry.addInterceptor(new LoginHandlerInterceptor()).addPathPatterns("/**") 32 | .excludePathPatterns("/index.html","/","/user/login"); 33 | } 34 | 35 | // 所有的WebMvcConfigurerAdapter组件都会一起起作用 36 | @Bean 37 | public WebMvcConfigurer webMvcConfigurer() { 38 | WebMvcConfigurer webMvcConfigurer = new WebMvcConfigurer() { 39 | @Override 40 | public void addViewControllers(ViewControllerRegistry registry) { 41 | registry.addViewController("/").setViewName("login"); 42 | registry.addViewController("/index.html").setViewName("login"); 43 | registry.addViewController("/main.html").setViewName("dashboard"); 44 | } 45 | }; 46 | return webMvcConfigurer; 47 | } 48 | 49 | @Bean 50 | public LocaleResolver localeResolver() { 51 | return new MyLocaleResolver(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/config/MyServerConfig.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.config; 2 | 3 | import com.cuzz.web.filter.MyFilter; 4 | import com.cuzz.web.listener.MyListener; 5 | import com.cuzz.web.servlet.MyServlet; 6 | import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; 7 | import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; 8 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 9 | import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; 10 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 11 | import org.springframework.context.annotation.Bean; 12 | import org.springframework.context.annotation.Configuration; 13 | 14 | import java.util.Arrays; 15 | 16 | @Configuration 17 | public class MyServerConfig { 18 | 19 | //注册三大组件 20 | @Bean 21 | public ServletRegistrationBean myServlet(){ 22 | ServletRegistrationBean registrationBean = new ServletRegistrationBean(new MyServlet(),"/myServlet"); 23 | registrationBean.setLoadOnStartup(1); 24 | return registrationBean; 25 | } 26 | 27 | @Bean 28 | public FilterRegistrationBean myFilter(){ 29 | FilterRegistrationBean registrationBean = new FilterRegistrationBean(); 30 | registrationBean.setFilter(new MyFilter()); 31 | registrationBean.setUrlPatterns(Arrays.asList("/hello","/myServlet")); 32 | return registrationBean; 33 | } 34 | 35 | @Bean 36 | public ServletListenerRegistrationBean myListener(){ 37 | ServletListenerRegistrationBean registrationBean = new ServletListenerRegistrationBean<>(new MyListener()); 38 | return registrationBean; 39 | } 40 | 41 | 42 | //配置嵌入式的Servlet容器 43 | @Bean 44 | public EmbeddedServletContainerCustomizer embeddedServletContainerCustomizer(){ 45 | return new EmbeddedServletContainerCustomizer() { 46 | 47 | //定制嵌入式的Servlet容器相关的规则 48 | @Override 49 | public void customize(ConfigurableEmbeddedServletContainer container) { 50 | container.setPort(8083); 51 | } 52 | }; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/controller/EmployeeController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.controller; 2 | 3 | import com.cuzz.web.dao.DepartmentDao; 4 | import com.cuzz.web.dao.EmployeeDao; 5 | import com.cuzz.web.entities.Department; 6 | import com.cuzz.web.entities.Employee; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import java.util.Collection; 13 | import java.util.List; 14 | 15 | /** 16 | * @Author: cuzz 17 | * @Date: 2018/9/21 18:37 18 | * @Description: 19 | */ 20 | @Controller 21 | public class EmployeeController { 22 | 23 | @Autowired 24 | EmployeeDao employeeDao; 25 | 26 | @Autowired 27 | DepartmentDao departmentDao; 28 | 29 | // 查看员工列表 30 | @GetMapping("emps") 31 | public String list(Model model) { 32 | Collection employees = employeeDao.getAll(); 33 | model.addAttribute("emps", employees); 34 | return "emp/list"; 35 | } 36 | //来到员工添加页面 37 | @GetMapping("/emp") 38 | public String toAddPage(Model model){ 39 | //来到添加页面,查出所有的部门,在页面显示 40 | Collection departments = departmentDao.getDepartments(); 41 | model.addAttribute("depts",departments); 42 | return "emp/add"; 43 | } 44 | 45 | //员工添加 46 | //SpringMVC自动将请求参数和入参对象的属性进行一一绑定;要求请求参数的名字和javaBean入参的对象里面的属性名是一样的 47 | @PostMapping("/emp") 48 | public String addEmp(Employee employee){ 49 | //来到员工列表页面 50 | 51 | System.out.println("保存的员工信息:"+employee); 52 | //保存员工 53 | employeeDao.save(employee); 54 | // redirect: 表示重定向到一个地址 /代表当前项目路径 55 | // forward: 表示转发到一个地址 56 | return "redirect:/emps"; 57 | } 58 | 59 | //来到修改页面,查出当前员工,在页面回显 60 | @GetMapping("/emp/{id}") 61 | public String toEditPage(@PathVariable("id") Integer id, Model model){ 62 | Employee employee = employeeDao.get(id); 63 | model.addAttribute("emp",employee); 64 | 65 | //页面要显示所有的部门列表 66 | Collection departments = departmentDao.getDepartments(); 67 | model.addAttribute("depts",departments); 68 | //回到修改页面(add是一个修改添加二合一的页面); 69 | return "emp/add"; 70 | } 71 | 72 | //员工修改;需要提交员工id; 73 | @PutMapping("/emp") 74 | public String updateEmployee(Employee employee){ 75 | System.out.println("修改的员工数据:"+employee); 76 | employeeDao.save(employee); 77 | return "redirect:/emps"; 78 | } 79 | 80 | //员工删除 81 | @DeleteMapping("/emp/{id}") 82 | public String deleteEmployee(@PathVariable("id") Integer id){ 83 | employeeDao.delete(id); 84 | return "redirect:/emps"; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.controller; 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 java.util.Arrays; 8 | import java.util.Map; 9 | 10 | /** 11 | * @Author: cuzz 12 | * @Date: 2018/9/21 13:48 13 | * @Description: 14 | */ 15 | @Controller 16 | public class HelloController { 17 | 18 | @RequestMapping(value = {"/", "/index"}, method = RequestMethod.GET) 19 | public String index() { 20 | return "login"; 21 | } 22 | 23 | @RequestMapping(value = "/success", method = RequestMethod.GET) 24 | public String success(Map map) { 25 | map.put("hello", "

你好

"); 26 | map.put("users", Arrays.asList("zhangsan", "lisi", "wangwu")); 27 | return "success"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.controller; 2 | import org.springframework.stereotype.Controller; 3 | import org.springframework.util.StringUtils; 4 | import org.springframework.web.bind.annotation.*; 5 | 6 | import javax.servlet.http.HttpSession; 7 | import java.util.Map; 8 | /** 9 | * @Author: cuzz 10 | * @Date: 2018/9/21 16:40 11 | * @Description: 12 | */ 13 | @Controller 14 | public class LoginController { 15 | 16 | // @DeleteMapping 17 | // @PutMapping 18 | // @GetMapping 19 | 20 | //@RequestMapping(value = "/user/login",method = RequestMethod.POST) 21 | @PostMapping(value = "/user/login") 22 | public String login(@RequestParam("username") String username, 23 | @RequestParam("password") String password, 24 | Map map, HttpSession session){ 25 | 26 | if(!StringUtils.isEmpty(username) && "123456".equals(password)){ 27 | //登陆成功,防止表单重复提交,可以重定向到主页 28 | session.setAttribute("loginUser",username); 29 | return "redirect:/main.html"; 30 | }else{ 31 | //登陆失败 32 | map.put("msg","用户名密码错误"); 33 | return "login"; 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/dao/DepartmentDao.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.dao; 2 | 3 | import java.util.Collection; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | import com.cuzz.web.entities.Department; 8 | import org.springframework.stereotype.Repository; 9 | 10 | 11 | @Repository 12 | public class DepartmentDao { 13 | 14 | private static Map departments = null; 15 | 16 | static{ 17 | departments = new HashMap(); 18 | 19 | departments.put(101, new Department(101, "D-AA")); 20 | departments.put(102, new Department(102, "D-BB")); 21 | departments.put(103, new Department(103, "D-CC")); 22 | departments.put(104, new Department(104, "D-DD")); 23 | departments.put(105, new Department(105, "D-EE")); 24 | } 25 | 26 | public Collection getDepartments(){ 27 | return departments.values(); 28 | } 29 | 30 | public Department getDepartment(Integer id){ 31 | return departments.get(id); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/dao/EmployeeDao.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.dao; 2 | 3 | import java.util.Collection; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | import com.cuzz.web.entities.Department; 8 | import com.cuzz.web.entities.Employee; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Repository; 11 | 12 | @Repository 13 | public class EmployeeDao { 14 | 15 | private static Map employees = null; 16 | 17 | @Autowired 18 | private DepartmentDao departmentDao; 19 | 20 | static{ 21 | employees = new HashMap(); 22 | 23 | employees.put(1001, new Employee(1001, "E-AA", "aa@163.com", 1, new Department(101, "D-AA"))); 24 | employees.put(1002, new Employee(1002, "E-BB", "bb@163.com", 1, new Department(102, "D-BB"))); 25 | employees.put(1003, new Employee(1003, "E-CC", "cc@163.com", 0, new Department(103, "D-CC"))); 26 | employees.put(1004, new Employee(1004, "E-DD", "dd@163.com", 0, new Department(104, "D-DD"))); 27 | employees.put(1005, new Employee(1005, "E-EE", "ee@163.com", 1, new Department(105, "D-EE"))); 28 | } 29 | 30 | private static Integer initId = 1006; 31 | 32 | public void save(Employee employee){ 33 | if(employee.getId() == null){ 34 | employee.setId(initId++); 35 | } 36 | 37 | employee.setDepartment(departmentDao.getDepartment(employee.getDepartment().getId())); 38 | employees.put(employee.getId(), employee); 39 | } 40 | 41 | //查询所有员工 42 | public Collection getAll(){ 43 | return employees.values(); 44 | } 45 | 46 | public Employee get(Integer id){ 47 | return employees.get(id); 48 | } 49 | 50 | public void delete(Integer id){ 51 | employees.remove(id); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/entities/Department.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.entities; 2 | 3 | public class Department { 4 | 5 | private Integer id; 6 | private String departmentName; 7 | 8 | public Department() { 9 | } 10 | 11 | public Department(int i, String string) { 12 | this.id = i; 13 | this.departmentName = string; 14 | } 15 | 16 | public Integer getId() { 17 | return id; 18 | } 19 | 20 | public void setId(Integer id) { 21 | this.id = id; 22 | } 23 | 24 | public String getDepartmentName() { 25 | return departmentName; 26 | } 27 | 28 | public void setDepartmentName(String departmentName) { 29 | this.departmentName = departmentName; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Department [id=" + id + ", departmentName=" + departmentName + "]"; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/entities/Employee.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.entities; 2 | 3 | import java.util.Date; 4 | 5 | public class Employee { 6 | 7 | private Integer id; 8 | private String lastName; 9 | 10 | private String email; 11 | //1 male, 0 female 12 | private Integer gender; 13 | private Department department; 14 | private Date birth; 15 | 16 | public Integer getId() { 17 | return id; 18 | } 19 | 20 | public void setId(Integer id) { 21 | this.id = id; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public void setLastName(String lastName) { 29 | this.lastName = lastName; 30 | } 31 | 32 | public String getEmail() { 33 | return email; 34 | } 35 | 36 | public void setEmail(String email) { 37 | this.email = email; 38 | } 39 | 40 | public Integer getGender() { 41 | return gender; 42 | } 43 | 44 | public void setGender(Integer gender) { 45 | this.gender = gender; 46 | } 47 | 48 | public Department getDepartment() { 49 | return department; 50 | } 51 | 52 | public void setDepartment(Department department) { 53 | this.department = department; 54 | } 55 | 56 | public Date getBirth() { 57 | return birth; 58 | } 59 | 60 | public void setBirth(Date birth) { 61 | this.birth = birth; 62 | } 63 | public Employee(Integer id, String lastName, String email, Integer gender, 64 | Department department) { 65 | super(); 66 | this.id = id; 67 | this.lastName = lastName; 68 | this.email = email; 69 | this.gender = gender; 70 | this.department = department; 71 | this.birth = new Date(); 72 | } 73 | 74 | public Employee() { 75 | } 76 | 77 | @Override 78 | public String toString() { 79 | return "Employee{" + 80 | "id=" + id + 81 | ", lastName='" + lastName + '\'' + 82 | ", email='" + email + '\'' + 83 | ", gender=" + gender + 84 | ", department=" + department + 85 | ", birth=" + birth + 86 | '}'; 87 | } 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/exception/UserNotExistException.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.exception; 2 | 3 | public class UserNotExistException extends RuntimeException { 4 | 5 | public UserNotExistException() { 6 | super("用户不存在"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/filter/MyFilter.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-04-web-restful/src/main/java/com/cuzz/web/filter/MyFilter.java -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/listener/MyListener.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.listener; 2 | 3 | import javax.servlet.ServletContextEvent; 4 | import javax.servlet.ServletContextListener; 5 | 6 | public class MyListener implements ServletContextListener { 7 | @Override 8 | public void contextInitialized(ServletContextEvent sce) { 9 | System.out.println("contextInitialized...web应用启动"); 10 | } 11 | 12 | @Override 13 | public void contextDestroyed(ServletContextEvent sce) { 14 | System.out.println("contextDestroyed...当前web项目销毁"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/java/com/cuzz/web/servlet/MyServlet.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web.servlet; 2 | 3 | import javax.servlet.ServletException; 4 | import javax.servlet.http.HttpServlet; 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | import java.io.IOException; 8 | 9 | public class MyServlet extends HttpServlet { 10 | 11 | //处理get请求 12 | @Override 13 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 14 | doPost(req,resp); 15 | } 16 | 17 | @Override 18 | protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 19 | resp.getWriter().write("Hello MyServlet"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | server.tomcat.uri-encoding=UTF-8 3 | 4 | # \u6307\u5B9A\u56FD\u9645\u5316\u5305\u540D 5 | spring.messages.basename=i18n.login 6 | 7 | # \u5F00\u53D1\u662F\u7981\u7528\u6A21\u677F\u5F15\u64CE 8 | spring.thymeleaf.cache=false 9 | 10 | 11 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/i18n/login.properties: -------------------------------------------------------------------------------- 1 | login.btn=登入 2 | login.password=密码 3 | login.remember=记住我 4 | login.tip=请登入 5 | login.username=用户名 6 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/i18n/login_en_US.properties: -------------------------------------------------------------------------------- 1 | login.btn=Sign In 2 | login.password=Password 3 | login.remember=Remember Me 4 | login.tip=Please sign in 5 | login.username=UserName -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/i18n/login_zh_CN.properties: -------------------------------------------------------------------------------- 1 | login.btn=登入 2 | login.password=密码 3 | login.remember=记住我 4 | login.tip=请登入 5 | login.username=用户名 -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

首页

9 | 10 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/resources/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-04-web-restful/src/main/resources/resources/favicon.ico -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/springmvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/static/asserts/css/dashboard.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: .875rem; 3 | } 4 | 5 | .feather { 6 | width: 16px; 7 | height: 16px; 8 | vertical-align: text-bottom; 9 | } 10 | 11 | /* 12 | * Sidebar 13 | */ 14 | 15 | .sidebar { 16 | position: fixed; 17 | top: 0; 18 | bottom: 0; 19 | left: 0; 20 | z-index: 100; /* Behind the navbar */ 21 | padding: 0; 22 | box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1); 23 | } 24 | 25 | .sidebar-sticky { 26 | position: -webkit-sticky; 27 | position: sticky; 28 | top: 48px; /* Height of navbar */ 29 | height: calc(100vh - 48px); 30 | padding-top: .5rem; 31 | overflow-x: hidden; 32 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 33 | } 34 | 35 | .sidebar .nav-link { 36 | font-weight: 500; 37 | color: #333; 38 | } 39 | 40 | .sidebar .nav-link .feather { 41 | margin-right: 4px; 42 | color: #999; 43 | } 44 | 45 | .sidebar .nav-link.active { 46 | color: #007bff; 47 | } 48 | 49 | .sidebar .nav-link:hover .feather, 50 | .sidebar .nav-link.active .feather { 51 | color: inherit; 52 | } 53 | 54 | .sidebar-heading { 55 | font-size: .75rem; 56 | text-transform: uppercase; 57 | } 58 | 59 | /* 60 | * Navbar 61 | */ 62 | 63 | .navbar-brand { 64 | padding-top: .75rem; 65 | padding-bottom: .75rem; 66 | font-size: 1rem; 67 | background-color: rgba(0, 0, 0, .25); 68 | box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25); 69 | } 70 | 71 | .navbar .form-control { 72 | padding: .75rem 1rem; 73 | border-width: 0; 74 | border-radius: 0; 75 | } 76 | 77 | .form-control-dark { 78 | color: #fff; 79 | background-color: rgba(255, 255, 255, .1); 80 | border-color: rgba(255, 255, 255, .1); 81 | } 82 | 83 | .form-control-dark:focus { 84 | border-color: transparent; 85 | box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); 86 | } 87 | 88 | /* 89 | * Utilities 90 | */ 91 | 92 | .border-top { border-top: 1px solid #e5e5e5; } 93 | .border-bottom { border-bottom: 1px solid #e5e5e5; } 94 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/static/asserts/css/signin.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | height: 100%; 4 | } 5 | 6 | body { 7 | display: -ms-flexbox; 8 | display: -webkit-box; 9 | display: flex; 10 | -ms-flex-align: center; 11 | -ms-flex-pack: center; 12 | -webkit-box-align: center; 13 | align-items: center; 14 | -webkit-box-pack: center; 15 | justify-content: center; 16 | padding-top: 40px; 17 | padding-bottom: 40px; 18 | /*background-color: #f5f5f5;*/ 19 | } 20 | 21 | .form-signin { 22 | width: 100%; 23 | max-width: 330px; 24 | padding: 15px; 25 | margin: 0 auto; 26 | } 27 | .form-signin .checkbox { 28 | font-weight: 400; 29 | } 30 | .form-signin .form-control { 31 | position: relative; 32 | box-sizing: border-box; 33 | height: auto; 34 | padding: 10px; 35 | font-size: 16px; 36 | } 37 | .form-signin .form-control:focus { 38 | z-index: 2; 39 | } 40 | .form-signin input[type="email"] { 41 | margin-bottom: -1px; 42 | border-bottom-right-radius: 0; 43 | border-bottom-left-radius: 0; 44 | } 45 | .form-signin input[type="password"] { 46 | margin-bottom: 10px; 47 | border-top-left-radius: 0; 48 | border-top-right-radius: 0; 49 | } 50 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/static/asserts/img/bootstrap-solid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Signin Template for Bootstrap 9 | 10 | 11 | 12 | 13 | 14 | 15 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/main/resources/templates/success.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

成功!

9 | 10 |
这是显示欢迎信息
11 |
12 |
13 |
14 |
15 | 16 | a 17 |

18 |
19 |

20 | [[${user}]] 21 |

22 |
23 | 24 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /springboot-04-web-restful/src/test/java/com/cuzz/web/WebApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.web; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class WebApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-06-data-jdbc/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.5.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-jdbc 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-web 35 | 36 | 37 | 38 | mysql 39 | mysql-connector-java 40 | runtime 41 | 42 | 43 | org.springframework.boot 44 | spring-boot-starter-test 45 | test 46 | 47 | 48 | 49 | 50 | 51 | 52 | org.springframework.boot 53 | spring-boot-maven-plugin 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /springboot-06-data-jdbc/src/main/java/com/cuzz/springboot/SpringbootApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-06-data-jdbc/src/main/java/com/cuzz/springboot/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.jdbc.core.JdbcTemplate; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | /** 13 | * @Author: cuzz 14 | * @Date: 2018/9/22 17:09 15 | * @Description: 16 | */ 17 | @Controller 18 | public class HelloController { 19 | 20 | @Autowired 21 | JdbcTemplate jdbcTemplate; 22 | 23 | @GetMapping("/query") 24 | @ResponseBody 25 | public Map map() { 26 | List> list = jdbcTemplate.queryForList("SELECT * FROM login"); 27 | return list.get(0); 28 | } 29 | 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /springboot-06-data-jdbc/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-06-data-jdbc/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-06-data-jdbc/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | username: root 4 | password: 123456 5 | url: jdbc:mysql://127.0.0.1:3306/jdbc?characterEncoding=utf-8 6 | driver-class-name: com.mysql.jdbc.Driver 7 | # type: com.alibaba.druid.pool.DruidDataSource -------------------------------------------------------------------------------- /springboot-06-data-jdbc/src/test/java/com/cuzz/springboot/SpringbootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringbootApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-06-data-jpa/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.5.4.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-data-jpa 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-jdbc 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-starter-web 39 | 40 | 41 | 42 | mysql 43 | mysql-connector-java 44 | runtime 45 | 46 | 47 | org.springframework.boot 48 | spring-boot-starter-test 49 | test 50 | 51 | 52 | 53 | 54 | 55 | 56 | org.springframework.boot 57 | spring-boot-maven-plugin 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /springboot-06-data-jpa/src/main/java/com/cuzz/springboot/SpringbootApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-06-data-jpa/src/main/java/com/cuzz/springboot/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.controller; 2 | 3 | import com.cuzz.springboot.entity.User; 4 | import com.cuzz.springboot.repository.UserRepository; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | 11 | @RestController 12 | public class UserController { 13 | 14 | @Autowired 15 | UserRepository userRepository; 16 | 17 | @GetMapping("/user/{id}") 18 | public User getUser(@PathVariable("id") Integer id) { 19 | // 用2.0这快会报错 换1.5就好了 20 | // Error:(19, 35) java: 无法将接口 org.springframework.data.repository.query.QueryByExampleExecutor中的方法 findOne应用到给定类型; 21 | // 需要: org.springframework.data.domain.Example 22 | // 找到: java.lang.Integer 23 | // 原因: 无法推断类型变量 S 24 | // (参数不匹配; java.lang.Integer无法转换为org.springframework.data.domain.Example) 25 | User user = userRepository.findOne(id); 26 | return null; 27 | } 28 | 29 | @GetMapping("/user") 30 | public User insertUser(User user) { 31 | User save = userRepository.save(user); 32 | return save; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /springboot-06-data-jpa/src/main/java/com/cuzz/springboot/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.entity; 2 | 3 | 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.Table; 10 | 11 | @Entity 12 | @Table(name = "tbl_user") 13 | public class User { 14 | 15 | @Id 16 | @GeneratedValue(strategy = GenerationType.IDENTITY) 17 | private Integer id; 18 | 19 | @Column(name = "last_name", length = 50) 20 | private String lastName; 21 | 22 | @Column 23 | private String email; 24 | 25 | public Integer getId() { 26 | return id; 27 | } 28 | 29 | public void setId(Integer id) { 30 | this.id = id; 31 | } 32 | 33 | public String getLastName() { 34 | return lastName; 35 | } 36 | 37 | public void setLastName(String lastName) { 38 | this.lastName = lastName; 39 | } 40 | 41 | public String getEmail() { 42 | return email; 43 | } 44 | 45 | public void setEmail(String email) { 46 | this.email = email; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /springboot-06-data-jpa/src/main/java/com/cuzz/springboot/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.repository; 2 | 3 | import com.cuzz.springboot.entity.User; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | 7 | public interface UserRepository extends JpaRepository { 8 | } 9 | -------------------------------------------------------------------------------- /springboot-06-data-jpa/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-06-data-jpa/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-06-data-jpa/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://127.0.0.1:3306/jpa 4 | username: root 5 | password: 123456 6 | driver-class-name: com.mysql.jdbc.Driver 7 | jpa: 8 | hibernate: 9 | # 更新或者创建数据表结构 10 | ddl-auto: update 11 | # 控制台显示SQL 12 | show-sql: true 13 | -------------------------------------------------------------------------------- /springboot-06-data-jpa/src/test/java/com/cuzz/springboot/SpringbootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringbootApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.5.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-jdbc 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-web 35 | 36 | 37 | org.mybatis.spring.boot 38 | mybatis-spring-boot-starter 39 | 1.3.2 40 | 41 | 42 | com.alibaba 43 | druid 44 | 1.1.2 45 | 46 | 47 | 48 | mysql 49 | mysql-connector-java 50 | runtime 51 | 52 | 53 | org.springframework.boot 54 | spring-boot-starter-test 55 | test 56 | 57 | 58 | com.alibaba 59 | druid 60 | LATEST 61 | 62 | 63 | 64 | log4j 65 | log4j 66 | 1.2.17 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | org.springframework.boot 75 | spring-boot-maven-plugin 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/java/com/cuzz/springboot/SpringbootApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cache.annotation.EnableCaching; 7 | 8 | @MapperScan(value = "com.cuzz.springboot.mapper") 9 | @SpringBootApplication 10 | public class SpringbootApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringbootApplication.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/java/com/cuzz/springboot/bean/Department.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.bean; 2 | 3 | public class Department { 4 | 5 | private Integer id; 6 | private String departmentName; 7 | 8 | public void setId(Integer id) { 9 | this.id = id; 10 | } 11 | 12 | public void setDepartmentName(String departmentName) { 13 | this.departmentName = departmentName; 14 | } 15 | 16 | public Integer getId() { 17 | return id; 18 | } 19 | 20 | public String getDepartmentName() { 21 | return departmentName; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/java/com/cuzz/springboot/bean/Employee.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.bean; 2 | 3 | public class Employee { 4 | 5 | private Integer id; 6 | private String lastName; 7 | private Integer gender; 8 | private String email; 9 | private Integer dId; 10 | 11 | public void setId(Integer id) { 12 | this.id = id; 13 | } 14 | 15 | public void setLastName(String lastName) { 16 | this.lastName = lastName; 17 | } 18 | 19 | public void setGender(Integer gender) { 20 | this.gender = gender; 21 | } 22 | 23 | public void setEmail(String email) { 24 | this.email = email; 25 | } 26 | 27 | public void setdId(Integer dId) { 28 | this.dId = dId; 29 | } 30 | 31 | public Integer getId() { 32 | return id; 33 | } 34 | 35 | public String getLastName() { 36 | return lastName; 37 | } 38 | 39 | public Integer getGender() { 40 | return gender; 41 | } 42 | 43 | public String getEmail() { 44 | return email; 45 | } 46 | 47 | public Integer getdId() { 48 | return dId; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/java/com/cuzz/springboot/config/DruidConfig.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.config; 2 | 3 | import java.util.Arrays; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | import javax.sql.DataSource; 8 | 9 | import org.springframework.boot.context.properties.ConfigurationProperties; 10 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 11 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 12 | import org.springframework.context.annotation.Bean; 13 | import org.springframework.context.annotation.Configuration; 14 | 15 | import com.alibaba.druid.pool.DruidDataSource; 16 | import com.alibaba.druid.support.http.StatViewServlet; 17 | import com.alibaba.druid.support.http.WebStatFilter; 18 | 19 | @Configuration 20 | public class DruidConfig { 21 | 22 | @ConfigurationProperties(prefix = "spring.datasource") 23 | @Bean 24 | public DataSource druid() { 25 | return new DruidDataSource(); 26 | } 27 | 28 | //配置Druid的监控 29 | //1、配置一个管理后台的Servlet 30 | @Bean 31 | public ServletRegistrationBean statViewServlet() { 32 | ServletRegistrationBean bean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*"); 33 | Map initParams = new HashMap<>(); 34 | 35 | initParams.put("loginUsername", "admin"); 36 | initParams.put("loginPassword", "123456"); 37 | //默认就是允许所有访问 38 | initParams.put("allow", ""); 39 | initParams.put("deny", "192.168.15.21"); 40 | 41 | bean.setInitParameters(initParams); 42 | return bean; 43 | } 44 | 45 | 46 | //2、配置一个web监控的filter 47 | @Bean 48 | public FilterRegistrationBean webStatFilter() { 49 | FilterRegistrationBean bean = new FilterRegistrationBean(); 50 | bean.setFilter(new WebStatFilter()); 51 | 52 | Map initParams = new HashMap<>(); 53 | initParams.put("exclusions", "*.js,*.css,/druid/*"); 54 | 55 | bean.setInitParameters(initParams); 56 | 57 | bean.setUrlPatterns(Arrays.asList("/*")); 58 | 59 | return bean; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/java/com/cuzz/springboot/config/MyBatisConfig.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.config; 2 | 3 | import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class MyBatisConfig { 9 | 10 | @Bean 11 | public ConfigurationCustomizer configurationCustomizer() { 12 | return configuration -> configuration.setMapUnderscoreToCamelCase(true); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/java/com/cuzz/springboot/controller/DeptController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.controller; 2 | 3 | 4 | import com.cuzz.springboot.bean.Department; 5 | import com.cuzz.springboot.bean.Employee; 6 | import com.cuzz.springboot.mapper.DepartmentMapper; 7 | import com.cuzz.springboot.mapper.EmployeeMapper; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.transaction.annotation.Transactional; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | @RestController 15 | public class DeptController { 16 | 17 | @Autowired 18 | DepartmentMapper departmentMapper; 19 | 20 | @Autowired 21 | EmployeeMapper employeeMapper; 22 | 23 | 24 | @GetMapping("/dept/{id}") 25 | public Department getDepartment(@PathVariable("id") Integer id) { 26 | return departmentMapper.getDeptById(id); 27 | } 28 | 29 | @GetMapping("/dept") 30 | @Transactional 31 | public Department insertDept(Department department) { 32 | departmentMapper.insertDept(department); 33 | System.err.println("Inserted successfully"); 34 | System.err.println("---> 1/0 = " + (1 / 0)); 35 | return department; 36 | } 37 | 38 | @GetMapping("/emp/{id}") 39 | public Employee getEmp(@PathVariable("id") Integer id) { 40 | return employeeMapper.getEmpById(id); 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/java/com/cuzz/springboot/mapper/DepartmentMapper.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.mapper; 2 | 3 | import com.cuzz.springboot.bean.Department; 4 | import org.apache.ibatis.annotations.*; 5 | 6 | 7 | /** 8 | * 指定这是一个操作数据库的mapper 9 | */ 10 | @Mapper 11 | public interface DepartmentMapper { 12 | 13 | @Select("select * from department where id=#{id}") 14 | Department getDeptById(Integer id); 15 | 16 | @Delete("delete from department where id=#{id}") 17 | int deleteDeptById(Integer id); 18 | 19 | @Options(useGeneratedKeys = true, keyProperty = "id") 20 | @Insert("insert into department(department_name) values(#{departmentName})") 21 | int insertDept(Department department); 22 | 23 | @Update("update department set department_name=#{departmentName} where id=#{id}") 24 | int updateDept(Department department); 25 | } 26 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/java/com/cuzz/springboot/mapper/EmployeeMapper.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot.mapper; 2 | 3 | 4 | import com.cuzz.springboot.bean.Employee; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * @Mapper 或者 @MapperScan 将接口扫描装配到容器中 9 | */ 10 | public interface EmployeeMapper { 11 | 12 | Employee getEmpById(Integer id); 13 | 14 | void insertEmp(Employee employee); 15 | } 16 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-06-data-mybatis/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | username: root 4 | password: 123456 5 | driver-class-name: com.mysql.jdbc.Driver 6 | url: jdbc:mysql://127.0.0.1:3306/jdbc?characterEncoding=utf-8 7 | type: com.alibaba.druid.pool.DruidDataSource 8 | # 数据源其他配置 9 | initialSize: 5 10 | minIdle: 5 11 | maxActive: 20 12 | maxWait: 60000 13 | timeBetweenEvictionRunsMillis: 60000 14 | minEvictableIdleTimeMillis: 300000 15 | validationQuery: SELECT 1 FROM DUAL 16 | testWhileIdle: true 17 | testOnBorrow: false 18 | testOnReturn: false 19 | poolPreparedStatements: true 20 | # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 21 | filters: stat,wall,log4j 22 | maxPoolPreparedStatementPerConnectionSize: 20 23 | useGlobalDataSourceStat: true 24 | connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500 25 | # 新建表 26 | schema: 27 | - classpath:sql/department.sql 28 | - classpath:sql/employee.sql 29 | 30 | mybatis: 31 | # 指定全局配置文件位置 32 | config-location: classpath:mybatis/mybatis-config.xml 33 | # 指定sql映射文件位置 34 | mapper-locations: classpath:mybatis/mapper/*.xml 35 | 36 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/resources/mybatis/mapper/EmployeeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | INSERT INTO employee(lastName, email, gender, d_id) VALUES (#{lastName}, #{email}, #{gender}, #{dId}) 14 | 15 | 16 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/resources/mybatis/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/resources/sql/department.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : 本地 5 | Source Server Version : 50528 6 | Source Host : 127.0.0.1:3306 7 | Source Database : restful_crud 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50528 11 | File Encoding : 65001 12 | 13 | Date: 2018-03-05 10:41:40 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS = 0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for department 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `department`; 22 | CREATE TABLE `department` ( 23 | `id` INT(11) NOT NULL AUTO_INCREMENT, 24 | `departmentName` VARCHAR(255) DEFAULT NULL, 25 | PRIMARY KEY (`id`) 26 | ) 27 | ENGINE = InnoDB 28 | AUTO_INCREMENT = 1 29 | DEFAULT CHARSET = utf8; 30 | 31 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/main/resources/sql/employee.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : 本地 5 | Source Server Version : 50528 6 | Source Host : 127.0.0.1:3306 7 | Source Database : restful_crud 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50528 11 | File Encoding : 65001 12 | 13 | Date: 2018-03-05 10:41:58 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS = 0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for employee 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `employee`; 22 | CREATE TABLE `employee` ( 23 | `id` INT(11) NOT NULL AUTO_INCREMENT, 24 | `lastName` VARCHAR(255) DEFAULT NULL, 25 | `email` VARCHAR(255) DEFAULT NULL, 26 | `gender` INT(2) DEFAULT NULL, 27 | `d_id` INT(11) DEFAULT NULL, 28 | PRIMARY KEY (`id`) 29 | ) 30 | ENGINE = InnoDB 31 | AUTO_INCREMENT = 1 32 | DEFAULT CHARSET = utf8; 33 | -------------------------------------------------------------------------------- /springboot-06-data-mybatis/src/test/java/com/cuzz/springboot/SpringbootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.springboot; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringbootApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-09-cache/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot-09-cache 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot-09-cache 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.5.16.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-cache 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-web 35 | 36 | 37 | org.mybatis.spring.boot 38 | mybatis-spring-boot-starter 39 | 1.3.2 40 | 41 | 42 | 43 | mysql 44 | mysql-connector-java 45 | runtime 46 | 47 | 48 | org.springframework.boot 49 | spring-boot-starter-data-redis 50 | 51 | 52 | org.springframework.boot 53 | spring-boot-starter-test 54 | test 55 | 56 | 57 | 58 | 59 | 60 | 61 | org.springframework.boot 62 | spring-boot-maven-plugin 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /springboot-09-cache/src/main/java/com/cuzz/cache/Springboot07CacheApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cache.annotation.EnableCaching; 7 | 8 | @MapperScan("com.cuzz.cache.mapper") 9 | @SpringBootApplication 10 | @EnableCaching 11 | public class Springboot07CacheApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(Springboot07CacheApplication.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /springboot-09-cache/src/main/java/com/cuzz/cache/bean/Department.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | public class Department implements Serializable{ 6 | private Integer id; 7 | private String deptName; 8 | 9 | public Department(){ 10 | 11 | } 12 | 13 | public Department(Integer id, String deptName) { 14 | this.id = id; 15 | this.deptName = deptName; 16 | } 17 | 18 | public Integer getId() { 19 | return id; 20 | } 21 | 22 | public void setId(Integer id) { 23 | this.id = id; 24 | } 25 | 26 | public String getDeptName() { 27 | return deptName; 28 | } 29 | 30 | public void setDeptName(String deptName) { 31 | this.deptName = deptName; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return "Department{" + 37 | "id=" + id + 38 | ", deptName='" + deptName + '\'' + 39 | '}'; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /springboot-09-cache/src/main/java/com/cuzz/cache/bean/Employee.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | public class Employee implements Serializable { 6 | private Integer id; 7 | private String lastName; 8 | private String gender; 9 | private String email; 10 | private Integer dId; 11 | 12 | public Employee() { 13 | } 14 | 15 | public Integer getId() { 16 | return id; 17 | } 18 | 19 | public void setId(Integer id) { 20 | this.id = id; 21 | } 22 | 23 | public String getLastName() { 24 | return lastName; 25 | } 26 | 27 | public void setLastName(String lastName) { 28 | this.lastName = lastName; 29 | } 30 | 31 | public String getGender() { 32 | return gender; 33 | } 34 | 35 | public void setGender(String gender) { 36 | this.gender = gender; 37 | } 38 | 39 | public String getEmail() { 40 | return email; 41 | } 42 | 43 | public void setEmail(String email) { 44 | this.email = email; 45 | } 46 | 47 | public Integer getdId() { 48 | return dId; 49 | } 50 | 51 | public void setdId(Integer dId) { 52 | this.dId = dId; 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | return "Employee{" + 58 | "id=" + id + 59 | ", lastName='" + lastName + '\'' + 60 | ", gender='" + gender + '\'' + 61 | ", email='" + email + '\'' + 62 | ", dId=" + dId + 63 | '}'; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /springboot-09-cache/src/main/java/com/cuzz/cache/config/MyCacheConfig.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache.config; 2 | 3 | import org.springframework.cache.interceptor.KeyGenerator; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | import java.lang.reflect.Method; 8 | import java.util.Arrays; 9 | 10 | 11 | /** 12 | * @Author: cuzz 13 | * @Date: 2018/9/26 18:39 14 | * @Description: 15 | */ 16 | @Configuration 17 | public class MyCacheConfig { 18 | 19 | @Bean("myKeyGenerator") 20 | public KeyGenerator keyGenerator() { 21 | return new KeyGenerator() { 22 | @Override 23 | public Object generate(Object o, Method method, Object... objects) { 24 | return method.getName() + "[" + Arrays.asList(objects) + "]"; 25 | } 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /springboot-09-cache/src/main/java/com/cuzz/cache/config/MyRedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache.config; 2 | 3 | import com.cuzz.cache.bean.Department; 4 | import com.cuzz.cache.bean.Employee; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.annotation.Primary; 8 | import org.springframework.data.redis.cache.RedisCacheManager; 9 | import org.springframework.data.redis.connection.RedisConnectionFactory; 10 | import org.springframework.data.redis.core.RedisTemplate; 11 | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; 12 | 13 | import java.net.UnknownHostException; 14 | 15 | /** 16 | * @Author: cuzz 17 | * @Date: 2018/9/26 23:50 18 | * @Description: 19 | */ 20 | @Configuration 21 | public class MyRedisConfig { 22 | // Employee 23 | @Bean 24 | public RedisTemplate empRedisTemplate( 25 | RedisConnectionFactory redisConnectionFactory) 26 | throws UnknownHostException { 27 | RedisTemplate template = new RedisTemplate(); 28 | template.setConnectionFactory(redisConnectionFactory); 29 | Jackson2JsonRedisSerializer jsonRedisSerializer = new Jackson2JsonRedisSerializer(Employee.class); 30 | template.setDefaultSerializer(jsonRedisSerializer); 31 | return template; 32 | } 33 | // Employee 34 | @Primary // 有多个cacheManager需要制定一个默认的 35 | @Bean 36 | public RedisCacheManager employeeCacheManager(RedisTemplate empRedisTemplate) { 37 | RedisCacheManager cacheManager = new RedisCacheManager(empRedisTemplate); 38 | cacheManager.setUsePrefix(true); 39 | return cacheManager; 40 | } 41 | 42 | // Department 43 | @Bean 44 | public RedisTemplate deptRedisTemplate( 45 | RedisConnectionFactory redisConnectionFactory) 46 | throws UnknownHostException { 47 | RedisTemplate template = new RedisTemplate(); 48 | template.setConnectionFactory(redisConnectionFactory); 49 | Jackson2JsonRedisSerializer jsonRedisSerializer = new Jackson2JsonRedisSerializer(Department.class); 50 | template.setDefaultSerializer(jsonRedisSerializer); 51 | return template; 52 | } 53 | 54 | // Department 55 | @Bean 56 | public RedisCacheManager departmentCacheManager(RedisTemplate deptRedisTemplate) { 57 | RedisCacheManager cacheManager = new RedisCacheManager(deptRedisTemplate); 58 | cacheManager.setUsePrefix(true); 59 | return cacheManager; 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /springboot-09-cache/src/main/java/com/cuzz/cache/controller/EmployeeController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache.controller; 2 | 3 | import com.cuzz.cache.bean.Employee; 4 | import com.cuzz.cache.service.EmployeeService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * @Author: cuzz 13 | * @Date: 2018/9/26 16:10 14 | * @Description: 15 | */ 16 | @RestController 17 | public class EmployeeController { 18 | 19 | @Autowired 20 | EmployeeService employeeService; 21 | 22 | @GetMapping("/emp/{id}") 23 | public Employee getEmployee(@PathVariable("id") Integer id) { 24 | return employeeService.getEmployee(id); 25 | } 26 | 27 | @GetMapping("/emp") 28 | public Employee update(Employee employee) { 29 | return employeeService.updateEmployee(employee); 30 | } 31 | 32 | @GetMapping("/delete") 33 | public String delete(Integer id) { 34 | employeeService.deleteEmployee(id); 35 | return "success"; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /springboot-09-cache/src/main/java/com/cuzz/cache/mapper/DepartmentMapper.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache.mapper; 2 | 3 | import org.apache.ibatis.annotations.Mapper; 4 | 5 | /** 6 | * @Author: cuzz 7 | * @Date: 2018/9/26 15:54 8 | * @Description: 9 | */ 10 | @Mapper 11 | public interface DepartmentMapper { 12 | } 13 | -------------------------------------------------------------------------------- /springboot-09-cache/src/main/java/com/cuzz/cache/mapper/EmployeeMapper.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache.mapper; 2 | 3 | import com.cuzz.cache.bean.Employee; 4 | import org.apache.ibatis.annotations.Delete; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Select; 7 | import org.apache.ibatis.annotations.Update; 8 | 9 | /** 10 | * @Author: cuzz 11 | * @Date: 2018/9/26 15:54 12 | * @Description: 13 | */ 14 | @Mapper 15 | public interface EmployeeMapper { 16 | 17 | @Select("SELECT * FROM employee WHERE id = #{id}") 18 | Employee getEmployeeById(Integer id); 19 | 20 | @Update("UPDATE employee SET last_name=#{lastName},email=#{email},gender=#{gender},d_id=#{dId} WHERE id=#{id}") 21 | void updateEmp(Employee employee); 22 | 23 | @Delete("DELETE FROM employee WHERE employee.id=#{id}") 24 | void deleteEmp(Integer id); 25 | 26 | @Select("SELECT * FROM employee WHERE last_name=#{lastName}") 27 | Employee getEmpByLastName(String lastName); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /springboot-09-cache/src/main/java/com/cuzz/cache/service/EmployeeService.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache.service; 2 | 3 | import com.cuzz.cache.bean.Employee; 4 | import com.cuzz.cache.mapper.EmployeeMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.cache.annotation.*; 7 | import org.springframework.stereotype.Service; 8 | 9 | import javax.sound.midi.Soundbank; 10 | 11 | /** 12 | * @Author: cuzz 13 | * @Date: 2018/9/26 16:08 14 | * @Description: 15 | */ 16 | @CacheConfig(cacheNames = "emp", cacheManager = "employeeCacheManager") 17 | @Service 18 | public class EmployeeService { 19 | 20 | @Autowired 21 | EmployeeMapper employeeMapper; 22 | 23 | // @Cacheable(cacheNames = "emp", keyGenerator = "myKeyGenerator") 24 | @Cacheable(cacheNames = "emp") 25 | public Employee getEmployee(Integer id) { 26 | System.out.println("----> 查询" + id + "号员工"); 27 | return employeeMapper.getEmployeeById(id); 28 | } 29 | 30 | @CachePut(value = {"emp"}, key = "#result.id") 31 | public Employee updateEmployee(Employee employee) { 32 | System.out.println("---->updateEmployee"+employee); 33 | employeeMapper.updateEmp(employee); 34 | return employee; 35 | } 36 | 37 | @CacheEvict(value = "emp",key = "#id") 38 | public void deleteEmployee(Integer id){ 39 | System.out.println("---->删除的employee的id是: "+id); 40 | } 41 | 42 | 43 | @Caching( 44 | cacheable = { 45 | @Cacheable(value = "emp",key = "#lastName") 46 | }, 47 | put = { 48 | @CachePut(value = "emp",key = "#result.id"), 49 | @CachePut(value = "emp",key = "#result.gender") 50 | } 51 | ) 52 | public Employee getEmployeeByLastName(String lastName) { 53 | return employeeMapper.getEmpByLastName(lastName); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /springboot-09-cache/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 2 | spring.datasource.url=jdbc:mysql://localhost:3306/spring_cache 3 | spring.datasource.username=root 4 | spring.datasource.password=123456 5 | # \u5F00\u542F\u9A7C\u5CF0\u547D\u540D\u5339\u914D 6 | mybatis.configuration.map-underscore-to-camel-case=true 7 | # \u6253\u5370sql 8 | logging.level.com.cuzz.cache.mapper=debug 9 | # \u53EF\u4EE5\u6253\u5370\u914D\u7F6E\u62A5\u544A 10 | debug=true 11 | spring.redis.host=10.137.242.105 -------------------------------------------------------------------------------- /springboot-09-cache/src/main/resources/sql/department.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : 本地 5 | Source Server Version : 50528 6 | Source Host : 127.0.0.1:3306 7 | Source Database : restful_crud 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50528 11 | File Encoding : 65001 12 | 13 | Date: 2018-03-05 10:41:40 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS = 0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for department 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `department`; 22 | CREATE TABLE `department` ( 23 | `id` INT(11) NOT NULL AUTO_INCREMENT, 24 | `departmentName` VARCHAR(255) DEFAULT NULL, 25 | PRIMARY KEY (`id`) 26 | ) 27 | ENGINE = InnoDB 28 | AUTO_INCREMENT = 1 29 | DEFAULT CHARSET = utf8; 30 | 31 | -------------------------------------------------------------------------------- /springboot-09-cache/src/main/resources/sql/employee.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : 本地 5 | Source Server Version : 50528 6 | Source Host : 127.0.0.1:3306 7 | Source Database : restful_crud 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50528 11 | File Encoding : 65001 12 | 13 | Date: 2018-03-05 10:41:58 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS = 0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for employee 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `employee`; 22 | CREATE TABLE `employee` ( 23 | `id` INT(11) NOT NULL AUTO_INCREMENT, 24 | `lastName` VARCHAR(255) DEFAULT NULL, 25 | `email` VARCHAR(255) DEFAULT NULL, 26 | `gender` INT(2) DEFAULT NULL, 27 | `d_id` INT(11) DEFAULT NULL, 28 | PRIMARY KEY (`id`) 29 | ) 30 | ENGINE = InnoDB 31 | AUTO_INCREMENT = 1 32 | DEFAULT CHARSET = utf8; 33 | -------------------------------------------------------------------------------- /springboot-09-cache/src/test/java/com/cuzz/cache/Springboot07CacheApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.data.redis.core.RedisTemplate; 8 | import org.springframework.data.redis.core.StringRedisTemplate; 9 | import org.springframework.test.context.junit4.SpringRunner; 10 | 11 | @RunWith(SpringRunner.class) 12 | @SpringBootTest 13 | public class Springboot07CacheApplicationTests { 14 | 15 | @Autowired 16 | StringRedisTemplate stringRedisTemplate; // 操作字符串的 17 | 18 | @Autowired 19 | RedisTemplate redisTemplate; // k-v 都是对象 20 | 21 | @Test 22 | public void contextLoads() { 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /springboot-09-cache/src/test/java/com/cuzz/cache/mapper/DepartmentMapper.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.cache.mapper; 2 | 3 | import com.cuzz.cache.bean.Employee; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.test.context.junit4.SpringRunner; 9 | 10 | /** 11 | * @Author: cuzz 12 | * @Date: 2018/9/26 16:03 13 | * @Description: 14 | */ 15 | @RunWith(SpringRunner.class) 16 | @SpringBootTest 17 | public class DepartmentMapper { 18 | 19 | @Autowired 20 | EmployeeMapper employeeMapper; 21 | 22 | @Test 23 | public void test() { 24 | Employee employee = employeeMapper.getEmployeeById(1); 25 | System.out.println(employee); 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /springboot-10-amqp/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-10-amqp/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-10-amqp/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-10-amqp/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-10-amqp/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot-10-amqp 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot-10-amqp 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.5.16.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-amqp 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-web 35 | 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-test 40 | test 41 | 42 | 43 | org.projectlombok 44 | lombok 45 | 1.16.22 46 | 47 | 48 | 49 | 50 | 51 | 52 | org.springframework.boot 53 | spring-boot-maven-plugin 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /springboot-10-amqp/src/main/java/com/cuzz/amqp/Springboot10AmqpApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.amqp; 2 | 3 | import org.springframework.amqp.rabbit.annotation.EnableRabbit; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @EnableRabbit // 开启基于注解的RabbitMQ 8 | @SpringBootApplication 9 | public class Springboot10AmqpApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Springboot10AmqpApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot-10-amqp/src/main/java/com/cuzz/amqp/bean/Book.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.amqp.bean; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @Author: cuzz 7 | * @Date: 2018/9/27 14:22 8 | * @Description: 9 | */ 10 | @Data 11 | public class Book { 12 | private String bookName; 13 | private String author; 14 | 15 | public Book(){ 16 | 17 | } 18 | 19 | public Book(String bookName, String author) { 20 | this.bookName = bookName; 21 | this.author = author; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /springboot-10-amqp/src/main/java/com/cuzz/amqp/config/MyAMQPConfig.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.amqp.config; 2 | 3 | import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; 4 | import org.springframework.amqp.support.converter.MessageConverter; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * @Author: cuzz 10 | * @Date: 2018/9/27 14:16 11 | * @Description: 12 | */ 13 | @Configuration 14 | public class MyAMQPConfig { 15 | 16 | @Bean 17 | public MessageConverter messageConverter() { 18 | return new Jackson2JsonMessageConverter(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /springboot-10-amqp/src/main/java/com/cuzz/amqp/service/BookService.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.amqp.service; 2 | 3 | import com.cuzz.amqp.bean.Book; 4 | import org.springframework.amqp.core.Message; 5 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | * @Author: cuzz 10 | * @Date: 2018/9/27 14:34 11 | * @Description: 12 | */ 13 | @Service 14 | public class BookService { 15 | @RabbitListener(queues = "cuzz.news") 16 | public void receive(Book book){ 17 | System.out.println(book); 18 | } 19 | 20 | @RabbitListener(queues = "cuzz") 21 | public void receive02(Message message){ 22 | System.out.println(message.getBody()); 23 | System.out.println(message.getMessageProperties()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /springboot-10-amqp/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-10-amqp/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-10-amqp/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | rabbitmq: 3 | host: 10.138.223.126 4 | port: 5672 5 | username: guest 6 | password: guest 7 | -------------------------------------------------------------------------------- /springboot-10-amqp/src/test/java/com/cuzz/amqp/Springboot10AmqpApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.amqp; 2 | 3 | import com.cuzz.amqp.bean.Book; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.amqp.core.AmqpAdmin; 7 | import org.springframework.amqp.core.Binding; 8 | import org.springframework.amqp.core.DirectExchange; 9 | import org.springframework.amqp.core.Queue; 10 | import org.springframework.amqp.rabbit.core.RabbitTemplate; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.boot.test.context.SpringBootTest; 13 | import org.springframework.test.context.junit4.SpringRunner; 14 | 15 | import java.util.Arrays; 16 | import java.util.HashMap; 17 | import java.util.Map; 18 | 19 | @RunWith(SpringRunner.class) 20 | @SpringBootTest 21 | public class Springboot10AmqpApplicationTests { 22 | 23 | @Autowired 24 | RabbitTemplate rabbitTemplate; 25 | 26 | @Autowired 27 | AmqpAdmin amqpAdmin; 28 | 29 | @Test 30 | public void contextLoads() { 31 | // Message需要自己构建一个;定义消息体内容和消息头 32 | // rabbitTemplate.send(exchange, routingKey, message); 33 | // Object 默认当成消息体,只需要传入要发送的对象,自动化序列发送给rabbitmq; 34 | Map map = new HashMap<>(); 35 | map.put("msg", "这是第一个信息"); 36 | map.put("data", Arrays.asList("HelloWorld", 123, true)); 37 | //对象被默认序列以后发送出去 38 | rabbitTemplate.convertAndSend("exchange.direct","cuzz.news",map); 39 | } 40 | 41 | @Test 42 | public void test() { 43 | // 对象被默认序列以后发送出去 44 | rabbitTemplate.convertAndSend("exchange.direct","cuzz.news", new Book("Effect java", "Joshua Bloch")); 45 | } 46 | 47 | @Test 48 | public void receiveAndConvert(){ 49 | Object o = rabbitTemplate.receiveAndConvert("cuzz.news"); 50 | System.out.println(o.getClass()); 51 | System.out.println(o); 52 | } 53 | 54 | @Test 55 | public void createExchange(){ 56 | amqpAdmin.declareExchange(new DirectExchange("amqpadmin.direct")); 57 | System.out.println("Create Finish"); 58 | } 59 | 60 | @Test 61 | public void createQueue(){ 62 | amqpAdmin.declareQueue(new Queue("amqpadmin.queue",true)); 63 | System.out.println("Create Queue Finish"); 64 | } 65 | @Test 66 | public void createBind(){ 67 | amqpAdmin.declareBinding(new Binding("amqpadmin.queue", Binding.DestinationType.QUEUE , "amqpadmin.direct", "amqp.haha", null)); 68 | } 69 | @Test 70 | public void deleteExchange(){ 71 | amqpAdmin.deleteExchange("amqpadmin.direct"); 72 | System.out.println("delete Finish"); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /springboot-11-elastic/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-11-elastic/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-11-elastic/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-11-elastic/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-11-elastic/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot-11-elastic 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot-11-elastic 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.5.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-starter-data-elasticsearch 32 | 33 | 34 | 35 | io.searchbox 36 | jest 37 | 5.3.3 38 | 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-web 43 | 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 51 | org.projectlombok 52 | lombok 53 | 1.16.22 54 | 55 | 56 | 57 | 58 | 59 | 60 | org.springframework.boot 61 | spring-boot-maven-plugin 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /springboot-11-elastic/src/main/java/com/cuzz/elastic/Springboot11ElasticApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.elastic; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Springboot11ElasticApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Springboot11ElasticApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-11-elastic/src/main/java/com/cuzz/elastic/bean/Article.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.elastic.bean; 2 | 3 | import io.searchbox.annotations.JestId; 4 | import lombok.Data; 5 | 6 | /** 7 | * @Author: cuzz 8 | * @Date: 2018/9/27 17:59 9 | * @Description: 10 | */ 11 | @Data 12 | public class Article { 13 | @JestId 14 | private Integer id; 15 | private String autor; 16 | private String title; 17 | private String content; 18 | 19 | public Article() { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /springboot-11-elastic/src/main/java/com/cuzz/elastic/bean/Book.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.elastic.bean; 2 | 3 | import lombok.Data; 4 | import org.springframework.data.elasticsearch.annotations.Document; 5 | 6 | /** 7 | * @Author: cuzz 8 | * @Date: 2018/9/27 18:32 9 | * @Description: 10 | */ 11 | @Document(indexName = "cuzz",type="book") 12 | @Data 13 | public class Book { 14 | private Integer id; 15 | private String bookName; 16 | private String auto; 17 | 18 | 19 | public Book() { 20 | super(); 21 | } 22 | 23 | public Book(Integer id, String bookName, String auto) { 24 | super(); 25 | this.id = id; 26 | this.bookName = bookName; 27 | this.auto = auto; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /springboot-11-elastic/src/main/java/com/cuzz/elastic/repository/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.elastic.repository; 2 | 3 | import com.cuzz.elastic.bean.Book; 4 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 5 | import org.springframework.data.repository.NoRepositoryBean; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @Author: cuzz 11 | * @Date: 2018/9/27 18:33 12 | * @Description: 13 | */ 14 | public interface BookRepository extends ElasticsearchRepository { 15 | //自定义查询方法 16 | public List findByBookNameLike(String bookName); 17 | } 18 | -------------------------------------------------------------------------------- /springboot-11-elastic/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.data.elasticsearch.cluster-name=elasticsearch 2 | spring.data.elasticsearch.cluster-nodes=10.138.223.126:9301 -------------------------------------------------------------------------------- /springboot-11-elastic/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | elasticsearch: 3 | jest: 4 | uris: http://10.138.223.126:9200 5 | 6 | -------------------------------------------------------------------------------- /springboot-11-elastic/src/test/java/com/cuzz/elastic/Springboot11ElasticApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.elastic; 2 | 3 | import com.cuzz.elastic.bean.Article; 4 | import com.cuzz.elastic.bean.Book; 5 | import com.cuzz.elastic.repository.BookRepository; 6 | import io.searchbox.client.JestClient; 7 | import io.searchbox.core.Index; 8 | import io.searchbox.core.Search; 9 | import io.searchbox.core.SearchResult; 10 | import org.junit.Test; 11 | import org.junit.runner.RunWith; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.boot.test.context.SpringBootTest; 14 | import org.springframework.test.context.junit4.SpringRunner; 15 | 16 | import java.io.IOException; 17 | 18 | @RunWith(SpringRunner.class) 19 | @SpringBootTest 20 | public class Springboot11ElasticApplicationTests { 21 | 22 | @Autowired 23 | JestClient jestClient; 24 | 25 | @Test 26 | public void contextLoads() { 27 | // 给Es中索引(保存)一个文档 28 | Article article = new Article(); 29 | article.setId(1); 30 | article.setTitle("Effect Java"); 31 | article.setAutor("Joshua Bloch"); 32 | article.setContent("Hello World"); 33 | // 构建一个索引功能 34 | Index index = new Index.Builder(article).index("cuzz").type("article").build(); 35 | 36 | try { 37 | //执行 38 | jestClient.execute(index); 39 | } catch (IOException e) { 40 | e.printStackTrace(); 41 | } 42 | } 43 | 44 | @Test 45 | public void search(){ 46 | //查询表达式 47 | String json = "{\n" + 48 | " \"query\" : {\n" + 49 | " \"match\" : {\n" + 50 | " \"content\" : \"Hello\"\n" + 51 | " }\n" + 52 | " }\n" + 53 | "}"; 54 | //构建搜索操作 55 | Search search = new Search.Builder(json).addIndex("cuzz").addType("article").build(); 56 | 57 | //执行 58 | try { 59 | SearchResult result = jestClient.execute(search); 60 | System.out.println(result.getJsonString()); 61 | } catch (IOException e) { 62 | e.printStackTrace(); 63 | } 64 | } 65 | 66 | @Autowired 67 | BookRepository bookRepository; 68 | 69 | @Test 70 | public void testBook() { 71 | Book book = new Book(); 72 | bookRepository.index(book); 73 | } 74 | 75 | @Test 76 | public void testSearch(){ 77 | for (Book book : bookRepository.findByBookNameLike("Effect")) { 78 | System.out.println(book); 79 | } 80 | 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /springboot-12-task/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-12-task/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-12-task/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-12-task/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-12-task/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot-12-task 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot-12-task 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.5.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-mail 35 | 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-test 40 | test 41 | 42 | 43 | 44 | 45 | 46 | 47 | org.springframework.boot 48 | spring-boot-maven-plugin 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /springboot-12-task/src/main/java/com/cuzz/task/Springboot12TaskApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.task; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.Async; 6 | import org.springframework.scheduling.annotation.EnableAsync; 7 | import org.springframework.scheduling.annotation.EnableScheduling; 8 | 9 | 10 | @EnableAsync 11 | @EnableScheduling 12 | @SpringBootApplication 13 | public class Springboot12TaskApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(Springboot12TaskApplication.class, args); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /springboot-12-task/src/main/java/com/cuzz/task/controller/AsynController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.task.controller; 2 | 3 | import com.cuzz.task.service.AsynSerivce; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | * @Author: cuzz 10 | * @Date: 2018/9/28 17:51 11 | * @Description: 12 | */ 13 | @RestController 14 | public class AsynController { 15 | 16 | @Autowired 17 | AsynSerivce asynSerivce; 18 | 19 | @GetMapping("/hello") 20 | public String hello() { 21 | asynSerivce.hello(); 22 | return "success"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /springboot-12-task/src/main/java/com/cuzz/task/service/AsynSerivce.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.task.service; 2 | 3 | import org.springframework.scheduling.annotation.Async; 4 | import org.springframework.stereotype.Service; 5 | 6 | /** 7 | * @Author: cuzz 8 | * @Date: 2018/9/28 17:49 9 | * @Description: 10 | */ 11 | @Service 12 | public class AsynSerivce { 13 | 14 | @Async 15 | public void hello() { 16 | try { 17 | Thread.sleep(3); 18 | } catch (InterruptedException e) { 19 | e.printStackTrace(); 20 | } 21 | System.out.println("处理数据中..."); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /springboot-12-task/src/main/java/com/cuzz/task/service/ScheduledService.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.task.service; 2 | 3 | import com.sun.media.jfxmedia.logging.Logger; 4 | import org.springframework.scheduling.annotation.Scheduled; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.text.SimpleDateFormat; 8 | import java.util.Date; 9 | 10 | /** 11 | * @Author: cuzz 12 | * @Date: 2018/9/29 10:25 13 | * @Description: 14 | */ 15 | @Service 16 | public class ScheduledService { 17 | 18 | // 表示周一到周六当秒为0时执行一次 19 | @Scheduled(cron = "0 * * * * MON-SAT") 20 | public void hello() { 21 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 22 | String date = sdf.format(new Date()); 23 | System.out.println(date + " hello..."); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /springboot-12-task/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mail.username=214769277@qq.com 2 | spring.mail.password=xxxxxxxxxxx 3 | spring.mail.host=smtp.qq.com 4 | spring.mail.properties.mail.stmp.ssl.enable=true -------------------------------------------------------------------------------- /springboot-12-task/src/test/java/com/cuzz/task/Springboot12TaskApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.task; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.mail.SimpleMailMessage; 8 | import org.springframework.mail.javamail.JavaMailSenderImpl; 9 | import org.springframework.test.context.junit4.SpringRunner; 10 | 11 | @RunWith(SpringRunner.class) 12 | @SpringBootTest 13 | public class Springboot12TaskApplicationTests { 14 | 15 | @Autowired 16 | JavaMailSenderImpl mailSender; 17 | 18 | @Test 19 | public void contextLoads() { 20 | SimpleMailMessage message = new SimpleMailMessage(); 21 | 22 | message.setSubject("Hello World"); 23 | message.setText("text"); 24 | 25 | message.setTo("cuzz1234@163.com"); 26 | message.setFrom("214769277@qq.com"); 27 | 28 | mailSender.send(message); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /springboot-13-security/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-13-security/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-13-security/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-13-security/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-13-security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot-13-security 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot-13-security 12 | Demo project for Spring Boot 13 | 14 | org.springframework.boot 15 | spring-boot-starter-parent 16 | 1.5.12.RELEASE 17 | 18 | 19 | 20 | 21 | UTF-8 22 | UTF-8 23 | 1.8 24 | 3.0.9.RELEASE 25 | 2.3.0 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-starter-thymeleaf 38 | 39 | 40 | org.springframework.boot 41 | spring-boot-starter-security 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-starter-web 46 | 47 | 48 | 49 | org.springframework.boot 50 | spring-boot-starter-test 51 | test 52 | 53 | 54 | 55 | 56 | 57 | 58 | org.springframework.boot 59 | spring-boot-maven-plugin 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/java/com/cuzz/security/Springboot13SecurityApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.security; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Springboot13SecurityApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Springboot13SecurityApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/java/com/cuzz/security/config/MySecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.security.config; 2 | 3 | 4 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 5 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 6 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 7 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 8 | 9 | /** 10 | * @Author: cuzz 11 | * @Date: 2018/9/29 12:51 12 | * @Description: 13 | */ 14 | @EnableWebSecurity 15 | public class MySecurityConfig extends WebSecurityConfigurerAdapter{ 16 | 17 | 18 | @Override 19 | protected void configure(HttpSecurity http) throws Exception { 20 | // super.configure(http); 21 | // 定制请求的授权规则 22 | http.authorizeRequests().antMatchers("/").permitAll() 23 | .antMatchers("/level1/**").hasRole("VIP1") 24 | .antMatchers("/level2/**").hasRole("VIP2") 25 | .antMatchers("/level3/**").hasRole("VIP3"); 26 | // 开启登入功能,如果权限就来到登入页面 27 | http.formLogin(); 28 | // 开启注销功能,成功注销后回到首页 29 | http.logout().logoutSuccessUrl("/"); 30 | } 31 | 32 | // 定义认证规则 33 | @Override 34 | protected void configure(AuthenticationManagerBuilder auth) throws Exception { 35 | // super.configure(auth); 36 | auth.inMemoryAuthentication() 37 | .withUser("cuzz").password("123456").roles("VIP1","VIP2") 38 | .and() 39 | .withUser("cuxx").password("123456").roles("VIP3"); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/java/com/cuzz/security/controller/KungfuController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.security.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | 7 | /** 8 | * @Author: cuzz 9 | * @Date: 2018/9/29 12:25 10 | * @Description: 11 | */ 12 | @Controller 13 | public class KungfuController { 14 | private final String PREFIX = "pages/"; 15 | /** 16 | * 欢迎页 17 | * @return 18 | */ 19 | @GetMapping("/") 20 | public String index() { 21 | return "welcome"; 22 | } 23 | 24 | /** 25 | * 登陆页 26 | * @return 27 | */ 28 | @GetMapping("/userlogin") 29 | public String loginPage() { 30 | return PREFIX+"login"; 31 | } 32 | 33 | 34 | /** 35 | * level1页面映射 36 | * @param path 37 | * @return 38 | */ 39 | @GetMapping("/level1/{path}") 40 | public String level1(@PathVariable("path")String path) { 41 | return PREFIX+"level1/"+path; 42 | } 43 | 44 | /** 45 | * level2页面映射 46 | * @param path 47 | * @return 48 | */ 49 | @GetMapping("/level2/{path}") 50 | public String level2(@PathVariable("path")String path) { 51 | return PREFIX+"level2/"+path; 52 | } 53 | 54 | /** 55 | * level3页面映射 56 | * @param path 57 | * @return 58 | */ 59 | @GetMapping("/level3/{path}") 60 | public String level3(@PathVariable("path")String path) { 61 | return PREFIX+"level3/"+path; 62 | } 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.prefix=classpath:/templates/ 2 | spring.thymeleaf.suffix=.html 3 | security.user.name=root 4 | security.user.password=root 5 | security.user.role=ADMIN -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/pages/level1/1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

罗汉拳

10 |

罗汉拳站当央,打起来不要慌

11 | 12 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/pages/level1/2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

武当长拳

10 |

长一点在长一点

11 | 12 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/pages/level1/3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

全真剑法

10 |

全都是真的

11 | 12 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/pages/level2/1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

太极拳

10 |

11 | 一个西瓜圆又圆 劈它一刀成两半 你一半来 给你你不要 给他他不收 那就不给 把两人撵走 他们不走你走 走啦,一挥手,伤自尊 12 | 不买西瓜别缠我,缓慢纠缠様 两人缠我赖皮,手慢动作左右挥动 看我厉害,转头缓步拍苍蝇状 拍死了,手抱西瓜状+奥特曼十字手+广播操准备运动的站立 13 |

14 | 15 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/pages/level2/2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

七伤拳

10 |

练这拳的人全都死了

11 | 12 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/pages/level2/3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

梯云纵

10 |

踩自己的脚往上跳

11 | 12 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/pages/level3/1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

葵花宝典

10 |

欲练神功,挥刀自宫

11 | 12 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/pages/level3/2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

龟派气功

10 |

龟-派-气-功-波

11 | 12 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/pages/level3/3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

独孤九剑

10 |

欲练此剑,必先犯贱

11 | 12 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/pages/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 |

欢迎登陆武林秘籍管理系统

9 |
10 |
11 |
12 | 用户名:
13 | 密码:
14 | 15 |
16 |
17 | 18 | -------------------------------------------------------------------------------- /springboot-13-security/src/main/resources/templates/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 |

欢迎光临武林秘籍管理系统

9 |

游客您好,如果想查看武林秘籍 请登录

10 |
11 | 12 |
13 |
14 | 15 |

普通武功秘籍

16 | 21 | 22 |

高级武功秘籍

23 | 28 | 29 |

绝世武功秘籍

30 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /springboot-13-security/src/test/java/com/cuzz/security/Springboot13SecurityApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.security; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class Springboot13SecurityApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-14-consumer-user/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-14-consumer-user/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot-14-consumer-user 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot-14-consumer-user 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.5.16.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | com.alibaba.boot 34 | dubbo-spring-boot-starter 35 | 0.1.0 36 | 37 | 38 | 39 | com.github.sgroschupf 40 | zkclient 41 | 0.1 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-starter-test 46 | test 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.springframework.boot 54 | spring-boot-maven-plugin 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /springboot-14-consumer-user/src/main/java/com/cuzz/ticket/service/TicketService.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.ticket.service; 2 | 3 | /** 4 | * @Author: cuzz 5 | * @Date: 2018/9/30 12:26 6 | * @Description: 7 | */ 8 | public interface TicketService { 9 | String getTicket(); 10 | } 11 | -------------------------------------------------------------------------------- /springboot-14-consumer-user/src/main/java/com/cuzz/user/Springboot14ConsumerUserApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.user; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Springboot14ConsumerUserApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Springboot14ConsumerUserApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-14-consumer-user/src/main/java/com/cuzz/user/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.user.service; 2 | 3 | import com.alibaba.dubbo.config.annotation.Reference; 4 | import com.cuzz.ticket.service.TicketService; 5 | import org.springframework.stereotype.Service; 6 | 7 | /** 8 | * @Author: cuzz 9 | * @Date: 2018/9/30 12:32 10 | * @Description: 11 | */ 12 | @Service 13 | public class UserService { 14 | 15 | @Reference 16 | TicketService ticketService; 17 | 18 | public void hello(){ 19 | String ticket = ticketService.getTicket(); 20 | System.out.println("您已经成功买票:"+ticket); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /springboot-14-consumer-user/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # \u540D\u79F0 2 | dubbo.application.name=consumer-user 3 | # \u5730\u5740 4 | dubbo.registry.address=zookeeper://10.138.223.126:2181 5 | -------------------------------------------------------------------------------- /springboot-14-consumer-user/src/test/java/com/cuzz/user/Springboot14ConsumerUserApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.user; 2 | 3 | import com.cuzz.user.service.UserService; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.test.context.junit4.SpringRunner; 9 | 10 | @RunWith(SpringRunner.class) 11 | @SpringBootTest 12 | public class Springboot14ConsumerUserApplicationTests { 13 | 14 | @Autowired 15 | UserService userService; 16 | 17 | @Test 18 | public void contextLoads() { 19 | userService.hello(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /springboot-14-provider-ticket/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-14-provider-ticket/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot-14-provider-ticket 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot-14-provider-ticket 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.5.16.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | com.alibaba.boot 35 | dubbo-spring-boot-starter 36 | 0.1.0 37 | 38 | 39 | 40 | com.github.sgroschupf 41 | zkclient 42 | 0.1 43 | 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-maven-plugin 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /springboot-14-provider-ticket/src/main/java/com/cuzz/ticket/Springboot14ProviderTicketApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.ticket; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Springboot14ProviderTicketApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Springboot14ProviderTicketApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-14-provider-ticket/src/main/java/com/cuzz/ticket/service/TicketService.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.ticket.service; 2 | 3 | /** 4 | * @Author: cuzz 5 | * @Date: 2018/9/30 12:26 6 | * @Description: 7 | */ 8 | public interface TicketService { 9 | String getTicket(); 10 | } 11 | -------------------------------------------------------------------------------- /springboot-14-provider-ticket/src/main/java/com/cuzz/ticket/service/TicketServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.ticket.service; 2 | 3 | import com.alibaba.dubbo.config.annotation.Service; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * @Author: cuzz 8 | * @Date: 2018/9/30 12:28 9 | * @Description: 10 | */ 11 | @Component 12 | @Service // 这个是dubbo @Service 13 | public class TicketServiceImpl implements TicketService{ 14 | 15 | @Override 16 | public String getTicket() { 17 | return "《大话西游》"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /springboot-14-provider-ticket/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # \u540D\u79F0 2 | dubbo.application.name=provider-ticket 3 | # \u5730\u5740 4 | dubbo.registry.address=zookeeper://10.138.223.126:2181 5 | # \u626B\u63CF\u54EA\u4E9B\u5305 6 | dubbo.scan.base-packages=com.cuzz.ticket.service -------------------------------------------------------------------------------- /springboot-14-provider-ticket/src/test/java/com/cuzz/ticket/Springboot14ProviderTicketApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.ticket; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class Springboot14ProviderTicketApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-14-springcloud-consumer-user/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-14-springcloud-consumer-user/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-14-springcloud-consumer-user/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-14-springcloud-consumer-user/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-14-springcloud-consumer-user/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot-14-springcloud-consumer-user 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot-14-springcloud-consumer-user 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.5.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | Finchley.SR1 26 | 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-starter-web 32 | 33 | 34 | org.springframework.cloud 35 | spring-cloud-starter-netflix-eureka-client 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-test 41 | test 42 | 43 | 44 | 45 | 46 | 47 | 48 | org.springframework.cloud 49 | spring-cloud-dependencies 50 | ${spring-cloud.version} 51 | pom 52 | import 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | org.springframework.boot 61 | spring-boot-maven-plugin 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /springboot-14-springcloud-consumer-user/src/main/java/com/cuzz/consumeruser/Springboot14SpringcloudConsumerUserApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.consumeruser; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @EnableDiscoveryClient // 开启发现服务 11 | @SpringBootApplication 12 | public class Springboot14SpringcloudConsumerUserApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(Springboot14SpringcloudConsumerUserApplication.class, args); 16 | } 17 | 18 | @LoadBalanced //使用负载均衡机制 19 | @Bean 20 | public RestTemplate restTemplate(){ 21 | return new RestTemplate(); 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /springboot-14-springcloud-consumer-user/src/main/java/com/cuzz/consumeruser/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.consumeruser.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import org.springframework.web.client.RestTemplate; 7 | 8 | /** 9 | * @Author: cuzz 10 | * @Date: 2018/10/9 11:55 11 | * @Description: 12 | */ 13 | @RestController 14 | public class UserController { 15 | 16 | @Autowired 17 | RestTemplate restTemplate; 18 | 19 | @GetMapping("/buy") 20 | public String buyTicket(String name){ 21 | String s = restTemplate.getForObject("http://PROVIDER-TICKET/ticket", String.class); 22 | return name+"购买了"+" "+s; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /springboot-14-springcloud-consumer-user/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-14-springcloud-consumer-user/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-14-springcloud-consumer-user/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: consumer-user 4 | server: 5 | port: 8200 6 | eureka: 7 | instance: 8 | prefer-ip-address: true 9 | client: 10 | service-url: 11 | defaultZone: http://localhost:8761/eureka/ -------------------------------------------------------------------------------- /springboot-14-springcloud-consumer-user/src/test/java/com/cuzz/consumeruser/Springboot14SpringcloudConsumerUserApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.consumeruser; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class Springboot14SpringcloudConsumerUserApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-14-springcloud-eureka-server/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-14-springcloud-eureka-server/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-14-springcloud-eureka-server/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-14-springcloud-eureka-server/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-14-springcloud-eureka-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot-14-springcloud-eureka-server 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot-14-springcloud-eureka-server 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.5.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | Finchley.SR1 26 | 27 | 28 | 29 | 30 | org.springframework.cloud 31 | spring-cloud-starter-netflix-eureka-server 32 | 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-test 37 | test 38 | 39 | 40 | 41 | 42 | 43 | 44 | org.springframework.cloud 45 | spring-cloud-dependencies 46 | ${spring-cloud.version} 47 | pom 48 | import 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | org.springframework.boot 57 | spring-boot-maven-plugin 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /springboot-14-springcloud-eureka-server/src/main/java/com/cuzz/eurekaserver/Springboot14SpringcloudEurekaServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.eurekaserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @EnableEurekaServer 8 | @SpringBootApplication 9 | public class Springboot14SpringcloudEurekaServerApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Springboot14SpringcloudEurekaServerApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot-14-springcloud-eureka-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-14-springcloud-eureka-server/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-14-springcloud-eureka-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8761 3 | eureka: 4 | instance: 5 | hostname: eureka-server #实例的主机名 6 | client: 7 | register-with-eureka: false #不把自己注册到euraka上 8 | fetch-registry: false #不从euraka上来获取服务的注册信息 9 | service-url: 10 | defaultZone: http://localhost:8761/eureka/ -------------------------------------------------------------------------------- /springboot-14-springcloud-eureka-server/src/test/java/com/cuzz/eurekaserver/Springboot14SpringcloudEurekaServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.eurekaserver; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class Springboot14SpringcloudEurekaServerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-14-springcloud-provider-ticket/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-14-springcloud-provider-ticket/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-14-springcloud-provider-ticket/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-14-springcloud-provider-ticket/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-14-springcloud-provider-ticket/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cuzz 7 | springboot-14-springcloud-provider-ticket 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | springboot-14-springcloud-provider-ticket 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.5.16.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | Edgware.SR4 26 | 27 | 28 | 29 | 30 | org.springframework.cloud 31 | spring-cloud-starter-eureka 32 | 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-test 37 | test 38 | 39 | 40 | 41 | 42 | 43 | 44 | org.springframework.cloud 45 | spring-cloud-dependencies 46 | ${spring-cloud.version} 47 | pom 48 | import 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | org.springframework.boot 57 | spring-boot-maven-plugin 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /springboot-14-springcloud-provider-ticket/src/main/java/com/cuzz/providerticket/Springboot14SpringcloudProviderTicketApplication.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.providerticket; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Springboot14SpringcloudProviderTicketApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Springboot14SpringcloudProviderTicketApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-14-springcloud-provider-ticket/src/main/java/com/cuzz/providerticket/controller/TicketController.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.providerticket.controller; 2 | 3 | import com.cuzz.providerticket.service.TicketSerivce; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | /** 10 | * @Author: cuzz 11 | * @Date: 2018/10/9 11:04 12 | * @Description: 13 | */ 14 | @RestController 15 | public class TicketController { 16 | 17 | @Autowired 18 | TicketSerivce ticketSerivce; 19 | 20 | @GetMapping("/ticket") 21 | public String getTicket() { 22 | return ticketSerivce.getTicket(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /springboot-14-springcloud-provider-ticket/src/main/java/com/cuzz/providerticket/service/TicketSerivce.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.providerticket.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | /** 6 | * @Author: cuzz 7 | * @Date: 2018/10/9 11:02 8 | * @Description: 9 | */ 10 | @Service 11 | public class TicketSerivce { 12 | public String getTicket() { 13 | return "《大话西游》"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /springboot-14-springcloud-provider-ticket/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/springboot-14-springcloud-provider-ticket/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-14-springcloud-provider-ticket/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8001 3 | spring: 4 | application: 5 | name: provider-ticket 6 | eureka: 7 | instance: 8 | prefer-ip-address: true #注册是服务使用IP地址 9 | client: 10 | service-url: 11 | defaultZone: http://localhost:8761/eureka/ -------------------------------------------------------------------------------- /springboot-14-springcloud-provider-ticket/src/test/java/com/cuzz/providerticket/Springboot14SpringcloudProviderTicketApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cuzz.providerticket; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class Springboot14SpringcloudProviderTicketApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /supporting/SpringBoot初级.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/supporting/SpringBoot初级.pdf -------------------------------------------------------------------------------- /supporting/SpringBoot高级.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cuzz1/springboot-learning/28dee449c1aafe89a24c5f2d312fa4b1d923388b/supporting/SpringBoot高级.pdf -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/java/KungfuController.java: -------------------------------------------------------------------------------- 1 | package com.atguigu.security.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | 7 | @Controller 8 | public class KungfuController { 9 | private final String PREFIX = "pages/"; 10 | /** 11 | * 欢迎页 12 | * @return 13 | */ 14 | @GetMapping("/") 15 | public String index() { 16 | return "welcome"; 17 | } 18 | 19 | /** 20 | * 登陆页 21 | * @return 22 | */ 23 | @GetMapping("/userlogin") 24 | public String loginPage() { 25 | return PREFIX+"login"; 26 | } 27 | 28 | 29 | /** 30 | * level1页面映射 31 | * @param path 32 | * @return 33 | */ 34 | @GetMapping("/level1/{path}") 35 | public String level1(@PathVariable("path")String path) { 36 | return PREFIX+"level1/"+path; 37 | } 38 | 39 | /** 40 | * level2页面映射 41 | * @param path 42 | * @return 43 | */ 44 | @GetMapping("/level2/{path}") 45 | public String level2(@PathVariable("path")String path) { 46 | return PREFIX+"level2/"+path; 47 | } 48 | 49 | /** 50 | * level3页面映射 51 | * @param path 52 | * @return 53 | */ 54 | @GetMapping("/level3/{path}") 55 | public String level3(@PathVariable("path")String path) { 56 | return PREFIX+"level3/"+path; 57 | } 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/pages/level1/1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

罗汉拳

10 |

罗汉拳站当央,打起来不要慌

11 | 12 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/pages/level1/2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

武当长拳

10 |

长一点在长一点

11 | 12 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/pages/level1/3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

全真剑法

10 |

全都是真的

11 | 12 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/pages/level2/1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

太极拳

10 |

11 | 一个西瓜圆又圆 劈它一刀成两半 你一半来 给你你不要 给他他不收 那就不给 把两人撵走 他们不走你走 走啦,一挥手,伤自尊 12 | 不买西瓜别缠我,缓慢纠缠様 两人缠我赖皮,手慢动作左右挥动 看我厉害,转头缓步拍苍蝇状 拍死了,手抱西瓜状+奥特曼十字手+广播操准备运动的站立 13 |

14 | 15 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/pages/level2/2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

七伤拳

10 |

练这拳的人全都死了

11 | 12 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/pages/level2/3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

梯云纵

10 |

踩自己的脚往上跳

11 | 12 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/pages/level3/1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

葵花宝典

10 |

欲练神功,挥刀自宫

11 | 12 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/pages/level3/2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

龟派气功

10 |

龟-派-气-功-波

11 | 12 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/pages/level3/3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 返回 9 |

独孤九剑

10 |

欲练此剑,必先犯贱

11 | 12 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/pages/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 |

欢迎登陆武林秘籍管理系统

9 |
10 |
11 |
12 | 用户名:
13 | 密码:
14 | 15 |
16 |
17 | 18 | -------------------------------------------------------------------------------- /supporting/SpringSecurity实验/templates/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 |

欢迎光临武林秘籍管理系统

9 |

游客您好,如果想查看武林秘籍 请登录

10 |
11 | 12 |

普通武功秘籍

13 | 18 | 19 |

高级武功秘籍

20 | 25 | 26 |

绝世武功秘籍

27 | 32 | 33 | 34 | --------------------------------------------------------------------------------