├── spring5 ├── spring-mvc │ ├── src │ │ └── main │ │ │ ├── webapp │ │ │ └── WEB-INF │ │ │ │ ├── jsp │ │ │ │ └── hello.jsp │ │ │ │ └── web.xml │ │ │ └── java │ │ │ └── com │ │ │ └── zwd │ │ │ ├── config │ │ │ └── DispatcherServletConfiguration.java │ │ │ └── controller │ │ │ └── HelloController.java │ └── .extract │ │ ├── webapps │ │ └── ROOT │ │ │ ├── WEB-INF │ │ │ ├── jsp │ │ │ │ └── hello.jsp │ │ │ └── web.xml │ │ │ └── META-INF │ │ │ ├── MANIFEST.MF │ │ │ └── maven │ │ │ └── com.java.advance │ │ │ └── spring-mvc │ │ │ └── pom.properties │ │ ├── logs │ │ └── access_log.2019-03-21 │ │ ├── .tomcat_executable_archive.timestamp │ │ └── work │ │ └── Tomcat │ │ └── localhost │ │ └── _ │ │ └── SESSIONS.ser ├── image │ ├── 0001.png │ ├── 0002.png │ ├── 0003.png │ ├── 0004.png │ ├── 0005.png │ ├── 0006.png │ ├── 0007.png │ ├── 0008.png │ ├── 0009.png │ ├── 0010.png │ ├── 0011.png │ ├── 0012.png │ ├── 0013.png │ └── 0014.png ├── my-spring-mvc │ ├── src │ │ └── main │ │ │ ├── webapp │ │ │ ├── META-INF │ │ │ │ └── services │ │ │ │ │ └── javax.servlet.ServletContainerInitializer │ │ │ └── WEB-INF │ │ │ │ ├── jsp │ │ │ │ ├── index.jsp │ │ │ │ └── WebApplicationInitializer.java │ │ │ │ └── web.xml │ │ │ └── java │ │ │ └── org │ │ │ └── springframework │ │ │ └── web │ │ │ └── servlet │ │ │ ├── MyThemeResolver.java │ │ │ ├── MyHandlerInterceptor.java │ │ │ ├── MySmartView.java │ │ │ ├── mvc │ │ │ └── condition │ │ │ │ ├── MyMediaTypeExpression.java │ │ │ │ ├── MyNameValueExpression.java │ │ │ │ ├── MyAbstractRequestCondition.java │ │ │ │ └── MyRequestCondition.java │ │ │ ├── support │ │ │ └── MyRequestDataValueProcessor.java │ │ │ ├── MyViewResolver.java │ │ │ ├── handler │ │ │ ├── MyHandlerMethodMappingNamingStrategy.java │ │ │ └── MyDispatcherServletWebRequest.java │ │ │ ├── MyLocaleContextResolver.java │ │ │ ├── MyHandlerMapping.java │ │ │ ├── MyLocaleResolver.java │ │ │ ├── MyHandlerAdapter.java │ │ │ ├── MyAsyncHandlerInterceptor.java │ │ │ ├── MyFlashMapManager.java │ │ │ ├── DispatcherServlet.properties │ │ │ └── MyView.java │ └── image │ │ └── tomcat-config.png ├── spring-applicationlistener │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── zwd │ │ │ └── listener │ │ │ ├── event │ │ │ ├── ApplicationEvent.java │ │ │ └── ContextRefreshedEvent.java │ │ │ ├── context │ │ │ └── ConfigurableApplicationContext.java │ │ │ ├── SmartApplicationListener.java │ │ │ ├── ApplicationListener.java │ │ │ └── GenericApplicationListener.java │ │ └── test │ │ └── java │ │ └── com │ │ └── zwd │ │ └── BootStrap.java ├── spring-jdk-proxy │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── zwd │ │ │ └── jdk │ │ │ ├── service │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ │ └── UserServiceImpl.java │ │ │ └── BootStrap.java │ └── pom.xml ├── making-myorm │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── zwd │ │ │ └── orm │ │ │ ├── configuration │ │ │ ├── Excutor.java │ │ │ └── MapperBean.java │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ └── Application.java │ │ └── resources │ │ ├── mappers │ │ └── UserMapper.xml │ │ └── config.xml ├── spring-transaction │ └── src │ │ └── main │ │ ├── resources │ │ └── jdbc.properties │ │ └── java │ │ └── com │ │ └── zwd │ │ └── spring │ │ └── transaction │ │ ├── dao │ │ ├── StockDao.java │ │ └── AccountDao.java │ │ ├── exception │ │ └── BuyStockException.java │ │ ├── service │ │ └── BuyStockService.java │ │ └── domain │ │ └── Account.java ├── FactoryBeanAndBeanFactory │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── zwd │ │ └── factorybean │ │ ├── FactoryBeanMain.java │ │ ├── domain │ │ └── Dog.java │ │ └── factory │ │ └── DogFactoryBean.java ├── spring-mvc-event │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── zwd │ │ └── event │ │ ├── Configration.java │ │ ├── MyEvent.java │ │ ├── EventBootstrap.java │ │ ├── EventPulish.java │ │ └── MyEventListener.java ├── cglib │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── zwd │ │ └── cglib │ │ ├── dao │ │ └── Dao.java │ │ ├── BootStrap.java │ │ └── proxy │ │ └── DaoProxy.java └── spring-aop │ └── src │ └── main │ └── java │ └── com │ └── java │ └── spring │ └── aop │ ├── service │ ├── TicketService.java │ └── impl │ │ └── RailwayStation.java │ ├── advice │ ├── TicketServiceBeforeAdvice.java │ ├── TicketServiceAfterReturningAdvice.java │ ├── TicketServiceThrowsAdvice.java │ └── TicketServiceAroundAdvice.java │ └── AopAdviceConfig.java ├── spring-cloud ├── config-repo │ ├── bus-client-dev.properties │ └── config-client-dev.properties ├── image │ ├── bus-eureka.png │ ├── bus-postman.png │ ├── ribbon-use.png │ ├── bus-archtive.png │ ├── sleuth-follow.png │ ├── eureka-client-a.png │ ├── eureka-register.png │ ├── gateway_diagram.png │ ├── ribbon-register.png │ ├── sleuth-dependeny.png │ └── eureka_architecture.png ├── spring-cloud-zuul │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── .gitignore │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudzuul │ │ │ └── SpringCloudZuulApplication.java │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── zwd │ │ └── springcloudzuul │ │ └── SpringCloudZuulApplicationTests.java ├── spring-cloud-clientA │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springcloudclientA │ │ │ │ ├── SpringCloudClientAApplication.java │ │ │ │ └── controller │ │ │ │ └── ConsumerController.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudeureka │ │ │ └── SpringCloudEurekaApplicationTests.java │ └── .gitignore ├── spring-cloud-clientB │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springcloudclientB │ │ │ │ ├── SpringCloudClientBApplication.java │ │ │ │ └── controller │ │ │ │ └── ConsumerController.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudeureka │ │ │ └── SpringCloudEurekaApplicationTests.java │ └── .gitignore ├── spring-cloud-eureka │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springcloudeureka │ │ │ │ └── SpringCloudEurekaApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudeureka │ │ │ └── SpringCloudEurekaApplicationTests.java │ └── .gitignore ├── spring-cloud-feign │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springcloudfeign │ │ │ │ ├── service │ │ │ │ └── ConsumerService.java │ │ │ │ ├── SpringCloudFeignApplication.java │ │ │ │ └── controller │ │ │ │ └── ConsumerController.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudfeign │ │ │ └── SpringCloudFeignApplicationTests.java │ └── .gitignore ├── spring-cloud-gateway │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springcloudgateway │ │ │ │ └── SpringCloudGatewayApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudgateway │ │ │ └── SpringCloudGatewayApplicationTests.java │ └── .gitignore ├── spring-cloud-hystrix │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ └── resources │ │ │ │ └── application.properties │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudhystrix │ │ │ └── SpringCloudHystrixApplicationTests.java │ └── .gitignore ├── spring-cloud-ribbon │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springcloudribbon │ │ │ │ └── controller │ │ │ │ └── ConsumerController.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudribbon │ │ │ └── SpringCloudRibbonApplicationTests.java │ └── .gitignore ├── spring-cloud-sleuth-clientB │ ├── src │ │ ├── main │ │ │ └── resources │ │ │ │ └── application.properties │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudeureka │ │ │ └── SpringCloudEurekaApplicationTests.java │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ └── .gitignore ├── spring-cloud-bus-client │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── .gitignore │ └── src │ │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudbusclient │ │ │ └── SpringCloudBusClientApplicationTests.java │ │ └── main │ │ └── resources │ │ └── bootstrap.properties ├── spring-cloud-bus-server │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── .gitignore │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── bootstrap.properties │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudbus │ │ │ └── SpringCloudBusApplication.java │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── zwd │ │ └── springcloudbus │ │ └── SpringCloudBusApplicationTests.java ├── spring-cloud-config-client │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ ├── src │ │ ├── main │ │ │ └── resources │ │ │ │ └── bootstrap.properties │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudconfigclient │ │ │ └── SpringCloudConfigClientApplicationTests.java │ └── .gitignore ├── spring-cloud-config-server │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── bootstrap.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springcloudconfigserver │ │ │ │ └── SpringCloudConfigServerApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudconfigserver │ │ │ └── SpringCloudConfigServerApplicationTests.java │ └── .gitignore ├── spring-cloud-grpc-server │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springcloudgrpcserver │ │ │ │ ├── SpringCloudGrpcServerApplication.java │ │ │ │ └── service │ │ │ │ └── GrpcServerService.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudgrpcserver │ │ │ └── SpringCloudGrpcServerApplicationTests.java │ └── .gitignore ├── spring-cloud-lcn-producer │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── zwd │ │ │ │ │ └── springcloudlcnproducer │ │ │ │ │ ├── mapper │ │ │ │ │ └── UserMapper.java │ │ │ │ │ └── SpringCloudLcnProducerApplication.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ └── mappers │ │ │ │ └── UserMapper.xml │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudlcnproducer │ │ │ └── SpringCloudLcnProducerApplicationTests.java │ └── .gitignore ├── spring-cloud-sleuth-clientA │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ ├── src │ │ ├── main │ │ │ └── resources │ │ │ │ └── application.properties │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springcloudeureka │ │ │ └── SpringCloudEurekaApplicationTests.java │ └── .gitignore └── spring-cloud-sleuth-server │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.properties │ │ └── maven-wrapper.jar │ ├── src │ ├── main │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── zwd │ │ └── springcloudsleuth │ │ └── SpringCloudSleuthApplicationTests.java │ └── .gitignore ├── spring-boot ├── spring-boot-swagger2 │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springbootswagger2 │ │ │ │ └── SpringBootSwagger2Application.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springbootswagger2 │ │ │ └── SpringBootSwagger2ApplicationTests.java │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ └── .gitignore ├── spring-boot-controller-advice │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springbootcontrolleradvice │ │ │ │ ├── SpringBootControllerAdviceApplication.java │ │ │ │ ├── config │ │ │ │ └── AppConfig.java │ │ │ │ └── controller │ │ │ │ └── HelloWorldController.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springbootcontrolleradvice │ │ │ └── SpringBootControllerAdviceApplicationTests.java │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ └── .gitignore ├── spring-boot-grpc │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springbootgrpc │ │ │ │ └── SpringBootGrpcApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springbootgrpc │ │ │ └── SpringBootGrpcApplicationTests.java │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ └── .gitignore ├── spring-boot-profiles │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application-rc.properties │ │ │ │ ├── application-dev.properties │ │ │ │ ├── application-test.properties │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springbootprofiles │ │ │ │ └── SpringBootProfilesApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springbootprofiles │ │ │ └── SpringBootProfilesApplicationTests.java │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ └── .gitignore ├── image │ ├── hot-bulid.png │ ├── hot-start.png │ ├── swagger-home.png │ ├── swagger-info.png │ └── swagger-request.png ├── spring-boot-swagger2Markup │ ├── src │ │ ├── docs │ │ │ └── asciidoc │ │ │ │ ├── manual_content2.adoc │ │ │ │ ├── manual_content1.adoc │ │ │ │ └── index.adoc │ │ └── main │ │ │ └── resources │ │ │ └── application.yml │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ └── .gitignore ├── example-spring-boot-starter-test │ └── src │ │ └── main │ │ └── resources │ │ └── application.properties ├── spring-boot-hot │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── zwd │ │ │ │ └── springboothot │ │ │ │ └── SpringBootHotApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springboothot │ │ │ └── SpringBootHotApplicationTests.java │ └── .gitignore ├── spring-boot-redis │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── application.properties │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── zwd │ │ │ └── springbootredis │ │ │ ├── SpringBootRedisApplication.java │ │ │ └── domain │ │ │ └── User.java │ └── .gitignore ├── example-spring-boot-starter │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── spring.factories │ │ └── java │ │ └── com │ │ └── example │ │ └── zwd │ │ └── springbootstarter │ │ └── config │ │ └── ExampleServiceProperties.java ├── spring-boot-caffineCache │ └── src │ │ └── main │ │ ├── resources │ │ ├── application.yml │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── zwd │ │ └── caffine │ │ ├── repository │ │ └── UserRepository.java │ │ └── entity │ │ └── User.java ├── spring-boot-enable │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── zwd │ │ │ └── boot │ │ │ ├── server │ │ │ ├── Server.java │ │ │ ├── FtpServer.java │ │ │ └── HttpServer.java │ │ │ ├── configration │ │ │ └── HelloWorldConfigration.java │ │ │ └── annotation │ │ │ ├── EnableHelloWorld.java │ │ │ └── EnableServer.java │ └── pom.xml ├── spring-boot-jdbctemplate │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── jdbctemplate │ │ │ │ ├── entity │ │ │ │ └── Shop.java │ │ │ │ ├── SpringbootJdbcTemplateApplication.java │ │ │ │ └── controller │ │ │ │ └── ShopController.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── jdbctemplate │ │ │ └── SpringbootJdbctemplateApplicationTests.java │ └── .gitignore ├── spring-boot-quartz │ └── src │ │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── zwd │ │ │ └── TestA.java │ │ └── main │ │ └── java │ │ └── com │ │ └── zwd │ │ └── quartz │ │ ├── config │ │ └── JobInfo.java │ │ └── Bootstap.java ├── spring-boot-log │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── zwd │ │ │ └── log │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ ├── Bootstrap.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ └── controller │ │ │ └── LogController.java │ │ └── resources │ │ ├── mapper │ │ └── UserMapper.xml │ │ └── application.properties ├── spring-boot-hsql │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── zwd │ │ └── hsql │ │ ├── service │ │ └── DaoService.java │ │ └── BootStrap.java ├── spring-boot-mybatis-plus │ └── src │ │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── zwd │ │ └── mybatis │ │ └── plus │ │ ├── BootStrap.java │ │ └── entity │ │ └── User.java ├── spring-boot-aspectj │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── zwd │ │ └── aspectj │ │ ├── BootStrap.java │ │ └── controller │ │ └── UserController.java └── spring-boot-mybatis-mulidatasource │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── neo │ │ │ ├── Application.java │ │ │ └── mapper │ │ │ ├── test1 │ │ │ └── User1Mapper.java │ │ │ └── test2 │ │ │ └── User2Mapper.java │ └── resources │ │ ├── application.properties │ │ └── mybatis │ │ └── mybatis-config.xml │ └── test │ └── java │ └── com │ └── neo │ └── ApplicationTests.java ├── idea_keymap.md ├── design-pattern ├── signle │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── hansn │ │ │ ├── Signle.java │ │ │ └── dao │ │ │ ├── Singleton3.java │ │ │ ├── Singleton.java │ │ │ ├── Singleton2.java │ │ │ ├── Singleton5.java │ │ │ └── Singleton4.java │ └── pom.xml ├── factory │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com.hansn │ │ │ ├── service │ │ │ ├── Resaurant.java │ │ │ └── CookFactory.java │ │ │ ├── serviceimpl │ │ │ ├── Duck.java │ │ │ ├── Fish.java │ │ │ ├── Meet.java │ │ │ ├── FishFactory.java │ │ │ └── DuckFactory.java │ │ │ ├── Factory.java │ │ │ ├── Cook.java │ │ │ └── Wait.java │ └── pom.xml ├── strategy │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── hansn │ │ │ ├── service │ │ │ └── TicketStrategy.java │ │ │ ├── serviceimpl │ │ │ ├── Vip.java │ │ │ ├── Normal.java │ │ │ └── Children.java │ │ │ ├── entity │ │ │ └── Context.java │ │ │ └── StrategyTest.java │ └── pom.xml ├── delegate │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── hansn │ │ │ ├── service │ │ │ └── Target.java │ │ │ ├── DelegateTest.java │ │ │ └── serviceimpl │ │ │ ├── BTarget.java │ │ │ ├── ATarget.java │ │ │ └── Leader.java │ └── pom.xml ├── observer │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── hansn │ │ │ ├── service │ │ │ ├── Observer.java │ │ │ └── Observable.java │ │ │ └── serviceImpl │ │ │ └── User.java │ └── pom.xml ├── proxy │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── hansn │ │ │ ├── service │ │ │ └── TicketService.java │ │ │ ├── ProxyTest.java │ │ │ └── serviceimpl │ │ │ └── Station.java │ └── pom.xml ├── template │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── hansn │ │ │ ├── TemplateTest.java │ │ │ ├── entity │ │ │ └── CarTemplate.java │ │ │ └── Car │ │ │ ├── Audi.java │ │ │ └── LandRover.java │ └── pom.xml └── prototype │ └── pom.xml ├── thread ├── image │ ├── thread-excute.png │ ├── thread_volatile.jpg │ ├── threadlocal-copy.png │ ├── threadlocal-home.png │ ├── thread_synchronized.png │ └── thread_votile_order.jpg ├── runnable-thread │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── hansn │ │ │ ├── RunnableTest.java │ │ │ ├── ThreadTest.java │ │ │ └── entity │ │ │ └── MyRunnable.java │ └── pom.xml ├── thread-lock │ └── pom.xml ├── threadLocal │ └── pom.xml ├── thread-static │ └── pom.xml ├── thread-state │ ├── src │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── zwd │ │ │ └── state │ │ │ └── ThreadState.java │ └── pom.xml └── thread-pool │ └── pom.xml ├── image └── concurrenthashmap_java7.png ├── dive-in-spring-boot ├── 课纲 │ ├── 第二节 走向自动装配.pdf │ ├── 第一节 系列总览-核心特性.pdf │ ├── 第四节 Web MVC 核心.pdf │ ├── 第七节 渐行渐远的 Servlet.pdf │ ├── 第五节 Web MVC 视图应用.pdf │ ├── 第六节 Web MVC REST 应用.pdf │ ├── 第三节 理解 SpringApplication.pdf │ └── 第八节 从 Reactive 到 WebFlux.pdf ├── spring-servlet │ └── .extract │ │ ├── .tomcat_executable_archive.timestamp │ │ ├── webapps │ │ └── ROOT │ │ │ └── META-INF │ │ │ ├── maven │ │ │ └── com.imooc │ │ │ │ └── spring-servlet │ │ │ │ └── pom.properties │ │ │ └── MANIFEST.MF │ │ └── logs │ │ └── access_log.2018-06-05 ├── overview │ └── src │ │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── imooc │ │ └── diveinspringboot │ │ └── DiveInSpringBootApplication.java ├── autoconfigure │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── spring.factories │ │ └── java │ │ │ └── com │ │ │ └── imooc │ │ │ └── diveinspringboot │ │ │ ├── service │ │ │ └── CalculateService.java │ │ │ ├── DiveInSpringBootApplication.java │ │ │ ├── annotation │ │ │ ├── FirstLevelRepository.java │ │ │ ├── SecondLevelRepository.java │ │ │ ├── EnableHelloWorld.java │ │ │ └── HelloWorldImportSelector.java │ │ │ ├── repository │ │ │ └── MyFirstLevelRepository.java │ │ │ ├── configuration │ │ │ ├── HelloWorldConfiguration.java │ │ │ └── HelloWorldAutoConfiguration.java │ │ │ └── condition │ │ │ └── ConditionalOnSystemProperty.java │ │ └── test │ │ └── java │ │ └── com │ │ └── imooc │ │ └── diveinspringboot │ │ └── DiveInSpringBootApplicationTests.java ├── springboot-view │ └── src │ │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── templates │ │ │ └── thymeleaf │ │ │ ├── hello-world.html │ │ │ └── index.html │ │ ├── webapp │ │ └── WEB-INF │ │ │ └── jsp │ │ │ └── index.jsp │ │ └── java │ │ └── com │ │ └── imooc │ │ └── web │ │ └── bootstrap │ │ └── SpringBootViewBootstrap.java ├── spring-webmvc │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jsp │ │ │ └── index.jsp │ │ │ └── web.xml │ │ └── java │ │ └── com │ │ └── imooc │ │ └── web │ │ ├── config │ │ └── DispatcherServletConfiguration.java │ │ └── controller │ │ └── HelloWorldController.java └── springboot-rest │ └── src │ └── main │ ├── java │ └── com │ │ └── imooc │ │ └── web │ │ ├── controller │ │ ├── HelloWorldController.java │ │ └── UserRestController.java │ │ ├── domain │ │ └── User.java │ │ └── bootstrap │ │ └── SpringBootRestBootstrap(1).java │ └── resources │ └── templates │ └── index.html ├── mybatis ├── mybatis-cache │ ├── image │ │ ├── cache1.jpg │ │ ├── cache2.jpg │ │ ├── cacheresult1.png │ │ └── cacheresult2.png │ └── src │ │ └── main │ │ └── resources │ │ └── application.properties ├── mybatis-link-query │ ├── image │ │ ├── link-ER.png │ │ └── linkquerytestresult.png │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── zwd │ │ │ └── mybatis │ │ │ └── linkquery │ │ │ ├── Application.java │ │ │ └── domain │ │ │ └── User.java │ │ └── test │ │ └── java │ │ └── com │ │ └── zwd │ │ └── mybatis │ │ └── linkquery │ │ └── TestUserMapper.java ├── mybatis-transaction-manager │ └── src │ │ └── main │ │ ├── resources │ │ └── db │ │ │ └── database.sql │ │ └── java │ │ └── com │ │ └── zwd │ │ └── mybatis │ │ └── transaction │ │ ├── mapper │ │ └── UserMapper.java │ │ └── pojo │ │ └── User.java ├── spring-mybatis │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── zwd │ │ │ └── mybatis │ │ │ └── spring │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ └── pojo │ │ │ └── User.java │ │ └── resources │ │ ├── db │ │ └── database.sql │ │ └── mapper │ │ └── UserMapper.xml ├── mybatis-proxy │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── zwd │ │ │ └── mybatis │ │ │ └── proxy │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ └── pojo │ │ │ └── User.java │ │ └── resources │ │ └── mapper │ │ └── UserMapper.xml ├── mybatis-transaction-analysis │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── zwd │ │ └── mybatis │ │ └── analysis │ │ ├── mapper │ │ └── UserMapper.java │ │ └── pojo │ │ └── User.java └── mybatis-generator │ └── src │ └── main │ └── java │ └── com │ └── zwd │ └── mybatis │ └── generator │ ├── Application.java │ └── domain │ └── User.java └── .gitignore /spring5/spring-mvc/src/main/webapp/WEB-INF/jsp/hello.jsp: -------------------------------------------------------------------------------- 1 |

helloWorld

-------------------------------------------------------------------------------- /spring-cloud/config-repo/bus-client-dev.properties: -------------------------------------------------------------------------------- 1 | foo = foo version 44 2 | -------------------------------------------------------------------------------- /spring-cloud/config-repo/config-client-dev.properties: -------------------------------------------------------------------------------- 1 | foo = foo version 21 2 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring5/spring-mvc/.extract/webapps/ROOT/WEB-INF/jsp/hello.jsp: -------------------------------------------------------------------------------- 1 |

helloWorld

-------------------------------------------------------------------------------- /spring5/spring-mvc/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-controller-advice/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring5/spring-mvc/.extract/webapps/ROOT/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-grpc/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9080 2 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-profiles/src/main/resources/application-rc.properties: -------------------------------------------------------------------------------- 1 | server.port=8082 -------------------------------------------------------------------------------- /spring-boot/spring-boot-profiles/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 -------------------------------------------------------------------------------- /spring-boot/spring-boot-profiles/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | server.port=8083 -------------------------------------------------------------------------------- /spring-boot/spring-boot-profiles/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=test -------------------------------------------------------------------------------- /spring5/image/0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0001.png -------------------------------------------------------------------------------- /spring5/image/0002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0002.png -------------------------------------------------------------------------------- /spring5/image/0003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0003.png -------------------------------------------------------------------------------- /spring5/image/0004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0004.png -------------------------------------------------------------------------------- /spring5/image/0005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0005.png -------------------------------------------------------------------------------- /spring5/image/0006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0006.png -------------------------------------------------------------------------------- /spring5/image/0007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0007.png -------------------------------------------------------------------------------- /spring5/image/0008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0008.png -------------------------------------------------------------------------------- /spring5/image/0009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0009.png -------------------------------------------------------------------------------- /spring5/image/0010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0010.png -------------------------------------------------------------------------------- /spring5/image/0011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0011.png -------------------------------------------------------------------------------- /spring5/image/0012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0012.png -------------------------------------------------------------------------------- /spring5/image/0013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0013.png -------------------------------------------------------------------------------- /spring5/image/0014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/image/0014.png -------------------------------------------------------------------------------- /idea_keymap.md: -------------------------------------------------------------------------------- 1 | ## idea快捷键 2 | 3 | ### mac 4 | 5 | `command + O` class file 查询 6 | 7 | `command + F12` 查询该下的所有方法 -------------------------------------------------------------------------------- /design-pattern/signle/src/main/java/com/hansn/Signle.java: -------------------------------------------------------------------------------- 1 | package com.hansn; 2 | 3 | public class Signle { 4 | } 5 | -------------------------------------------------------------------------------- /spring-boot/image/hot-bulid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/image/hot-bulid.png -------------------------------------------------------------------------------- /spring-boot/image/hot-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/image/hot-start.png -------------------------------------------------------------------------------- /thread/image/thread-excute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/thread/image/thread-excute.png -------------------------------------------------------------------------------- /image/concurrenthashmap_java7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/image/concurrenthashmap_java7.png -------------------------------------------------------------------------------- /spring-boot/image/swagger-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/image/swagger-home.png -------------------------------------------------------------------------------- /spring-boot/image/swagger-info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/image/swagger-info.png -------------------------------------------------------------------------------- /spring-cloud/image/bus-eureka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/bus-eureka.png -------------------------------------------------------------------------------- /spring-cloud/image/bus-postman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/bus-postman.png -------------------------------------------------------------------------------- /spring-cloud/image/ribbon-use.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/ribbon-use.png -------------------------------------------------------------------------------- /thread/image/thread_volatile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/thread/image/thread_volatile.jpg -------------------------------------------------------------------------------- /thread/image/threadlocal-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/thread/image/threadlocal-copy.png -------------------------------------------------------------------------------- /thread/image/threadlocal-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/thread/image/threadlocal-home.png -------------------------------------------------------------------------------- /spring-cloud/image/bus-archtive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/bus-archtive.png -------------------------------------------------------------------------------- /spring-cloud/image/sleuth-follow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/sleuth-follow.png -------------------------------------------------------------------------------- /thread/image/thread_synchronized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/thread/image/thread_synchronized.png -------------------------------------------------------------------------------- /thread/image/thread_votile_order.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/thread/image/thread_votile_order.jpg -------------------------------------------------------------------------------- /dive-in-spring-boot/课纲/第二节 走向自动装配.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/课纲/第二节 走向自动装配.pdf -------------------------------------------------------------------------------- /mybatis/mybatis-cache/image/cache1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/mybatis/mybatis-cache/image/cache1.jpg -------------------------------------------------------------------------------- /mybatis/mybatis-cache/image/cache2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/mybatis/mybatis-cache/image/cache2.jpg -------------------------------------------------------------------------------- /spring-boot/image/swagger-request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/image/swagger-request.png -------------------------------------------------------------------------------- /spring-cloud/image/eureka-client-a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/eureka-client-a.png -------------------------------------------------------------------------------- /spring-cloud/image/eureka-register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/eureka-register.png -------------------------------------------------------------------------------- /spring-cloud/image/gateway_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/gateway_diagram.png -------------------------------------------------------------------------------- /spring-cloud/image/ribbon-register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/ribbon-register.png -------------------------------------------------------------------------------- /spring-cloud/image/sleuth-dependeny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/sleuth-dependeny.png -------------------------------------------------------------------------------- /dive-in-spring-boot/课纲/第一节 系列总览-核心特性.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/课纲/第一节 系列总览-核心特性.pdf -------------------------------------------------------------------------------- /dive-in-spring-boot/课纲/第四节 Web MVC 核心.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/课纲/第四节 Web MVC 核心.pdf -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/webapp/META-INF/services/javax.servlet.ServletContainerInitializer: -------------------------------------------------------------------------------- 1 | com.zwd.web.SpringServletContainerInitializer -------------------------------------------------------------------------------- /dive-in-spring-boot/课纲/第七节 渐行渐远的 Servlet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/课纲/第七节 渐行渐远的 Servlet.pdf -------------------------------------------------------------------------------- /dive-in-spring-boot/课纲/第五节 Web MVC 视图应用.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/课纲/第五节 Web MVC 视图应用.pdf -------------------------------------------------------------------------------- /mybatis/mybatis-cache/image/cacheresult1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/mybatis/mybatis-cache/image/cacheresult1.png -------------------------------------------------------------------------------- /mybatis/mybatis-cache/image/cacheresult2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/mybatis/mybatis-cache/image/cacheresult2.png -------------------------------------------------------------------------------- /mybatis/mybatis-link-query/image/link-ER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/mybatis/mybatis-link-query/image/link-ER.png -------------------------------------------------------------------------------- /spring-cloud/image/eureka_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/image/eureka_architecture.png -------------------------------------------------------------------------------- /dive-in-spring-boot/课纲/第六节 Web MVC REST 应用.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/课纲/第六节 Web MVC REST 应用.pdf -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2Markup/src/docs/asciidoc/manual_content2.adoc: -------------------------------------------------------------------------------- 1 | == Chapter of manual content 2 2 | 3 | This is some dummy text 4 | 5 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/image/tomcat-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/my-spring-mvc/image/tomcat-config.png -------------------------------------------------------------------------------- /spring5/spring-mvc/.extract/logs/access_log.2019-03-21: -------------------------------------------------------------------------------- 1 | 0:0:0:0:0:0:0:1 - - [21/Mar/2019:11:20:19 +0800] GET / HTTP/1.1 200 17 http-bio-8080-exec-1 828 2 | -------------------------------------------------------------------------------- /dive-in-spring-boot/课纲/第三节 理解 SpringApplication.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/课纲/第三节 理解 SpringApplication.pdf -------------------------------------------------------------------------------- /dive-in-spring-boot/课纲/第八节 从 Reactive 到 WebFlux.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/课纲/第八节 从 Reactive 到 WebFlux.pdf -------------------------------------------------------------------------------- /design-pattern/factory/src/main/java/com.hansn/service/Resaurant.java: -------------------------------------------------------------------------------- 1 | package com.hansn.service; 2 | 3 | public interface Resaurant { 4 | void cook(); 5 | } 6 | -------------------------------------------------------------------------------- /mybatis/mybatis-link-query/image/linkquerytestresult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/mybatis/mybatis-link-query/image/linkquerytestresult.png -------------------------------------------------------------------------------- /spring-boot/example-spring-boot-starter-test/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | example.service.enabled=true 2 | example.service.prefix=#### 3 | example.service.suffix=@@@@ -------------------------------------------------------------------------------- /spring-boot/spring-boot-grpc/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/spring-boot-grpc/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-boot/spring-boot-hot/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/spring-boot-hot/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /design-pattern/strategy/src/main/java/com/hansn/service/TicketStrategy.java: -------------------------------------------------------------------------------- 1 | package com.hansn.service; 2 | 3 | public interface TicketStrategy { 4 | void BuyTicket(); 5 | } 6 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-redis/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/spring-boot-redis/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-zuul/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-zuul/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MyThemeResolver.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | public interface MyThemeResolver { 4 | } 5 | -------------------------------------------------------------------------------- /spring5/spring-applicationlistener/src/main/java/com/zwd/listener/event/ApplicationEvent.java: -------------------------------------------------------------------------------- 1 | package com.zwd.listener.event; 2 | 3 | public interface ApplicationEvent { 4 | } 5 | -------------------------------------------------------------------------------- /spring5/spring-jdk-proxy/src/main/java/com/zwd/jdk/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.zwd.jdk.service; 2 | 3 | public interface UserService { 4 | 5 | void add(); 6 | } 7 | -------------------------------------------------------------------------------- /spring5/spring-mvc/.extract/.tomcat_executable_archive.timestamp: -------------------------------------------------------------------------------- 1 | #Timestamp file for executable war/jar 2 | #Thu Mar 21 11:20:08 CST 2019 3 | generationTimestamp=1553138391436 4 | -------------------------------------------------------------------------------- /design-pattern/delegate/src/main/java/com/hansn/service/Target.java: -------------------------------------------------------------------------------- 1 | package com.hansn.service; 2 | 3 | public interface Target { 4 | 5 | void dosomething(String commond); 6 | } 7 | -------------------------------------------------------------------------------- /design-pattern/observer/src/main/java/com/hansn/service/Observer.java: -------------------------------------------------------------------------------- 1 | package com.hansn.service; 2 | 3 | public interface Observer { 4 | void update(String message); 5 | 6 | } 7 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-grpc/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-hot/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-hot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8001 2 | username=name 3 | 4 | spring.devtools.restart.additional-paths=resources/application.properties -------------------------------------------------------------------------------- /spring-boot/spring-boot-profiles/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/spring-boot-profiles/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-boot/spring-boot-redis/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/spring-boot-swagger2/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientA/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-clientA/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientB/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-clientB/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-eureka/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-eureka/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-feign/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-feign/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-gateway/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-gateway/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-hystrix/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-hystrix/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-ribbon/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-ribbon/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-zuul/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring5/spring-mvc/.extract/work/Tomcat/localhost/_/SESSIONS.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring5/spring-mvc/.extract/work/Tomcat/localhost/_/SESSIONS.ser -------------------------------------------------------------------------------- /spring-boot/spring-boot-profiles/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientA/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientB/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-eureka/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-feign/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-gateway/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-hystrix/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-ribbon/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-clientB/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=sleuth-client-b 2 | server.port=8010 3 | spring.zipkin.base-url=http://localhost:9411 -------------------------------------------------------------------------------- /dive-in-spring-boot/spring-servlet/.extract/.tomcat_executable_archive.timestamp: -------------------------------------------------------------------------------- 1 | #Timestamp file for executable war/jar 2 | #Tue Jun 05 20:42:29 CST 2018 3 | generationTimestamp=1528202526376 4 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2Markup/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/spring-boot-swagger2Markup/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2Markup/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-client/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-bus-client/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-client/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-server/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-bus-server/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-server/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-client/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-server/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-grpc-server/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-grpc-server/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-grpc-server/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-lcn-producer/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-lcn-producer/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-lcn-producer/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-clientA/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-clientA/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=sleuth-client-a 2 | server.port=8009 3 | 4 | spring.zipkin.base-url=http://localhost:9411 -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-clientB/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-server/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8008 2 | spring.zipkin.base-url=http://localhost:9411 3 | spring.application.name=spring-cloud-sleuth -------------------------------------------------------------------------------- /dive-in-spring-boot/overview/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/overview/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-boot/spring-boot-controller-advice/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-client/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-config-client/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-server/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-config-server/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-clientA/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-sleuth-clientA/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-clientB/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-sleuth-clientB/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-server/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-cloud/spring-cloud-sleuth-server/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /design-pattern/factory/src/main/java/com.hansn/service/CookFactory.java: -------------------------------------------------------------------------------- 1 | package com.hansn.service; 2 | 3 | public abstract class CookFactory { 4 | public abstract Resaurant createRestaurant(); 5 | } 6 | -------------------------------------------------------------------------------- /spring-boot/example-spring-boot-starter/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.example.zwd.springbootstarter.config.ExampleAutoConfigure -------------------------------------------------------------------------------- /spring-boot/spring-boot-caffineCache/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cache: 3 | type: caffeine 4 | caffeine: 5 | spec: initialCapacity=10,maximumSize=5000,expireAfterWrite=100s -------------------------------------------------------------------------------- /spring-boot/spring-boot-controller-advice/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/spring-boot/spring-boot-controller-advice/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-boot/spring-boot-enable/src/main/java/com/zwd/boot/server/Server.java: -------------------------------------------------------------------------------- 1 | package com.zwd.boot.server; 2 | 3 | public interface Server { 4 | 5 | void start(); 6 | 7 | void close(); 8 | } 9 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-feign/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=spring-cloud-feign 2 | server.port=8004 3 | eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/ -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-hystrix/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=spring-cloud-hystrix 2 | server.port=8005 3 | eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/ -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-ribbon/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=spring-cloud-ribbon 2 | server.port=8003 3 | eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/ -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/autoconfigure/src/main/resources/META-INF/spring.factories -------------------------------------------------------------------------------- /dive-in-spring-boot/springboot-view/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DespairYoke/java-advance/HEAD/dive-in-spring-boot/springboot-view/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientA/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=eureka-client-a 2 | server.port=8001 3 | 4 | eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/ 5 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientB/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=eureka-client-b 2 | server.port=8002 3 | 4 | eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/ 5 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-lcn-producer/src/main/java/com/example/zwd/springcloudlcnproducer/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudlcnproducer.mapper; 2 | 3 | public class UserMapper { 4 | } 5 | -------------------------------------------------------------------------------- /spring5/making-myorm/src/main/java/com/zwd/orm/configuration/Excutor.java: -------------------------------------------------------------------------------- 1 | package com.zwd.orm.configuration; 2 | 3 | public interface Excutor { 4 | 5 | T query(String statement,Object parameter); 6 | } 7 | -------------------------------------------------------------------------------- /spring5/spring-mvc/.extract/webapps/ROOT/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Archiver-Version: Plexus Archiver 3 | Built-By: zwd-admin 4 | Created-By: Apache Maven 3.5.2 5 | Build-Jdk: 1.8.0_151 6 | 7 | -------------------------------------------------------------------------------- /dive-in-spring-boot/spring-servlet/.extract/webapps/ROOT/META-INF/maven/com.imooc/spring-servlet/pom.properties: -------------------------------------------------------------------------------- 1 | #Created by Apache Maven 3.5.0 2 | version=0.0.1-SNAPSHOT 3 | groupId=com.imooc 4 | artifactId=spring-servlet 5 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2Markup/src/docs/asciidoc/manual_content1.adoc: -------------------------------------------------------------------------------- 1 | == Chapter of manual content 1 2 | 3 | This is some dummy text 4 | 5 | === Sub chapter 6 | 7 | Dummy text of sub chapter 8 | 9 | 10 | -------------------------------------------------------------------------------- /spring5/making-myorm/src/main/java/com/zwd/orm/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zwd.orm.mapper; 2 | 3 | import com.zwd.orm.domain.User; 4 | 5 | public interface UserMapper { 6 | 7 | User getUserById(int id); 8 | } 9 | -------------------------------------------------------------------------------- /mybatis/mybatis-transaction-manager/src/main/resources/db/database.sql: -------------------------------------------------------------------------------- 1 | drop table user if exists; 2 | 3 | create table user ( 4 | id int not null, 5 | name varchar(25) not null, 6 | constraint pk_user primary key (id) 7 | ); -------------------------------------------------------------------------------- /spring5/spring-transaction/src/main/resources/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8 2 | jdbc.driverClass=com.mysql.jdbc.Driver 3 | jdbc.username=root 4 | jdbc.password=root -------------------------------------------------------------------------------- /spring5/FactoryBeanAndBeanFactory/src/main/java/com/zwd/factorybean/FactoryBeanMain.java: -------------------------------------------------------------------------------- 1 | package com.zwd.factorybean; 2 | 3 | public class FactoryBeanMain { 4 | 5 | public static void main(String[] args) { 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /spring5/spring-mvc/.extract/webapps/ROOT/META-INF/maven/com.java.advance/spring-mvc/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven 2 | #Thu Mar 21 11:19:49 CST 2019 3 | version=0.0.1-SNAPSHOT 4 | groupId=com.java.advance 5 | artifactId=spring-mvc 6 | -------------------------------------------------------------------------------- /dive-in-spring-boot/springboot-view/src/main/resources/templates/thymeleaf/hello-world.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

!!!

5 | 2018 6 | 7 | 8 | -------------------------------------------------------------------------------- /mybatis/spring-mybatis/src/main/java/com/zwd/mybatis/spring/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.spring.mapper; 2 | 3 | import com.zwd.mybatis.spring.pojo.User; 4 | 5 | public interface UserMapper { 6 | 7 | User selectUserById(int id); 8 | } 9 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-jdbctemplate/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | spring.datasource.driver-class-name= -------------------------------------------------------------------------------- /mybatis/spring-mybatis/src/main/resources/db/database.sql: -------------------------------------------------------------------------------- 1 | drop table user if exists; 2 | 3 | create table user ( 4 | id int not null, 5 | name varchar(25) not null, 6 | constraint pk_user primary key (id) 7 | ); 8 | 9 | insert into user(id,name) values (1, 'zwd'); -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-client/src/main/resources/bootstrap.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=config-client 2 | 3 | server.port=8111 4 | spring.cloud.config.label=master 5 | 6 | spring.cloud.config.uri=http://localhost:8888 7 | 8 | spring.cloud.config.profile=dev -------------------------------------------------------------------------------- /design-pattern/proxy/src/main/java/com/hansn/service/TicketService.java: -------------------------------------------------------------------------------- 1 | package com.hansn.service; 2 | 3 | public interface TicketService { 4 | //售票 5 | void sellTicket(); 6 | //咨询 7 | void Consultation(); 8 | //退票 9 | void ReturnTicket(); 10 | } 11 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MyHandlerInterceptor.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | /** 4 | * TODO... 5 | * 6 | * @author zwd 7 | * @since 2019-04-27 8 | **/ 9 | public interface MyHandlerInterceptor { 10 | } 11 | -------------------------------------------------------------------------------- /design-pattern/factory/src/main/java/com.hansn/serviceimpl/Duck.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.Resaurant; 4 | 5 | public class Duck implements Resaurant{ 6 | public void cook() { 7 | System.out.println("来一份烤鸭"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /design-pattern/factory/src/main/java/com.hansn/serviceimpl/Fish.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.Resaurant; 4 | 5 | public class Fish implements Resaurant{ 6 | public void cook() { 7 | System.out.println("来一份红烧鱼"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /design-pattern/factory/src/main/java/com.hansn/serviceimpl/Meet.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.Resaurant; 4 | 5 | public class Meet implements Resaurant { 6 | public void cook() { 7 | System.out.println("来一份回锅肉"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2Markup/src/docs/asciidoc/index.adoc: -------------------------------------------------------------------------------- 1 | include::{generated}/overview.adoc[] 2 | include::manual_content1.adoc[] 3 | include::manual_content2.adoc[] 4 | include::{generated}/paths.adoc[] 5 | include::{generated}/security.adoc[] 6 | include::{generated}/definitions.adoc[] -------------------------------------------------------------------------------- /dive-in-spring-boot/springboot-view/src/main/resources/templates/thymeleaf/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Index Page 5 | 6 | 7 |
!!!
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-quartz/src/test/java/com/zwd/TestA.java: -------------------------------------------------------------------------------- 1 | package com.zwd; 2 | 3 | import org.junit.Test; 4 | 5 | public class TestA { 6 | 7 | @Test 8 | public void test1() { 9 | 10 | String a = "11"; 11 | long b = Long.valueOf( a); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spring5/making-myorm/src/main/resources/mappers/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-eureka/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=eureka-server 2 | server.port=8000 3 | 4 | eureka.client.register-with-eureka=false 5 | 6 | eureka.client.fetch-registry=false 7 | 8 | eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/ 9 | -------------------------------------------------------------------------------- /spring5/spring-transaction/src/main/java/com/zwd/spring/transaction/dao/StockDao.java: -------------------------------------------------------------------------------- 1 | package com.zwd.spring.transaction.dao; 2 | 3 | public interface StockDao { 4 | 5 | void addStock(String sname,int count); 6 | 7 | void updateStock(String sname,int count,boolean isbuy); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /mybatis/mybatis-proxy/src/main/java/com/zwd/mybatis/proxy/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.proxy.mapper; 2 | 3 | import com.zwd.mybatis.proxy.pojo.User; 4 | 5 | public interface UserMapper { 6 | 7 | User selectUserById(int id); 8 | 9 | void insertUser(User user); 10 | } 11 | -------------------------------------------------------------------------------- /design-pattern/delegate/src/main/java/com/hansn/DelegateTest.java: -------------------------------------------------------------------------------- 1 | package com.hansn; 2 | 3 | import com.hansn.serviceimpl.Leader; 4 | 5 | public class DelegateTest { 6 | public static void main(String[] args) { 7 | new Leader().dosomething("打印文件"); 8 | } 9 | 10 | 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /dive-in-spring-boot/spring-webmvc/src/main/webapp/WEB-INF/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | ${message} 4 | ${acceptLanguage} 5 | ${jsessionId} 6 | 7 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-log/src/main/java/com/zwd/log/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zwd.log.mapper; 2 | 3 | import com.zwd.log.entity.User; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository 7 | public interface UserMapper { 8 | 9 | User selectUser(Integer id); 10 | } 11 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/webapp/WEB-INF/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | ${message} 4 | ${acceptLanguage} 5 | ${jsessionId} 6 | 7 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-redis/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Redis数据库索引(默认为0),如果设置为1,那么存入的key-value都存放在select 1中 2 | spring.redis.database=0 3 | # Redis服务器地址 4 | spring.redis.host=114.215.42.166 5 | # Redis服务器连接端口 6 | spring.redis.port=6379 7 | # Redis服务器连接密码(默认为空) 8 | spring.redis.password=huluwa890TJ 9 | -------------------------------------------------------------------------------- /spring5/spring-applicationlistener/src/main/java/com/zwd/listener/event/ContextRefreshedEvent.java: -------------------------------------------------------------------------------- 1 | package com.zwd.listener.event; 2 | 3 | public class ContextRefreshedEvent implements ApplicationEvent{ 4 | 5 | public String onEvent() { 6 | 7 | return "ContextRefreshedEvent"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-grpc-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=spring-clou-grpc-server 2 | server.port=8012 3 | grpc.server.port=8012 4 | eureka.client.fetch-registry=true 5 | eureka.client.register-with-eureka=true 6 | eureka.client.service-url.defaultZone=http://localhost:8000/eureka/ -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MySmartView.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | /** 4 | * TODO... 5 | * 6 | * @author zwd 7 | * @since 2019-05-11 8 | **/ 9 | public interface MySmartView extends MyView{ 10 | 11 | boolean isRedirectView(); 12 | } 13 | -------------------------------------------------------------------------------- /spring5/spring-transaction/src/main/java/com/zwd/spring/transaction/dao/AccountDao.java: -------------------------------------------------------------------------------- 1 | package com.zwd.spring.transaction.dao; 2 | 3 | public interface AccountDao { 4 | 5 | void addAccount(String name,double money); 6 | 7 | void updateAccount(String name,double money,boolean isbuy); 8 | 9 | } 10 | 11 | -------------------------------------------------------------------------------- /design-pattern/strategy/src/main/java/com/hansn/serviceimpl/Vip.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.TicketStrategy; 4 | 5 | public class Vip implements TicketStrategy { 6 | @Override 7 | public void BuyTicket() { 8 | System.out.println("办年卡游客享受8折优惠"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /dive-in-spring-boot/springboot-view/src/main/webapp/WEB-INF/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | ${message} 4 | ${acceptLanguage} 5 | ${jsessionId} 6 | 7 | -------------------------------------------------------------------------------- /design-pattern/strategy/src/main/java/com/hansn/serviceimpl/Normal.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.TicketStrategy; 4 | 5 | public class Normal implements TicketStrategy { 6 | @Override 7 | public void BuyTicket() { 8 | System.out.println("普通游客没有优惠"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /mybatis/mybatis-transaction-analysis/src/main/java/com/zwd/mybatis/analysis/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.analysis.mapper; 2 | 3 | import com.zwd.mybatis.analysis.pojo.User; 4 | 5 | public interface UserMapper { 6 | 7 | User selectUserById(int id); 8 | 9 | void insertUser(User user); 10 | } 11 | -------------------------------------------------------------------------------- /design-pattern/observer/src/main/java/com/hansn/service/Observable.java: -------------------------------------------------------------------------------- 1 | package com.hansn.service; 2 | 3 | public interface Observable { 4 | //注册观察者 5 | void registerObserver(Observer observer); 6 | //取消观察者 7 | void removeObserver(Observer observer); 8 | //通知所有观察者更新消息 9 | void notifyObserver(); 10 | } 11 | -------------------------------------------------------------------------------- /design-pattern/signle/src/main/java/com/hansn/dao/Singleton3.java: -------------------------------------------------------------------------------- 1 | package com.hansn.dao; 2 | 3 | public class Singleton3 { 4 | //饿汉式 5 | private static Singleton3 instance = new Singleton3(); 6 | private Singleton3(){} 7 | public static Singleton3 getInstance(){ 8 | return instance; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /mybatis/mybatis-transaction-manager/src/main/java/com/zwd/mybatis/transaction/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.transaction.mapper; 2 | 3 | import com.zwd.mybatis.transaction.pojo.User; 4 | 5 | public interface UserMapper { 6 | 7 | User selectUserById(int id); 8 | 9 | void insertUser(User user); 10 | } 11 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-gateway/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8007 2 | spring.application.name=spring-cloud-gateway 3 | spring.cloud.gateway.discovery.locator.enabled=true 4 | spring.cloud.gateway.discovery.locator.lower-case-service-id=true 5 | 6 | eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/ -------------------------------------------------------------------------------- /spring5/FactoryBeanAndBeanFactory/src/main/java/com/zwd/factorybean/domain/Dog.java: -------------------------------------------------------------------------------- 1 | package com.zwd.factorybean.domain; 2 | 3 | public class Dog { 4 | private String msg; 5 | 6 | public Dog(String msg){ 7 | this.msg=msg; 8 | } 9 | public void run(){ 10 | System.out.println(msg); 11 | } 12 | } -------------------------------------------------------------------------------- /spring5/spring-applicationlistener/src/main/java/com/zwd/listener/context/ConfigurableApplicationContext.java: -------------------------------------------------------------------------------- 1 | package com.zwd.listener.context; 2 | 3 | import com.zwd.listener.ApplicationListener; 4 | 5 | public interface ConfigurableApplicationContext { 6 | 7 | void addApplicationListener(ApplicationListener listener); 8 | } 9 | -------------------------------------------------------------------------------- /design-pattern/strategy/src/main/java/com/hansn/serviceimpl/Children.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.TicketStrategy; 4 | 5 | public class Children implements TicketStrategy { 6 | @Override 7 | public void BuyTicket() { 8 | System.out.println("1米2以下儿童享受5折优惠"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /spring5/spring-mvc-event/src/main/java/com/zwd/event/Configration.java: -------------------------------------------------------------------------------- 1 | package com.zwd.event; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | @ComponentScan("com.zwd.event") 8 | public class Configration { 9 | } 10 | 11 | -------------------------------------------------------------------------------- /spring5/spring-applicationlistener/src/main/java/com/zwd/listener/SmartApplicationListener.java: -------------------------------------------------------------------------------- 1 | package com.zwd.listener; 2 | 3 | import com.zwd.listener.event.ApplicationEvent; 4 | 5 | public interface SmartApplicationListener extends ApplicationListener { 6 | 7 | boolean supportsSourceType( Class sourceType); 8 | } 9 | -------------------------------------------------------------------------------- /design-pattern/factory/src/main/java/com.hansn/serviceimpl/FishFactory.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.CookFactory; 4 | import com.hansn.service.Resaurant; 5 | 6 | public class FishFactory extends CookFactory { 7 | public Resaurant createRestaurant() { 8 | return new Fish(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /spring5/spring-jdk-proxy/src/main/java/com/zwd/jdk/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zwd.jdk.service.impl; 2 | 3 | import com.zwd.jdk.service.UserService; 4 | 5 | public class UserServiceImpl implements UserService { 6 | @Override 7 | public void add() { 8 | System.out.println("-----add-------"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-hsql/src/main/java/com/zwd/hsql/service/DaoService.java: -------------------------------------------------------------------------------- 1 | package com.zwd.hsql.service; 2 | 3 | import com.zwd.hsql.entity.Demo; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | 7 | public interface DaoService extends CrudRepository { 8 | 9 | Demo findByName(String name); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-lcn-producer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8016 2 | spring.application.name=spring-cloud-lcn-producer 3 | 4 | spring.datasource.url=jdbc:mysql://localhost:3306/test?characterEncoding=utf8 5 | spring.datasource.username=root 6 | spring.datasource.password=root 7 | 8 | mybatis.config-location=mappers/*Mapper.xml -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/mvc/condition/MyMediaTypeExpression.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet.mvc.condition; 2 | 3 | import org.springframework.http.MediaType; 4 | 5 | public interface MyMediaTypeExpression { 6 | 7 | MediaType getMediaType(); 8 | 9 | boolean isNegated(); 10 | } 11 | -------------------------------------------------------------------------------- /design-pattern/delegate/src/main/java/com/hansn/serviceimpl/BTarget.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.Target; 4 | 5 | public class BTarget implements Target { 6 | //B员工需要做的事情 7 | @Override 8 | public void dosomething(String commond) { 9 | System.out.println("B员工做具体的事情"+commond); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /design-pattern/delegate/src/main/java/com/hansn/serviceimpl/ATarget.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.Target; 4 | 5 | public class ATarget implements Target { 6 | //A员工做具体的事情 7 | @Override 8 | public void dosomething(String commond) { 9 | System.out.println("A员工做具体的事情"+commond + ""); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /design-pattern/factory/src/main/java/com.hansn/serviceimpl/DuckFactory.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.CookFactory; 4 | import com.hansn.service.Resaurant; 5 | 6 | public class DuckFactory extends CookFactory { 7 | @Override 8 | public Resaurant createRestaurant() { 9 | return new Duck(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /dive-in-spring-boot/spring-servlet/.extract/logs/access_log.2018-06-05: -------------------------------------------------------------------------------- 1 | 127.0.0.1 - - [05/Jun/2018:20:42:34 +0800] GET /async-servlet HTTP/1.1 500 5 http-bio-8080-exec-2 827 2 | 127.0.0.1 - - [05/Jun/2018:20:42:45 +0800] GET /async-servlet HTTP/1.1 500 5 http-bio-8080-exec-4 950 3 | 127.0.0.1 - - [05/Jun/2018:21:08:47 +0800] GET /async-servlet HTTP/1.1 500 5 http-bio-8080-exec-6 482 4 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-jdbctemplate/src/main/java/com/example/jdbctemplate/entity/Shop.java: -------------------------------------------------------------------------------- 1 | package com.example.jdbctemplate.entity; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @description: 7 | * @author: 青阳 8 | * @create: 2019-11-19 09:54 9 | */ 10 | 11 | @Data 12 | public class Shop { 13 | 14 | private int id; 15 | 16 | private int number; 17 | } 18 | -------------------------------------------------------------------------------- /spring5/spring-applicationlistener/src/main/java/com/zwd/listener/ApplicationListener.java: -------------------------------------------------------------------------------- 1 | package com.zwd.listener; 2 | 3 | import com.zwd.listener.event.ApplicationEvent; 4 | 5 | import java.util.EventListener; 6 | 7 | public interface ApplicationListener extends EventListener { 8 | 9 | void onApplicationEvent(E event); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-quartz/src/main/java/com/zwd/quartz/config/JobInfo.java: -------------------------------------------------------------------------------- 1 | package com.zwd.quartz.config; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class JobInfo { 9 | 10 | private Date date; 11 | 12 | private String jobId; 13 | 14 | private String groupId; 15 | 16 | private String usercontractid; 17 | } 18 | -------------------------------------------------------------------------------- /spring5/cglib/src/main/java/com/zwd/cglib/dao/Dao.java: -------------------------------------------------------------------------------- 1 | package com.zwd.cglib.dao; 2 | 3 | /** 4 | * @author zwd 5 | * @since 2019-08-12 6 | **/ 7 | public class Dao { 8 | 9 | public void update() { 10 | System.out.println("PeopleDao.update()"); 11 | } 12 | 13 | public void select() { 14 | System.out.println("PeopleDao.select()"); 15 | } 16 | } -------------------------------------------------------------------------------- /spring5/spring-transaction/src/main/java/com/zwd/spring/transaction/exception/BuyStockException.java: -------------------------------------------------------------------------------- 1 | package com.zwd.spring.transaction.exception; 2 | 3 | public class BuyStockException extends Exception { 4 | 5 | public BuyStockException() { 6 | super(); 7 | } 8 | 9 | public BuyStockException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-server/src/main/resources/bootstrap.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=config-server 2 | server.port=8888 3 | 4 | spring.cloud.config.server.git.uri=https://github.com/DespairYoke/java-advance 5 | spring.cloud.config.server.git.search-paths=spring-cloud/config-repo 6 | spring.cloud.config.server.git.username=username 7 | spring.cloud.config.server.git.password=password -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-lcn-producer/src/main/resources/mappers/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/webapp/WEB-INF/jsp/WebApplicationInitializer.java: -------------------------------------------------------------------------------- 1 | //package com.zwd.web; 2 | // 3 | //import javax.servlet.ServletContext; 4 | // 5 | ///** 6 | // * TODO... 7 | // * 8 | // * @author zwd 9 | // * @since 2019-04-18 10 | // **/ 11 | //public interface WebApplicationInitializer { 12 | // 13 | // 14 | // void onStartup(ServletContext servletCOntext); 15 | //} 16 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-jdbctemplate/src/test/java/com/example/jdbctemplate/SpringbootJdbctemplateApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.jdbctemplate; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootJdbctemplateApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /design-pattern/signle/src/main/java/com/hansn/dao/Singleton.java: -------------------------------------------------------------------------------- 1 | package com.hansn.dao; 2 | 3 | public class Singleton { 4 | 5 | //懒汉式,线程不安全 6 | private static Singleton instance; 7 | private Singleton(){} 8 | public static Singleton getInstance(){ 9 | if(instance == null){ 10 | instance = new Singleton(); 11 | } 12 | return instance; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-enable/src/main/java/com/zwd/boot/server/FtpServer.java: -------------------------------------------------------------------------------- 1 | package com.zwd.boot.server; 2 | 3 | 4 | public class FtpServer implements Server { 5 | 6 | @Override 7 | public void start() { 8 | System.out.println("ftpServer 启动....."); 9 | } 10 | 11 | @Override 12 | public void close() { 13 | System.out.println("ftpServer 关闭....."); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-enable/src/main/java/com/zwd/boot/server/HttpServer.java: -------------------------------------------------------------------------------- 1 | package com.zwd.boot.server; 2 | 3 | 4 | public class HttpServer implements Server{ 5 | @Override 6 | public void start() { 7 | System.out.println("httpServer 启动....."); 8 | } 9 | 10 | @Override 11 | public void close() { 12 | System.out.println("httpServer 关闭....."); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-quartz/src/main/java/com/zwd/quartz/Bootstap.java: -------------------------------------------------------------------------------- 1 | package com.zwd.quartz; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Bootstap { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Bootstap.class); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /design-pattern/factory/src/main/java/com.hansn/Factory.java: -------------------------------------------------------------------------------- 1 | package com.hansn; 2 | 3 | import com.hansn.service.Resaurant; 4 | import com.hansn.serviceimpl.Fish; 5 | import com.hansn.serviceimpl.Meet; 6 | 7 | public class Factory { 8 | public static void main(String[] args) { 9 | //简单工厂模式 10 | Resaurant resaurant = Wait.getMean(Wait.MEAN_DUCK); 11 | resaurant.cook(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /design-pattern/proxy/src/main/java/com/hansn/ProxyTest.java: -------------------------------------------------------------------------------- 1 | package com.hansn; 2 | 3 | import com.hansn.proxy.StationProxy; 4 | import com.hansn.serviceimpl.Station; 5 | 6 | public class ProxyTest { 7 | public static void main(String[] args) { 8 | Station station = new Station(); 9 | StationProxy stationProxy = new StationProxy(station); 10 | stationProxy.sellTicket(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-enable/src/main/java/com/zwd/boot/configration/HelloWorldConfigration.java: -------------------------------------------------------------------------------- 1 | package com.zwd.boot.configration; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | public class HelloWorldConfigration { 8 | 9 | @Bean 10 | String name(){ 11 | return "我是name"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-mybatis-plus/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://47.96.127.51:3306/test 2 | spring.datasource.username=root 3 | spring.datasource.password=adminadmin 4 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 5 | 6 | mybatis-plus.mapper-locations= classpath:mapper/*.xml 7 | 8 | mybatis-plus.type-aliases-package=com.zwd.mybatis.plus.entity 9 | 10 | -------------------------------------------------------------------------------- /design-pattern/signle/src/main/java/com/hansn/dao/Singleton2.java: -------------------------------------------------------------------------------- 1 | package com.hansn.dao; 2 | 3 | public class Singleton2 { 4 | //懒汉式,线程安全 5 | private static Singleton2 instance; 6 | private Singleton2(){}; 7 | public static synchronized Singleton2 getInstance(){ 8 | if(instance == null){ 9 | instance = new Singleton2(); 10 | } 11 | return instance; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-aspectj/src/main/java/com/zwd/aspectj/BootStrap.java: -------------------------------------------------------------------------------- 1 | package com.zwd.aspectj; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BootStrap { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BootStrap.class); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-hsql/src/main/java/com/zwd/hsql/BootStrap.java: -------------------------------------------------------------------------------- 1 | package com.zwd.hsql; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BootStrap { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BootStrap.class); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-eureka/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-feign/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-ribbon/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-zuul/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring5/spring-mvc/src/main/java/com/zwd/config/DispatcherServletConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.zwd.config; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * TODO... 8 | * 9 | * @author zwd 10 | * @since 2019-03-21 11 | **/ 12 | @ComponentScan(basePackages = "com.zwd") 13 | public class DispatcherServletConfiguration { 14 | } 15 | -------------------------------------------------------------------------------- /design-pattern/signle/src/main/java/com/hansn/dao/Singleton5.java: -------------------------------------------------------------------------------- 1 | package com.hansn.dao; 2 | 3 | public class Singleton5 { 4 | //静态内部类 5 | private static class SingletonHolder { 6 | private static final Singleton5 INSTANCE = new Singleton5(); 7 | } 8 | private Singleton5 (){} 9 | 10 | public static final Singleton5 getInstance() { 11 | return SingletonHolder.INSTANCE; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-mybatis-mulidatasource/src/main/java/com/neo/Application.java: -------------------------------------------------------------------------------- 1 | package com.neo; 2 | 3 | 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | public class Application { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(Application.class, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientA/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientB/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-gateway/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-hystrix/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-grpc/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-hot/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-redis/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-client/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-clientA/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-clientB/.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 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/support/MyRequestDataValueProcessor.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet.support; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | /** 6 | * TODO... 7 | * 8 | * @author zwd 9 | * @since 2019-05-13 10 | **/ 11 | public interface MyRequestDataValueProcessor { 12 | 13 | String processUrl(HttpServletRequest request, String url); 14 | } 15 | -------------------------------------------------------------------------------- /spring5/spring-aop/src/main/java/com/java/spring/aop/service/TicketService.java: -------------------------------------------------------------------------------- 1 | package com.java.spring.aop.service; 2 | 3 | /** 4 | * @author zwd 5 | * @date 2018/10/5 13:34 6 | * @Email stephen.zwd@gmail.com 7 | */ 8 | public interface TicketService { 9 | 10 | 11 | //售票 12 | public void sellTicket(); 13 | 14 | //问询 15 | public void inquire(); 16 | 17 | //退票 18 | public void withdraw(); 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | 14 | # Package Files # 15 | *.jar 16 | *.war 17 | *.nar 18 | *.ear 19 | *.zip 20 | *.tar.gz 21 | *.rar 22 | 23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 24 | hs_err_pid* 25 | 26 | .idea 27 | target 28 | 29 | *.iml -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/java/com/imooc/diveinspringboot/service/CalculateService.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot.service; 2 | 3 | /** 4 | * 计算服务 5 | * 6 | * @author 小马哥 7 | * @since 2018/5/15 8 | */ 9 | public interface CalculateService { 10 | 11 | /** 12 | * 从多个整数 sum 求和 13 | * @param values 多个整数 14 | * @return sum 累加值 15 | */ 16 | Integer sum(Integer... values); 17 | } 18 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-mybatis-plus/src/main/java/com/zwd/mybatis/plus/BootStrap.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.plus; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BootStrap { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BootStrap.class); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-profiles/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /thread/runnable-thread/src/main/java/com/hansn/RunnableTest.java: -------------------------------------------------------------------------------- 1 | package com.hansn; 2 | 3 | import com.hansn.entity.MyRunnable; 4 | 5 | public class RunnableTest { 6 | public static void main(String[] args) { 7 | MyRunnable myRunnable = new MyRunnable(); 8 | new Thread(myRunnable,"线程一").start(); 9 | new Thread(myRunnable,"线程二").start(); 10 | new Thread(myRunnable,"线程三").start(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /thread/runnable-thread/src/main/java/com/hansn/ThreadTest.java: -------------------------------------------------------------------------------- 1 | package com.hansn; 2 | 3 | import com.hansn.entity.MyThread; 4 | 5 | public class ThreadTest { 6 | public static void main(String[] args) { 7 | MyThread myThread = new MyThread(); 8 | 9 | Thread t = new Thread(myThread,"窗口 A"); 10 | Thread t1 = new Thread(myThread, "窗口 B"); 11 | t.start(); 12 | t1.start(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /dive-in-spring-boot/spring-servlet/.extract/webapps/ROOT/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Implementation-Title: spring-servlet 3 | Implementation-Version: 0.0.1-SNAPSHOT 4 | Built-By: Mercy 5 | Implementation-Vendor-Id: com.imooc 6 | Created-By: Apache Maven 3.5.0 7 | Build-Jdk: 1.8.0_152 8 | Implementation-URL: https://projects.spring.io/spring-boot/#/spring-bo 9 | ot-starter-parent/dive-in-spring-boot/spring-servlet 10 | 11 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2Markup/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-client/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-server/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-grpc-server/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-lcn-producer/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-server/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-mybatis-mulidatasource/src/main/java/com/neo/mapper/test1/User1Mapper.java: -------------------------------------------------------------------------------- 1 | package com.neo.mapper.test1; 2 | 3 | import com.neo.entity.UserEntity; 4 | 5 | import java.util.List; 6 | 7 | public interface User1Mapper { 8 | 9 | List getAll(); 10 | 11 | UserEntity getOne(Long id); 12 | 13 | void insert(UserEntity user); 14 | 15 | void update(UserEntity user); 16 | 17 | void delete(Long id); 18 | 19 | } -------------------------------------------------------------------------------- /spring-boot/spring-boot-mybatis-mulidatasource/src/main/java/com/neo/mapper/test2/User2Mapper.java: -------------------------------------------------------------------------------- 1 | package com.neo.mapper.test2; 2 | 3 | import java.util.List; 4 | 5 | import com.neo.entity.UserEntity; 6 | 7 | public interface User2Mapper { 8 | 9 | List getAll(); 10 | 11 | UserEntity getOne(Long id); 12 | 13 | void insert(UserEntity user); 14 | 15 | void update(UserEntity user); 16 | 17 | void delete(Long id); 18 | 19 | } -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-zuul/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=spring-cloud-zuul 2 | server.port=8006 3 | eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/ 4 | 5 | zuul.routes.eureka-client-a.path=/eureka-client-a/** 6 | zuul.routes.eureka-client-a.service-id=eureka-client-a 7 | 8 | zuul.routes.eureka-client-b.path=/eureka-client-b/** 9 | zuul.routes.eureka-client-b.service-id=eureka-client-b 10 | -------------------------------------------------------------------------------- /thread/runnable-thread/src/main/java/com/hansn/entity/MyRunnable.java: -------------------------------------------------------------------------------- 1 | package com.hansn.entity; 2 | 3 | public class MyRunnable implements Runnable{ 4 | private int ticket = 10; 5 | 6 | @Override 7 | public synchronized void run() { 8 | for (int i = 0; i <100; i++) { 9 | if (this.ticket>0) { 10 | System.out.println("卖票:ticket"+this.ticket--); 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MyViewResolver.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | import org.springframework.lang.Nullable; 4 | 5 | import java.util.Locale; 6 | 7 | /** 8 | * TODO... 9 | * 10 | * @author zwd 11 | * @since 2019-05-11 12 | **/ 13 | public interface MyViewResolver { 14 | 15 | @Nullable 16 | MyView resolveViewName(String viewName, Locale locale) throws Exception; 17 | } 18 | -------------------------------------------------------------------------------- /design-pattern/template/src/main/java/com/hansn/TemplateTest.java: -------------------------------------------------------------------------------- 1 | package com.hansn; 2 | 3 | import com.hansn.Car.Audi; 4 | import com.hansn.Car.LandRover; 5 | import com.hansn.entity.CarTemplate; 6 | 7 | public class TemplateTest { 8 | public static void main(String[] args) { 9 | CarTemplate car1 = new LandRover("路虎"); 10 | CarTemplate car2 = new Audi("奥迪"); 11 | car1.buildCar(); 12 | car2.buildCar(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-server/src/main/resources/bootstrap.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=bus-server 2 | server.port=8888 3 | 4 | spring.cloud.config.server.git.uri=https://github.com/DespairYoke/java-advance 5 | spring.cloud.config.server.git.search-paths=spring-cloud/config-repo 6 | spring.cloud.config.server.git.username=despairyoke 7 | spring.cloud.config.server.git.password=a810095178 8 | 9 | eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/ -------------------------------------------------------------------------------- /spring5/spring-mvc-event/src/main/java/com/zwd/event/MyEvent.java: -------------------------------------------------------------------------------- 1 | package com.zwd.event; 2 | 3 | import org.springframework.context.ApplicationEvent; 4 | 5 | public class MyEvent extends ApplicationEvent { 6 | 7 | private String message; 8 | public MyEvent(Object source,String message) { 9 | super(source); 10 | this.message = message; 11 | } 12 | 13 | public String getMessage() { 14 | return message; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/mvc/condition/MyNameValueExpression.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet.mvc.condition; 2 | 3 | import org.springframework.lang.Nullable; 4 | 5 | /** 6 | * TODO... 7 | * 8 | * @author zwd 9 | * @since 2019-04-25 10 | **/ 11 | public interface MyNameValueExpression { 12 | 13 | String getName(); 14 | 15 | @Nullable 16 | T getValue(); 17 | 18 | boolean isNegated(); 19 | } 20 | -------------------------------------------------------------------------------- /dive-in-spring-boot/spring-webmvc/src/main/java/com/imooc/web/config/DispatcherServletConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.imooc.web.config; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.web.servlet.DispatcherServlet; 5 | 6 | /** 7 | * {@link DispatcherServlet} 配置类 8 | * 9 | * @author 小马哥 10 | * @since 2018/5/21 11 | */ 12 | @ComponentScan(basePackages = "com.imooc.web") 13 | public class DispatcherServletConfiguration { 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-controller-advice/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | 28 | ### VS Code ### 29 | .vscode/ 30 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/handler/MyHandlerMethodMappingNamingStrategy.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet.handler; 2 | 3 | import org.springframework.web.method.HandlerMethod; 4 | 5 | /** 6 | * TODO... 7 | * 8 | * @author zwd 9 | * @since 2019-04-24 10 | **/ 11 | @FunctionalInterface 12 | public interface MyHandlerMethodMappingNamingStrategy { 13 | 14 | String getName(HandlerMethod handlerMethod, T mapping); 15 | } 16 | -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/java/com/imooc/diveinspringboot/DiveInSpringBootApplication.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class DiveInSpringBootApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(DiveInSpringBootApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring5/spring-mvc/src/main/java/com/zwd/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | package com.zwd.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | /** 7 | * TODO... 8 | * 9 | * @author zwd 10 | * @since 2019-03-21 11 | **/ 12 | @Controller 13 | public class HelloController { 14 | 15 | @GetMapping(value = "") 16 | public String index() { 17 | 18 | return "hello"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /design-pattern/factory/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.java.advance 8 | factory 9 | 1.0-SNAPSHOT 10 | 11 | 12 | -------------------------------------------------------------------------------- /design-pattern/observer/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.java.advance 8 | observer 9 | 1.0-SNAPSHOT 10 | 11 | -------------------------------------------------------------------------------- /design-pattern/proxy/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.java.advance 8 | proxy 9 | 1.0-SNAPSHOT 10 | 11 | 12 | -------------------------------------------------------------------------------- /design-pattern/signle/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.java.advance 8 | signle 9 | 1.0-SNAPSHOT 10 | 11 | 12 | -------------------------------------------------------------------------------- /design-pattern/template/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.java.advance 8 | template 9 | 1.0-SNAPSHOT 10 | 11 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-grpc/src/main/java/com/example/zwd/springbootgrpc/SpringBootGrpcApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootgrpc; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootGrpcApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootGrpcApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring5/spring-applicationlistener/src/test/java/com/zwd/BootStrap.java: -------------------------------------------------------------------------------- 1 | package com.zwd; 2 | 3 | import com.zwd.listener.FrameworkServlet; 4 | import org.junit.Test; 5 | 6 | public class BootStrap { 7 | 8 | 9 | @Test 10 | public void test() { 11 | 12 | FrameworkServlet frameworkServlet = new FrameworkServlet(); 13 | frameworkServlet.configureAndRefreshWebApplicationContext(); 14 | frameworkServlet.abstractApplicationContext.onRefresh(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /design-pattern/delegate/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.java.advance 8 | delegate 9 | 1.0-SNAPSHOT 10 | 11 | 12 | -------------------------------------------------------------------------------- /design-pattern/prototype/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.java.advance 8 | prototype 9 | 1.0-SNAPSHOT 10 | 11 | 12 | -------------------------------------------------------------------------------- /design-pattern/strategy/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.java.advance 8 | strategy 9 | 1.0-SNAPSHOT 10 | 11 | 12 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-mybatis-mulidatasource/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | mybatis.config-locations=classpath:mybatis/mybatis-config.xml 2 | 3 | test1.driverClassName= com.mysql.cj.jdbc.Driver 4 | test1.url = jdbc:mysql://localhost:3306/zwdtest?useUnicode=true 5 | test1.username = root 6 | test1.password = root 7 | 8 | 9 | test2.driverClassName = com.mysql.cj.jdbc.Driver 10 | test2.url = jdbc:mysql://localhost:3306/zwdtest?useUnicode=true 11 | test2.username = root 12 | test2.password = root -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MyLocaleContextResolver.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | import org.springframework.context.i18n.LocaleContext; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | /** 8 | * TODO... 9 | * 10 | * @author zwd 11 | * @since 2019-05-13 12 | **/ 13 | public interface MyLocaleContextResolver extends MyLocaleResolver{ 14 | 15 | LocaleContext resolveLocaleContext(HttpServletRequest request); 16 | } 17 | -------------------------------------------------------------------------------- /spring5/spring-aop/src/main/java/com/java/spring/aop/advice/TicketServiceBeforeAdvice.java: -------------------------------------------------------------------------------- 1 | package com.java.spring.aop.advice; 2 | 3 | import org.springframework.aop.MethodBeforeAdvice; 4 | 5 | import java.lang.reflect.Method; 6 | 7 | public class TicketServiceBeforeAdvice implements MethodBeforeAdvice { 8 | 9 | @Override 10 | public void before(Method method, Object[] objects, Object o) throws Throwable { 11 | 12 | System.out.println("BEFORE_ADVICE: 欢迎光临代售点...."); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /design-pattern/factory/src/main/java/com.hansn/Cook.java: -------------------------------------------------------------------------------- 1 | package com.hansn; 2 | 3 | import com.hansn.service.Resaurant; 4 | import com.hansn.serviceimpl.DuckFactory; 5 | import com.hansn.serviceimpl.FishFactory; 6 | 7 | public class Cook { 8 | //工厂方法模式 9 | public static void main(String[] args) { 10 | Resaurant duck = new DuckFactory().createRestaurant(); 11 | duck.cook(); 12 | Resaurant fish = new FishFactory().createRestaurant(); 13 | fish.cook(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2Markup/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles.active: dev 3 | application.name: swagger2markup-demo 4 | jackson.serialization.indent_output: true 5 | 6 | server: 7 | port: 9080 8 | 9 | #management: 10 | # contextPath: /management 11 | # add-application-context-header: false 12 | 13 | info: 14 | name: ${spring.application.name} 15 | description: Swagger2Markup demo 16 | environment: ${spring.profiles.active} 17 | version: 1.0.0 -------------------------------------------------------------------------------- /spring-boot/spring-boot-mybatis-mulidatasource/src/test/java/com/neo/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.neo; 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 ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | System.out.println("hello world"); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-profiles/src/main/java/com/example/zwd/springbootprofiles/SpringBootProfilesApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootprofiles; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootProfilesApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootProfilesApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2/src/main/java/com/example/zwd/springbootswagger2/SpringBootSwagger2Application.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootswagger2; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootSwagger2Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootSwagger2Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-jdbctemplate/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-log/src/main/java/com/zwd/log/Bootstrap.java: -------------------------------------------------------------------------------- 1 | package com.zwd.log; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | 8 | @SpringBootApplication 9 | @MapperScan(value = "com.zwd.log.mapper") 10 | public class Bootstrap { 11 | 12 | public static void main(String[] args) { 13 | 14 | SpringApplication.run(Bootstrap.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MyHandlerMapping.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | import org.springframework.lang.Nullable; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | public interface MyHandlerMapping { 8 | 9 | String URI_TEMPLATE_VARIABLES_ATTRIBUTE = MyHandlerMapping.class.getName() + ".uriTemplateVariables"; 10 | 11 | 12 | @Nullable 13 | MyHandlerExecutionChain getHandler(HttpServletRequest request) throws Exception; 14 | } 15 | -------------------------------------------------------------------------------- /spring5/spring-applicationlistener/src/main/java/com/zwd/listener/GenericApplicationListener.java: -------------------------------------------------------------------------------- 1 | package com.zwd.listener; 2 | 3 | import com.sun.istack.internal.Nullable; 4 | import com.zwd.listener.event.ApplicationEvent; 5 | 6 | public interface GenericApplicationListener extends ApplicationListener{ 7 | 8 | 9 | /** 10 | * Determine whether this listener actually supports the given source type. 11 | */ 12 | boolean supportsSourceType(@Nullable Class sourceType); 13 | } 14 | -------------------------------------------------------------------------------- /design-pattern/proxy/src/main/java/com/hansn/serviceimpl/Station.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.TicketService; 4 | 5 | public class Station implements TicketService { 6 | @Override 7 | public void sellTicket() { 8 | System.out.println("售票"); 9 | } 10 | @Override 11 | public void Consultation() { 12 | System.out.println("咨询"); 13 | } 14 | @Override 15 | public void ReturnTicket() { 16 | System.out.println("退票"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /mybatis/mybatis-link-query/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #database连接 2 | spring.datasource.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true 3 | spring.datasource.username=root 4 | spring.datasource.password=root 5 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 6 | 7 | #mybatits配置 8 | #mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl 9 | 10 | mybatis.mapper-locations=classpath*:mappers/*Mapper.xml 11 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-hot/src/test/java/com/example/zwd/springboothot/SpringBootHotApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springboothot; 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 SpringBootHotApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-log/src/main/java/com/zwd/log/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.zwd.log.entity; 2 | 3 | public class User { 4 | 5 | private Integer id; 6 | 7 | private String name; 8 | 9 | public Integer getId() { 10 | return id; 11 | } 12 | 13 | public void setId(Integer id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/test/java/com/imooc/diveinspringboot/DiveInSpringBootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot; 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 DiveInSpringBootApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-grpc/src/test/java/com/example/zwd/springbootgrpc/SpringBootGrpcApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootgrpc; 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 SpringBootGrpcApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-server/src/test/java/com/example/zwd/springcloudbus/SpringCloudBusApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudbus; 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 SpringCloudBusApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-zuul/src/test/java/com/example/zwd/springcloudzuul/SpringCloudZuulApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudzuul; 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 SpringCloudZuulApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-feign/src/test/java/com/example/zwd/springcloudfeign/SpringCloudFeignApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudfeign; 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 SpringCloudFeignApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring5/spring-aop/src/main/java/com/java/spring/aop/advice/TicketServiceAfterReturningAdvice.java: -------------------------------------------------------------------------------- 1 | package com.java.spring.aop.advice; 2 | 3 | import org.springframework.aop.AfterReturningAdvice; 4 | 5 | import java.lang.reflect.Method; 6 | 7 | public class TicketServiceAfterReturningAdvice implements AfterReturningAdvice { 8 | @Override 9 | public void afterReturning(Object o, Method method, Object[] objects, Object o1) throws Throwable { 10 | 11 | System.out.println("AFTER_RETURNING:本次服务已结束...."); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spring5/spring-mvc-event/src/main/java/com/zwd/event/EventBootstrap.java: -------------------------------------------------------------------------------- 1 | package com.zwd.event; 2 | 3 | 4 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 5 | 6 | public class EventBootstrap { 7 | 8 | public static void main(String[] args) { 9 | 10 | AnnotationConfigApplicationContext act = new AnnotationConfigApplicationContext(Configration.class); 11 | 12 | EventPulish eventPulish = act.getBean(EventPulish.class); 13 | eventPulish.publish("我叫张三!"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-aspectj/src/main/java/com/zwd/aspectj/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.zwd.aspectj.controller; 2 | 3 | import org.aspectj.lang.annotation.Around; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class UserController { 9 | 10 | @GetMapping(value = "/") 11 | @Around(value = "excudeController()") 12 | public void index() { 13 | System.out.println("切面测试"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientA/src/test/java/com/example/zwd/springcloudeureka/SpringCloudEurekaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudeureka; 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 SpringCloudEurekaApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientB/src/test/java/com/example/zwd/springcloudeureka/SpringCloudEurekaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudeureka; 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 SpringCloudEurekaApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-eureka/src/test/java/com/example/zwd/springcloudeureka/SpringCloudEurekaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudeureka; 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 SpringCloudEurekaApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-lcn-producer/src/main/java/com/example/zwd/springcloudlcnproducer/SpringCloudLcnProducerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudlcnproducer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringCloudLcnProducerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringCloudLcnProducerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-ribbon/src/test/java/com/example/zwd/springcloudribbon/SpringCloudRibbonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudribbon; 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 SpringCloudRibbonApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-caffineCache/src/main/java/com/zwd/caffine/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.zwd.caffine.repository; 2 | 3 | 4 | import com.zwd.caffine.entity.User; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | 11 | 12 | @Repository 13 | public interface UserRepository extends JpaRepository, JpaSpecificationExecutor { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-profiles/src/test/java/com/example/zwd/springbootprofiles/SpringBootProfilesApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootprofiles; 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 SpringBootProfilesApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-swagger2/src/test/java/com/example/zwd/springbootswagger2/SpringBootSwagger2ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootswagger2; 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 SpringBootSwagger2ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-gateway/src/test/java/com/example/zwd/springcloudgateway/SpringCloudGatewayApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudgateway; 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 SpringCloudGatewayApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-hystrix/src/test/java/com/example/zwd/springcloudhystrix/SpringCloudHystrixApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudhystrix; 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 SpringCloudHystrixApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-server/src/test/java/com/example/zwd/springcloudsleuth/SpringCloudSleuthApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudsleuth; 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 SpringCloudSleuthApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring5/spring-transaction/src/main/java/com/zwd/spring/transaction/service/BuyStockService.java: -------------------------------------------------------------------------------- 1 | package com.zwd.spring.transaction.service; 2 | 3 | import com.zwd.spring.transaction.exception.BuyStockException; 4 | 5 | public interface BuyStockService { 6 | 7 | public void addAccount(String accountname, double money); 8 | 9 | public void addStock(String stockname, int amount); 10 | 11 | public void buyStock(String accountname, double money, String stockname, int amount) throws BuyStockException, BuyStockException; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /dive-in-spring-boot/springboot-rest/src/main/java/com/imooc/web/controller/HelloWorldController.java: -------------------------------------------------------------------------------- 1 | package com.imooc.web.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | /** 7 | * HelloWorld {@link Controller} 8 | * 9 | * @author 小马哥 10 | * @since 2018/5/28 11 | */ 12 | @Controller 13 | public class HelloWorldController { 14 | 15 | @RequestMapping("") 16 | public String index() { 17 | return "index"; 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-mybatis-plus/src/main/java/com/zwd/mybatis/plus/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.plus.entity; 2 | 3 | public class User { 4 | 5 | private Integer id; 6 | 7 | private String name; 8 | 9 | public Integer getId() { 10 | return id; 11 | } 12 | 13 | public void setId(Integer id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-feign/src/main/java/com/example/zwd/springcloudfeign/service/ConsumerService.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudfeign.service; 2 | 3 | import org.springframework.cloud.openfeign.FeignClient; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | 7 | @FeignClient(value = "eureka-client-a") 8 | public interface ConsumerService { 9 | 10 | @GetMapping(value = "hello/{name}") 11 | String hello(@PathVariable("name") String name); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-clientA/src/test/java/com/example/zwd/springcloudeureka/SpringCloudEurekaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudeureka; 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 SpringCloudEurekaApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-sleuth-clientB/src/test/java/com/example/zwd/springcloudeureka/SpringCloudEurekaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudeureka; 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 SpringCloudEurekaApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring5/making-myorm/src/main/java/com/zwd/orm/Application.java: -------------------------------------------------------------------------------- 1 | package com.zwd.orm; 2 | 3 | import com.zwd.orm.configuration.MySqlsession; 4 | import com.zwd.orm.domain.User; 5 | import com.zwd.orm.mapper.UserMapper; 6 | 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | MySqlsession sqlsession=new MySqlsession("config.xml"); 11 | UserMapper mapper = sqlsession.getMapper(UserMapper.class); 12 | User user = mapper.getUserById(1); 13 | System.out.println(user); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MyLocaleResolver.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | import org.springframework.lang.Nullable; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | import java.util.Locale; 8 | 9 | public interface MyLocaleResolver { 10 | 11 | Locale resolveLocale(HttpServletRequest request); 12 | 13 | void setLocale(HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable Locale locale); 14 | } 15 | -------------------------------------------------------------------------------- /spring5/spring-mvc-event/src/main/java/com/zwd/event/EventPulish.java: -------------------------------------------------------------------------------- 1 | package com.zwd.event; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class EventPulish { 9 | 10 | @Autowired 11 | private ApplicationContext applicationContext; 12 | 13 | 14 | public void publish(String message) { 15 | applicationContext.publishEvent(new MyEvent(this,message)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-jdbctemplate/src/main/java/com/example/jdbctemplate/SpringbootJdbcTemplateApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.jdbctemplate; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * @author Administrator 8 | */ 9 | @SpringBootApplication 10 | public class SpringbootJdbcTemplateApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringbootJdbcTemplateApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-client/src/test/java/com/example/zwd/springcloudbusclient/SpringCloudBusClientApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudbusclient; 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 SpringCloudBusClientApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /design-pattern/signle/src/main/java/com/hansn/dao/Singleton4.java: -------------------------------------------------------------------------------- 1 | package com.hansn.dao; 2 | 3 | public class Singleton4 { 4 | //双检锁 5 | private volatile static Singleton4 singleton; 6 | private Singleton4 (){} 7 | public static Singleton4 getSingleton() { 8 | if (singleton == null) { 9 | synchronized (Singleton.class) { 10 | if (singleton == null) { 11 | singleton = new Singleton4(); 12 | } 13 | } 14 | } 15 | return singleton; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /mybatis/mybatis-cache/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #database连接 2 | spring.datasource.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true 3 | spring.datasource.username=root 4 | spring.datasource.password=root 5 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 6 | 7 | #mybatits配置 8 | #mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl 9 | 10 | mybatis.mapper-locations=classpath*:mappers/*Mapper.xml 11 | 12 | mybatis.configuration.cache-enabled=true -------------------------------------------------------------------------------- /spring-boot/spring-boot-controller-advice/src/main/java/com/example/zwd/springbootcontrolleradvice/SpringBootControllerAdviceApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootcontrolleradvice; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootControllerAdviceApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootControllerAdviceApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-grpc-server/src/test/java/com/example/zwd/springcloudgrpcserver/SpringCloudGrpcServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudgrpcserver; 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 SpringCloudGrpcServerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-lcn-producer/src/test/java/com/example/zwd/springcloudlcnproducer/SpringCloudLcnProducerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudlcnproducer; 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 SpringCloudLcnProducerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring5/making-myorm/src/main/resources/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | com.mysql.jdbc.Driver 5 | jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8 6 | root 7 | root 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /design-pattern/strategy/src/main/java/com/hansn/entity/Context.java: -------------------------------------------------------------------------------- 1 | package com.hansn.entity; 2 | 3 | import com.hansn.service.TicketStrategy; 4 | 5 | public class Context { 6 | private TicketStrategy ticketStrategy; 7 | 8 | public Context(TicketStrategy strategy){ 9 | this.ticketStrategy = strategy; 10 | } 11 | 12 | public void setTicketStrategy(TicketStrategy ticketStrategy) { 13 | this.ticketStrategy = ticketStrategy; 14 | } 15 | 16 | public void BuyTicket(){ 17 | this.ticketStrategy.BuyTicket(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /mybatis/mybatis-link-query/src/main/java/com/zwd/mybatis/linkquery/Application.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.linkquery; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | 8 | @SpringBootApplication 9 | @MapperScan(value = {"com.zwd.mybatis.linkquery.mapper"}) 10 | public class Application { 11 | 12 | public static void main(String[] args) { 13 | 14 | SpringApplication.run(Application.class); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-client/src/test/java/com/example/zwd/springcloudconfigclient/SpringCloudConfigClientApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudconfigclient; 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 SpringCloudConfigClientApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-server/src/test/java/com/example/zwd/springcloudconfigserver/SpringCloudConfigServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudconfigserver; 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 SpringCloudConfigServerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/java/com/imooc/diveinspringboot/annotation/FirstLevelRepository.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot.annotation; 2 | 3 | import org.springframework.stereotype.Repository; 4 | 5 | import java.lang.annotation.*; 6 | 7 | /** 8 | * 一级 {@link Repository @Repository} 9 | * 10 | * @author 小马哥 11 | * @since 2018/5/14 12 | */ 13 | @Target({ElementType.TYPE}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Documented 16 | @Repository 17 | public @interface FirstLevelRepository { 18 | 19 | String value() default ""; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/java/com/imooc/diveinspringboot/annotation/SecondLevelRepository.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot.annotation; 2 | 3 | import org.springframework.stereotype.Repository; 4 | 5 | import java.lang.annotation.*; 6 | 7 | /** 8 | * 二级 {@link Repository} 9 | * 10 | * @author 小马哥 11 | * @since 2018/5/14 12 | */ 13 | @Target({ElementType.TYPE}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Documented 16 | @FirstLevelRepository 17 | public @interface SecondLevelRepository { 18 | 19 | String value() default ""; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /design-pattern/observer/src/main/java/com/hansn/serviceImpl/User.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceImpl; 2 | 3 | import com.hansn.service.Observer; 4 | 5 | public class User implements Observer { 6 | private String name; 7 | private String message; 8 | 9 | public User(String name) { 10 | this.name = name; 11 | } 12 | 13 | @Override 14 | public void update(String message) { 15 | this.message = message; 16 | read(); 17 | } 18 | 19 | public void read(){ 20 | System.out.println(name + "接收到推送消息" + message); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-controller-advice/src/test/java/com/example/zwd/springbootcontrolleradvice/SpringBootControllerAdviceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootcontrolleradvice; 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 SpringBootControllerAdviceApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring5/spring-aop/src/main/java/com/java/spring/aop/advice/TicketServiceThrowsAdvice.java: -------------------------------------------------------------------------------- 1 | package com.java.spring.aop.advice; 2 | 3 | 4 | import org.springframework.aop.ThrowsAdvice; 5 | 6 | import java.lang.reflect.Method; 7 | 8 | public class TicketServiceThrowsAdvice implements ThrowsAdvice { 9 | 10 | public void afterThrowing(Exception ex){ 11 | System.out.println("AFTER_THROWING...."); 12 | } 13 | public void afterThrowing(Method method, Object[] args, Object target, Exception ex){ 14 | System.out.println("调用过程出错啦!!!!!"); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /thread/thread-lock/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | thread 7 | com.java.advance 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | thread-lock 13 | 14 | 15 | -------------------------------------------------------------------------------- /thread/threadLocal/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | thread 7 | com.java.advance 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | threadLocal 13 | 14 | 15 | -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/java/com/imooc/diveinspringboot/repository/MyFirstLevelRepository.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot.repository; 2 | 3 | import com.imooc.diveinspringboot.annotation.FirstLevelRepository; 4 | import com.imooc.diveinspringboot.annotation.SecondLevelRepository; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * 我的 {@link FirstLevelRepository} 9 | * 10 | * @author 小马哥 11 | * @since 2018/5/14 12 | */ 13 | @SecondLevelRepository(value = "myFirstLevelRepository") // Bean 名称 14 | public class MyFirstLevelRepository { 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-enable/src/main/java/com/zwd/boot/annotation/EnableHelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.zwd.boot.annotation; 2 | 3 | import com.zwd.boot.configration.HelloWorldConfigration; 4 | import org.springframework.context.annotation.Import; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | @Target(ElementType.TYPE) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Import(HelloWorldConfigration.class) 14 | public @interface EnableHelloWorld { 15 | } 16 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/mvc/condition/MyAbstractRequestCondition.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet.mvc.condition; 2 | 3 | import java.util.Collection; 4 | 5 | /** 6 | * TODO... 7 | * 8 | * @author zwd 9 | * @since 2019-04-24 10 | **/ 11 | public abstract class MyAbstractRequestCondition> implements MyRequestCondition{ 12 | 13 | public boolean isEmpty() { 14 | return getContent().isEmpty(); 15 | } 16 | 17 | protected abstract Collection getContent(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/mvc/condition/MyRequestCondition.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet.mvc.condition; 2 | 3 | import org.springframework.lang.Nullable; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | /** 8 | * TODO... 9 | * 10 | * @author zwd 11 | * @since 2019-04-24 12 | **/ 13 | public interface MyRequestCondition { 14 | 15 | T combine(T other); 16 | 17 | @Nullable 18 | T getMatchingCondition(HttpServletRequest request); 19 | 20 | int compareTo(T other, HttpServletRequest request); 21 | } 22 | -------------------------------------------------------------------------------- /thread/runnable-thread/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | thread 7 | com.java.advance 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | runnable-thread 13 | 14 | 15 | -------------------------------------------------------------------------------- /thread/thread-static/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | thread 7 | com.java.advance 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | thread-static 13 | 14 | 15 | -------------------------------------------------------------------------------- /spring5/spring-jdk-proxy/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | spring5 7 | com.java.advance 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | spring-jdk-proxy 13 | 14 | 15 | -------------------------------------------------------------------------------- /spring5/spring-mvc-event/src/main/java/com/zwd/event/MyEventListener.java: -------------------------------------------------------------------------------- 1 | package com.zwd.event; 2 | 3 | import org.apache.commons.logging.Log; 4 | import org.apache.commons.logging.LogFactory; 5 | import org.springframework.context.ApplicationListener; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class MyEventListener implements ApplicationListener { 10 | 11 | Log log = LogFactory.getLog(getClass()); 12 | @Override 13 | public void onApplicationEvent(MyEvent event) { 14 | log.info("事件触发"+ event.getMessage()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring5/FactoryBeanAndBeanFactory/src/main/java/com/zwd/factorybean/factory/DogFactoryBean.java: -------------------------------------------------------------------------------- 1 | package com.zwd.factorybean.factory; 2 | 3 | import com.zwd.factorybean.domain.Dog; 4 | import org.springframework.beans.factory.FactoryBean; 5 | 6 | public class DogFactoryBean implements FactoryBean { 7 | 8 | public Dog getObject() throws Exception { 9 | return new Dog("DogFactoryBean.run"); 10 | } 11 | 12 | public Class getObjectType() { 13 | return DogFactoryBean.class; 14 | } 15 | 16 | public boolean isSingleton() { 17 | return false; 18 | } 19 | } -------------------------------------------------------------------------------- /dive-in-spring-boot/springboot-rest/src/main/java/com/imooc/web/domain/User.java: -------------------------------------------------------------------------------- 1 | package com.imooc.web.domain; 2 | 3 | /** 4 | * 用户模型 5 | * 6 | * @author 小马哥 7 | * @since 2018/5/27 8 | */ 9 | public class User { 10 | 11 | private Long id; 12 | 13 | private String name; 14 | 15 | public Long getId() { 16 | return id; 17 | } 18 | 19 | public void setId(Long id) { 20 | this.id = id; 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientA/src/main/java/com/example/zwd/springcloudclientA/SpringCloudClientAApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudclientA; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 6 | 7 | @EnableEurekaClient 8 | @SpringBootApplication 9 | public class SpringCloudClientAApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringCloudClientAApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientB/src/main/java/com/example/zwd/springcloudclientB/SpringCloudClientBApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudclientB; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 6 | 7 | @EnableEurekaClient 8 | @SpringBootApplication 9 | public class SpringCloudClientBApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringCloudClientBApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-gateway/src/main/java/com/example/zwd/springcloudgateway/SpringCloudGatewayApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudgateway; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 6 | 7 | @EnableEurekaClient 8 | @SpringBootApplication 9 | public class SpringCloudGatewayApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringCloudGatewayApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /dive-in-spring-boot/springboot-view/src/main/java/com/imooc/web/bootstrap/SpringBootViewBootstrap.java: -------------------------------------------------------------------------------- 1 | package com.imooc.web.bootstrap; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * SpringBoot 视图引导类 8 | * 9 | * @author 小马哥 10 | * @since 2018/5/24 11 | */ 12 | @SpringBootApplication(scanBasePackages = "com.imooc.web") 13 | public class SpringBootViewBootstrap { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(SpringBootViewBootstrap.class, args); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-controller-advice/src/main/java/com/example/zwd/springbootcontrolleradvice/config/AppConfig.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootcontrolleradvice.config; 2 | 3 | import com.example.zwd.springbootcontrolleradvice.controller.HelloWorldController; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 6 | 7 | /** 8 | * 切面配置类 {@link HelloWorldController} 9 | * 10 | * 11 | * @author zwd 12 | * @since 2019-03-25 13 | **/ 14 | @Configuration 15 | @EnableAspectJAutoProxy 16 | public class AppConfig { 17 | 18 | 19 | } -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MyHandlerAdapter.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | import org.springframework.lang.Nullable; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | /** 9 | * TODO... 10 | * 11 | * @author zwd 12 | * @since 2019-04-22 13 | **/ 14 | public interface MyHandlerAdapter { 15 | 16 | boolean supports(Object handler); 17 | 18 | @Nullable 19 | MyModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/java/com/imooc/diveinspringboot/configuration/HelloWorldConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot.configuration; 2 | 3 | import com.imooc.diveinspringboot.annotation.EnableHelloWorld; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * HelloWorld 配置 9 | * 10 | * @author 小马哥 11 | * @since 2018/5/14 12 | */ 13 | public class HelloWorldConfiguration { 14 | 15 | @Bean 16 | public String helloWorld() { // 方法名即 Bean 名称 17 | return "Hello,World 2018"; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MyAsyncHandlerInterceptor.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | 6 | /** 7 | * TODO... 8 | * 9 | * @author zwd 10 | * @since 2019-04-28 11 | **/ 12 | public interface MyAsyncHandlerInterceptor extends MyHandlerInterceptor{ 13 | 14 | default void afterConcurrentHandlingStarted(HttpServletRequest request, HttpServletResponse response, 15 | Object handler) throws Exception { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-grpc-server/src/main/java/com/example/zwd/springcloudgrpcserver/SpringCloudGrpcServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudgrpcserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @EnableDiscoveryClient 8 | @SpringBootApplication 9 | public class SpringCloudGrpcServerApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringCloudGrpcServerApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring5/spring-aop/src/main/java/com/java/spring/aop/advice/TicketServiceAroundAdvice.java: -------------------------------------------------------------------------------- 1 | package com.java.spring.aop.advice; 2 | 3 | 4 | import org.aopalliance.intercept.MethodInterceptor; 5 | import org.aopalliance.intercept.MethodInvocation; 6 | 7 | public class TicketServiceAroundAdvice implements MethodInterceptor { 8 | @Override 9 | public Object invoke(MethodInvocation invocation) throws Throwable { 10 | System.out.println("AROUND_ADVICE:BEGIN...."); 11 | Object returnValue = invocation.proceed(); 12 | System.out.println("AROUND_ADVICE:END....."); 13 | return returnValue; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /dive-in-spring-boot/spring-webmvc/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | app 5 | org.springframework.web.servlet.DispatcherServlet 6 | 1 7 | 8 | contextConfigLocation 9 | /WEB-INF/app-context.xml 10 | 11 | 12 | 13 | 14 | app 15 | / 16 | 17 | 18 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-redis/src/main/java/com/example/zwd/springbootredis/SpringBootRedisApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootredis; 2 | 3 | import com.liumapp.redis.operator.config.RedisConfig; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.Import; 7 | 8 | @SpringBootApplication 9 | @Import(RedisConfig.class) 10 | public class SpringBootRedisApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringBootRedisApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-config-server/src/main/java/com/example/zwd/springcloudconfigserver/SpringCloudConfigServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudconfigserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.config.server.EnableConfigServer; 6 | 7 | @EnableConfigServer 8 | @SpringBootApplication 9 | public class SpringCloudConfigServerApplication { 10 | 11 | public static void main(String[] args) { 12 | 13 | SpringApplication.run(SpringCloudConfigServerApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /design-pattern/template/src/main/java/com/hansn/entity/CarTemplate.java: -------------------------------------------------------------------------------- 1 | package com.hansn.entity; 2 | 3 | public abstract class CarTemplate { 4 | protected String name; 5 | 6 | protected CarTemplate(String name){ 7 | this.name = name; 8 | } 9 | 10 | protected abstract void buildWheel(); 11 | 12 | protected abstract void buildEngine(); 13 | 14 | protected abstract void buildCarbody(); 15 | 16 | protected abstract void buildCarlight(); 17 | 18 | public final void buildCar(){ 19 | buildWheel(); 20 | buildEngine(); 21 | buildCarbody(); 22 | buildCarlight(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-caffineCache/src/main/java/com/zwd/caffine/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.zwd.caffine.entity; 2 | 3 | import lombok.Data; 4 | import org.hibernate.annotations.Proxy; 5 | 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.Id; 9 | import javax.persistence.Table; 10 | 11 | /** 12 | * @author Administrator 13 | */ 14 | @Data 15 | @Table(name = "user") 16 | @Entity 17 | @Proxy(lazy = false) 18 | public class User { 19 | 20 | @Id 21 | @GeneratedValue 22 | private Long id; 23 | 24 | private String name; 25 | 26 | private Integer age; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientA/src/main/java/com/example/zwd/springcloudclientA/controller/ConsumerController.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudclientA.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class ConsumerController { 9 | 10 | @GetMapping(value = "hello/{name}") 11 | public String hello(@PathVariable String name) { 12 | 13 | System.out.println( "hello "+name+"!"); 14 | 15 | return "success"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-clientB/src/main/java/com/example/zwd/springcloudclientB/controller/ConsumerController.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudclientB.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class ConsumerController { 9 | 10 | @GetMapping(value = "hello/{name}") 11 | public String hello(@PathVariable String name) { 12 | 13 | System.out.println( "hello "+name+"!"); 14 | 15 | return "success"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-grpc-server/src/main/java/com/example/zwd/springcloudgrpcserver/service/GrpcServerService.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudgrpcserver.service; 2 | 3 | import net.devh.boot.grpc.server.service.GrpcService; 4 | 5 | @GrpcService 6 | public class GrpcServerService extends GreeterGrpc.GreeterImplBase { 7 | 8 | @Override 9 | public void sayHello(HelloRequest req, StreamObserver responseObserver) { 10 | HelloReply reply = HelloReply.newBuilder().setMessage("Hello ==> " + req.getName()).build(); 11 | responseObserver.onNext(reply); 12 | responseObserver.onCompleted(); 13 | } 14 | } -------------------------------------------------------------------------------- /design-pattern/delegate/src/main/java/com/hansn/serviceimpl/Leader.java: -------------------------------------------------------------------------------- 1 | package com.hansn.serviceimpl; 2 | 3 | import com.hansn.service.Target; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | public class Leader implements Target { 9 | //领导委派员工做具体的事情 10 | private Map target = new HashMap(); 11 | public Leader(){ 12 | //领导委派员工A和员工B分别做不同的事情 13 | target.put("打印文件", new ATarget()); 14 | target.put("测试项目", new BTarget()); 15 | } 16 | @Override 17 | public void dosomething(String commond) { 18 | target.get(commond).dosomething(commond); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/java/com/imooc/diveinspringboot/annotation/EnableHelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot.annotation; 2 | 3 | import com.imooc.diveinspringboot.configuration.HelloWorldConfiguration; 4 | import org.springframework.context.annotation.Import; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * 激活 HelloWorld 模块 10 | * 11 | * @author 小马哥 12 | * @since 2018/5/14 13 | */ 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Target(ElementType.TYPE) 16 | @Documented 17 | //@Import(HelloWorldConfiguration.class) 18 | @Import(HelloWorldImportSelector.class) 19 | public @interface EnableHelloWorld { 20 | } 21 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-log/src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /mybatis/mybatis-proxy/src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 11 | 12 | 13 | insert into user (id,name) values (#{id},#{name}) 14 | 15 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MyFlashMapManager.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | import org.springframework.lang.Nullable; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | /** 9 | * TODO... 10 | * 11 | * @author zwd 12 | * @since 2019-04-22 13 | **/ 14 | public interface MyFlashMapManager { 15 | 16 | @Nullable 17 | MyFlashMap retrieveAndUpdate(HttpServletRequest request, HttpServletResponse response); 18 | 19 | void saveOutputFlashMap(MyFlashMap flashMap, HttpServletRequest request, HttpServletResponse response); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /mybatis/spring-mybatis/src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 12 | 16 | 17 | -------------------------------------------------------------------------------- /spring5/cglib/src/main/java/com/zwd/cglib/BootStrap.java: -------------------------------------------------------------------------------- 1 | package com.zwd.cglib; 2 | 3 | import com.zwd.cglib.dao.Dao; 4 | import com.zwd.cglib.proxy.DaoProxy; 5 | import net.sf.cglib.proxy.Enhancer; 6 | 7 | /** 8 | * @author zwd 9 | * @since 2019-08-12 10 | **/ 11 | public class BootStrap { 12 | 13 | public static void main(String[] args) { 14 | 15 | DaoProxy daoProxy = new DaoProxy(); 16 | 17 | Enhancer enhancer = new Enhancer(); 18 | enhancer.setSuperclass(Dao.class); 19 | enhancer.setCallback(daoProxy); 20 | 21 | Dao dao = (Dao) enhancer.create(); 22 | dao.update(); 23 | dao.select(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-client/src/main/resources/bootstrap.properties: -------------------------------------------------------------------------------- 1 | 2 | spring.application.name=bus-client 3 | 4 | server.port=8111 5 | spring.cloud.config.label=master 6 | 7 | spring.cloud.config.uri=http://localhost:8888 8 | 9 | spring.cloud.config.profile=dev 10 | 11 | spring.rabbitmq.host=47.96.127.51 12 | spring.rabbitmq.port=5672 13 | spring.rabbitmq.username=springcloud 14 | spring.rabbitmq.password=123456 15 | 16 | spring.cloud.bus.enabled=true 17 | ## 开启消息跟踪 18 | spring.cloud.bus.trace.enabled=true 19 | ## 启用bus-refresh的监控端点 20 | management.endpoints.web.exposure.include=bus-refresh 21 | 22 | eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/ -------------------------------------------------------------------------------- /spring5/spring-aop/src/main/java/com/java/spring/aop/service/impl/RailwayStation.java: -------------------------------------------------------------------------------- 1 | package com.java.spring.aop.service.impl; 2 | 3 | 4 | import com.java.spring.aop.service.TicketService; 5 | 6 | /** 7 | * @author zwd 8 | * @date 2018/10/5 13:35 9 | * @Email stephen.zwd@gmail.com 10 | */ 11 | //实现类 12 | public class RailwayStation implements TicketService { 13 | 14 | 15 | public void sellTicket(){ 16 | System.out.println("售票............"); 17 | } 18 | 19 | public void inquire() { 20 | System.out.println("问询............."); 21 | } 22 | 23 | public void withdraw() { 24 | System.out.println("退票............."); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /spring5/spring-jdk-proxy/src/main/java/com/zwd/jdk/BootStrap.java: -------------------------------------------------------------------------------- 1 | package com.zwd.jdk; 2 | 3 | import com.zwd.jdk.handler.MyInvocationHandler; 4 | import com.zwd.jdk.service.UserService; 5 | import com.zwd.jdk.service.impl.UserServiceImpl; 6 | 7 | import java.lang.reflect.Proxy; 8 | 9 | public class BootStrap { 10 | 11 | public static void main(String[] args) { 12 | UserService userService = new UserServiceImpl(); 13 | 14 | MyInvocationHandler myInvocationHandler = new MyInvocationHandler(userService); 15 | 16 | UserService proxyInstance = (UserService)myInvocationHandler.getProxy(); 17 | 18 | proxyInstance.add(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /dive-in-spring-boot/springboot-rest/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CORS 示例 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 21 | 22 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-zuul/src/main/java/com/example/zwd/springcloudzuul/SpringCloudZuulApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudzuul; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 6 | import org.springframework.cloud.netflix.zuul.EnableZuulProxy; 7 | 8 | @EnableEurekaClient 9 | @SpringBootApplication 10 | @EnableZuulProxy 11 | public class SpringCloudZuulApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(SpringCloudZuulApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /spring5/spring-aop/src/main/java/com/java/spring/aop/AopAdviceConfig.java: -------------------------------------------------------------------------------- 1 | //package com.java.spring.aop; 2 | // 3 | // 4 | //import org.aspectj.lang.JoinPoint; 5 | //import org.aspectj.lang.annotation.Aspect; 6 | //import org.aspectj.lang.annotation.Before; 7 | // 8 | ///** 9 | // * @author zwd 10 | // * @date 2018/10/5 13:27 11 | // * @Email stephen.zwd@gmail.com 12 | // */ 13 | //@Aspect 14 | //public class AopAdviceConfig { 15 | // 16 | // @Before("execution(* com.java.spring.aop.controller..*.*(..))") 17 | // public void beforeAdvice(JoinPoint joinPoint) { 18 | // System.out.println(joinPoint.getThis()); 19 | // System.out.println("我是前置通知...."); 20 | // }} 21 | -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/java/com/imooc/diveinspringboot/configuration/HelloWorldAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot.configuration; 2 | 3 | import com.imooc.diveinspringboot.annotation.EnableHelloWorld; 4 | import com.imooc.diveinspringboot.condition.ConditionalOnSystemProperty; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * HelloWorld 自动装配 9 | * 10 | * @author 小马哥 11 | * @since 2018/5/15 12 | */ 13 | @Configuration // Spring 模式注解装配 14 | @EnableHelloWorld // Spring @Enable 模块装配 15 | @ConditionalOnSystemProperty(name = "user.name", value = "Mercy") // 条件装配 16 | public class HelloWorldAutoConfiguration { 17 | } 18 | -------------------------------------------------------------------------------- /dive-in-spring-boot/springboot-rest/src/main/java/com/imooc/web/bootstrap/SpringBootRestBootstrap(1).java: -------------------------------------------------------------------------------- 1 | package com.imooc.web.bootstrap; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Spring Boot Rest 引导类 8 | * 9 | * @author 小马哥 10 | * @since 2018/5/27 11 | */ 12 | @SpringBootApplication(scanBasePackages = { 13 | "com.imooc.web.controller", 14 | "com.imooc.web.config" 15 | }) 16 | public class SpringBootRestBootstrap { 17 | 18 | public static void main(String[] args) { 19 | SpringApplication.run(SpringBootRestBootstrap.class, args); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-bus-server/src/main/java/com/example/zwd/springcloudbus/SpringCloudBusApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudbus; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.config.server.EnableConfigServer; 6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 7 | 8 | @SpringBootApplication 9 | @EnableConfigServer 10 | @EnableEurekaClient 11 | public class SpringCloudBusApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(SpringCloudBusApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-eureka/src/main/java/com/example/zwd/springcloudeureka/SpringCloudEurekaApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudeureka; 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.netflix.eureka.server.EnableEurekaServer; 7 | 8 | @EnableEurekaServer 9 | @SpringBootApplication 10 | public class SpringCloudEurekaApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringCloudEurekaApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-feign/src/main/java/com/example/zwd/springcloudfeign/SpringCloudFeignApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudfeign; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 6 | import org.springframework.cloud.openfeign.EnableFeignClients; 7 | 8 | @EnableEurekaClient 9 | @EnableFeignClients 10 | @SpringBootApplication 11 | public class SpringCloudFeignApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(SpringCloudFeignApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /spring5/making-myorm/src/main/java/com/zwd/orm/configuration/MapperBean.java: -------------------------------------------------------------------------------- 1 | package com.zwd.orm.configuration; 2 | 3 | import java.util.List; 4 | 5 | public class MapperBean { 6 | 7 | private String interfaceName; //接口名 8 | 9 | private List list; //接口下所有方法 10 | 11 | public String getInterfaceName() { 12 | return interfaceName; 13 | } 14 | 15 | public void setInterfaceName(String interfaceName) { 16 | this.interfaceName = interfaceName; 17 | } 18 | 19 | public List getList() { 20 | return list; 21 | } 22 | 23 | public void setList(List list) { 24 | this.list = list; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-mybatis-mulidatasource/src/main/resources/mybatis/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spring5/cglib/src/main/java/com/zwd/cglib/proxy/DaoProxy.java: -------------------------------------------------------------------------------- 1 | package com.zwd.cglib.proxy; 2 | 3 | import net.sf.cglib.proxy.MethodInterceptor; 4 | import net.sf.cglib.proxy.MethodProxy; 5 | 6 | import java.lang.reflect.Method; 7 | 8 | /** 9 | * @author zwd 10 | * @since 2019-08-12 11 | **/ 12 | public class DaoProxy implements MethodInterceptor { 13 | @Override 14 | public Object intercept(Object object, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable { 15 | System.out.println("Before Method Invoke"); 16 | methodProxy.invokeSuper(object, objects); 17 | System.out.println("After Method Invoke"); 18 | 19 | return object; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.properties: -------------------------------------------------------------------------------- 1 | # Default implementation classes for DispatcherServlet's strategy interfaces. 2 | # Used as fallback when no matching beans are found in the DispatcherServlet context. 3 | # Not meant to be customized by application developers. 4 | 5 | org.springframework.web.servlet.MyHandlerMapping=org.springframework.web.servlet.mvc.method.annotation.MyRequestMappingHandlerMapping 6 | 7 | org.springframework.web.servlet.MyHandlerAdapter=org.springframework.web.servlet.mvc.method.annotation.MyRequestMappingHandlerAdapter 8 | 9 | org.springframework.web.servlet.MyViewResolver=org.springframework.web.servlet.view.MyInternalResourceViewResolver -------------------------------------------------------------------------------- /spring-boot/spring-boot-enable/src/main/java/com/zwd/boot/annotation/EnableServer.java: -------------------------------------------------------------------------------- 1 | package com.zwd.boot.annotation; 2 | 3 | import com.zwd.boot.config.ServerImportRegistrar; 4 | import com.zwd.boot.config.ServerImportSelector; 5 | import org.springframework.context.annotation.Import; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | @Target(ElementType.TYPE) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | //@Import(ServerImportSelector.class) 15 | @Import(ServerImportRegistrar.class) 16 | public @interface EnableServer { 17 | 18 | String value() default "ftpServer"; 19 | } 20 | -------------------------------------------------------------------------------- /mybatis/mybatis-proxy/src/main/java/com/zwd/mybatis/proxy/pojo/User.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.proxy.pojo; 2 | 3 | public class User { 4 | 5 | private int id; 6 | 7 | private String name; 8 | 9 | public int getId() { 10 | return id; 11 | } 12 | 13 | public void setId(int id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "User{" + 28 | "id=" + id + 29 | ", name='" + name + '\'' + 30 | '}'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /mybatis/spring-mybatis/src/main/java/com/zwd/mybatis/spring/pojo/User.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.spring.pojo; 2 | 3 | public class User { 4 | 5 | private int id; 6 | 7 | private String name; 8 | 9 | public int getId() { 10 | return id; 11 | } 12 | 13 | public void setId(int id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "User{" + 28 | "id=" + id + 29 | ", name='" + name + '\'' + 30 | '}'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /dive-in-spring-boot/overview/src/main/java/com/imooc/diveinspringboot/DiveInSpringBootApplication.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot; 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication; 4 | import org.springframework.boot.builder.SpringApplicationBuilder; 5 | 6 | @SpringBootApplication 7 | //@ServletComponentScan(basePackages = "com.imooc.diveinspringboot.web.servlet") 8 | public class DiveInSpringBootApplication { 9 | 10 | public static void main(String[] args) { 11 | 12 | new SpringApplicationBuilder(DiveInSpringBootApplication.class) 13 | // .web(WebApplicationType.NONE) 14 | .run(args); 15 | // SpringApplication.run(DiveInSpringBootApplication.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/java/com/imooc/diveinspringboot/annotation/HelloWorldImportSelector.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot.annotation; 2 | 3 | import com.imooc.diveinspringboot.configuration.HelloWorldConfiguration; 4 | import org.springframework.context.annotation.ImportSelector; 5 | import org.springframework.core.type.AnnotationMetadata; 6 | 7 | /** 8 | * HelloWorld {@link ImportSelector} 实现 9 | * 10 | * @author 小马哥 11 | * @since 2018/5/14 12 | */ 13 | public class HelloWorldImportSelector implements ImportSelector { 14 | @Override 15 | public String[] selectImports(AnnotationMetadata importingClassMetadata) { 16 | return new String[]{HelloWorldConfiguration.class.getName()}; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /mybatis/mybatis-transaction-analysis/src/main/java/com/zwd/mybatis/analysis/pojo/User.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.analysis.pojo; 2 | 3 | public class User { 4 | 5 | private int id; 6 | 7 | private String name; 8 | 9 | public int getId() { 10 | return id; 11 | } 12 | 13 | public void setId(int id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "User{" + 28 | "id=" + id + 29 | ", name='" + name + '\'' + 30 | '}'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /mybatis/mybatis-transaction-manager/src/main/java/com/zwd/mybatis/transaction/pojo/User.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.transaction.pojo; 2 | 3 | public class User { 4 | 5 | private int id; 6 | 7 | private String name; 8 | 9 | public int getId() { 10 | return id; 11 | } 12 | 13 | public void setId(int id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "User{" + 28 | "id=" + id + 29 | ", name='" + name + '\'' + 30 | '}'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-ribbon/src/main/java/com/example/zwd/springcloudribbon/controller/ConsumerController.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudribbon.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 | @RestController 9 | public class ConsumerController { 10 | 11 | @Autowired 12 | RestTemplate restTemplate; 13 | 14 | 15 | @GetMapping(value = "ribbon") 16 | public String add() { 17 | 18 | return restTemplate.getForEntity("http://eureka-client-a/hello/zwd",String.class).getBody(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /design-pattern/strategy/src/main/java/com/hansn/StrategyTest.java: -------------------------------------------------------------------------------- 1 | package com.hansn; 2 | 3 | import com.hansn.entity.Context; 4 | import com.hansn.serviceimpl.Children; 5 | import com.hansn.serviceimpl.Normal; 6 | import com.hansn.serviceimpl.Vip; 7 | 8 | public class StrategyTest { 9 | public static void main(String[] args) { 10 | System.out.println("普通游客策略:"); 11 | Context context = new Context(new Normal()); 12 | context.BuyTicket(); 13 | 14 | System.out.println("年卡VIP游客策略:"); 15 | context.setTicketStrategy(new Vip()); 16 | context.BuyTicket(); 17 | 18 | System.out.println("1米2以下儿童策略:"); 19 | context.setTicketStrategy(new Children()); 20 | context.BuyTicket(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /design-pattern/template/src/main/java/com/hansn/Car/Audi.java: -------------------------------------------------------------------------------- 1 | package com.hansn.Car; 2 | 3 | import com.hansn.entity.CarTemplate; 4 | 5 | public class Audi extends CarTemplate { 6 | public Audi(String name) { 7 | super(name); 8 | } 9 | 10 | @Override 11 | protected void buildWheel() { 12 | System.out.println(name + "的普通轿车车轮"); 13 | } 14 | 15 | @Override 16 | protected void buildEngine() { 17 | System.out.println(name + "的汽油发动机"); 18 | } 19 | 20 | @Override 21 | protected void buildCarbody() { 22 | System.out.println(name + "的豪华舒适性车身"); 23 | } 24 | 25 | @Override 26 | protected void buildCarlight() { 27 | System.out.println(name + "的独特魔力车灯"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-log/src/main/java/com/zwd/log/controller/LogController.java: -------------------------------------------------------------------------------- 1 | package com.zwd.log.controller; 2 | 3 | import com.zwd.log.entity.User; 4 | import com.zwd.log.mapper.UserMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class LogController { 11 | 12 | @Autowired 13 | private UserMapper userMapper; 14 | 15 | @GetMapping(value = "/") 16 | public String select(Integer id) { 17 | User user = userMapper.selectUser(id); 18 | 19 | System.out.println(user.getName()); 20 | return user.getName(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /mybatis/mybatis-generator/src/main/java/com/zwd/mybatis/generator/Application.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.generator; 2 | 3 | import com.zwd.mybatis.generator.domain.User; 4 | import com.zwd.mybatis.generator.domain.UserExample; 5 | import com.zwd.mybatis.generator.mapper.UserMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | import java.util.List; 9 | 10 | public class Application { 11 | 12 | @Autowired 13 | private UserMapper userMapper; 14 | public static void main(String[] args) { 15 | UserExample userExample = new UserExample(); 16 | UserExample.Criteria criteria = userExample.createCriteria(); 17 | 18 | List users = userMapper.selectByExample(userExample); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-caffineCache/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 2 | spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC 3 | spring.datasource.username=root 4 | spring.datasource.password=root 5 | spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect 6 | spring.jpa.hibernate.ddl-auto=update 7 | 8 | spring.datasource.hikari.read-only=false 9 | spring.datasource.hikari.connection-timeout=60000 10 | spring.datasource.hikari.idle-timeout=60000 11 | spring.datasource.hikari.validation-timeout=3000 12 | spring.datasource.hikari.max-lifetime=60000 13 | spring.datasource.hikari.login-timeout=5 14 | spring.datasource.hikari.maximum-pool-size=60 15 | spring.datasource.hikari.minimum-idle=10 16 | spring.jpa.show-sql=true -------------------------------------------------------------------------------- /design-pattern/template/src/main/java/com/hansn/Car/LandRover.java: -------------------------------------------------------------------------------- 1 | package com.hansn.Car; 2 | 3 | import com.hansn.entity.CarTemplate; 4 | 5 | public class LandRover extends CarTemplate{ 6 | 7 | public LandRover(String name) { 8 | super(name); 9 | } 10 | 11 | @Override 12 | protected void buildWheel() { 13 | System.out.println(name + "越野车轮"); 14 | 15 | } 16 | 17 | @Override 18 | protected void buildEngine() { 19 | System.out.println(name + "柴油发动机"); 20 | } 21 | 22 | @Override 23 | protected void buildCarbody() { 24 | System.out.println(name + "SUV越野车型"); 25 | } 26 | 27 | @Override 28 | protected void buildCarlight() { 29 | System.out.println(name + "普通车灯"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/handler/MyDispatcherServletWebRequest.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet.handler; 2 | 3 | import org.springframework.web.context.request.ServletWebRequest; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | /** 9 | * TODO... 10 | * 11 | * @author zwd 12 | * @since 2019-04-28 13 | **/ 14 | public class MyDispatcherServletWebRequest extends ServletWebRequest { 15 | 16 | public MyDispatcherServletWebRequest(HttpServletRequest request) { 17 | super(request); 18 | } 19 | public MyDispatcherServletWebRequest(HttpServletRequest request, HttpServletResponse response) { 20 | super(request, response); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /dive-in-spring-boot/autoconfigure/src/main/java/com/imooc/diveinspringboot/condition/ConditionalOnSystemProperty.java: -------------------------------------------------------------------------------- 1 | package com.imooc.diveinspringboot.condition; 2 | 3 | 4 | import org.springframework.context.annotation.Conditional; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * Java 系统属性 条件判断 10 | * 11 | * @author 小马哥 12 | * @since 2018/5/15 13 | */ 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Target({ ElementType.TYPE, ElementType.METHOD }) 16 | @Documented 17 | @Conditional(OnSystemPropertyCondition.class) 18 | public @interface ConditionalOnSystemProperty { 19 | 20 | /** 21 | * Java 系统属性名称 22 | * @return 23 | */ 24 | String name(); 25 | 26 | /** 27 | * Java 系统属性值 28 | * @return 29 | */ 30 | String value(); 31 | } 32 | -------------------------------------------------------------------------------- /dive-in-spring-boot/spring-webmvc/src/main/java/com/imooc/web/controller/HelloWorldController.java: -------------------------------------------------------------------------------- 1 | package com.imooc.web.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | /** 8 | * HelloWorld {@link Controller} 9 | * 10 | * @author 小马哥 11 | * @since 2018/5/20 12 | */ 13 | @Controller 14 | public class HelloWorldController { 15 | 16 | @RequestMapping("") 17 | public String index(@RequestParam int value, Model model) { 18 | // model.addAttribute("acceptLanguage",acceptLanguage); 19 | // model.addAttribute("jsessionId",jsessionId); 20 | // model.addAttribute("message","Hello,World"); 21 | return "index"; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /spring-boot/example-spring-boot-starter/src/main/java/com/example/zwd/springbootstarter/config/ExampleServiceProperties.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootstarter.config; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | 5 | @ConfigurationProperties("example.service") 6 | public class ExampleServiceProperties { 7 | 8 | private String prefix; 9 | 10 | private String suffix; 11 | 12 | public String getPrefix() { 13 | return prefix; 14 | } 15 | 16 | public void setPrefix(String prefix) { 17 | this.prefix = prefix; 18 | } 19 | 20 | public String getSuffix() { 21 | return suffix; 22 | } 23 | 24 | public void setSuffix(String suffix) { 25 | this.suffix = suffix; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-log/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #database连接 2 | spring.datasource.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true 3 | spring.datasource.username=root 4 | spring.datasource.password=adminadmin 5 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 6 | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource 7 | 8 | mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl 9 | mybatis.mapper-locations= classpath:mapper/*Mapper.xml 10 | 11 | #logging.path=/tmp 12 | #logging.file=springbootdemo.log 13 | 14 | #logging.level.root=WARN 15 | #logging.level.org.springframework.web=DEBUG 16 | #logging.level.org.hibernate=ERROR 17 | 18 | logging.level.com.zwd.log = warn -------------------------------------------------------------------------------- /dive-in-spring-boot/springboot-rest/src/main/java/com/imooc/web/controller/UserRestController.java: -------------------------------------------------------------------------------- 1 | package com.imooc.web.controller; 2 | 3 | import com.imooc.web.domain.User; 4 | import org.springframework.web.bind.annotation.PostMapping; 5 | import org.springframework.web.bind.annotation.RequestBody; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | * User {@link RestController} 10 | * 11 | * @author 小马哥 12 | * @since 2018/5/27 13 | */ 14 | @RestController 15 | public class UserRestController { 16 | 17 | @PostMapping(value = "/echo/user", 18 | consumes = "application/*;charset=UTF-8", 19 | produces = "application/json;charset=UTF-8") 20 | public User user(@RequestBody User user) { 21 | return user; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /spring-cloud/spring-cloud-feign/src/main/java/com/example/zwd/springcloudfeign/controller/ConsumerController.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springcloudfeign.controller; 2 | 3 | import com.example.zwd.springcloudfeign.service.ConsumerService; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class ConsumerController { 11 | 12 | @Autowired 13 | ConsumerService consumerService; 14 | 15 | @GetMapping(value = "hello/{name}") 16 | public String hello(@PathVariable String name) { 17 | return consumerService.hello(name); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | testServlet 5 | org.springframework.web.servlet.MyDispatcherServlet 6 | 7 | 1 8 | 9 | contextConfigLocation 10 | /WEB-INF/app-context.xml 11 | 12 | 13 | 14 | 15 | testServlet 16 | / 17 | 18 | -------------------------------------------------------------------------------- /design-pattern/factory/src/main/java/com.hansn/Wait.java: -------------------------------------------------------------------------------- 1 | package com.hansn; 2 | 3 | import com.hansn.service.Resaurant; 4 | import com.hansn.serviceimpl.Duck; 5 | import com.hansn.serviceimpl.Fish; 6 | import com.hansn.serviceimpl.Meet; 7 | 8 | public class Wait { 9 | public static final int MEAN_MEET = 1; 10 | public static final int MEAN_FISH = 2; 11 | public static final int MEAN_DUCK = 3; 12 | 13 | public static Resaurant getMean(int meantype){ 14 | switch (meantype){ 15 | case MEAN_MEET : 16 | return new Meet(); 17 | case MEAN_FISH : 18 | return new Fish(); 19 | case MEAN_DUCK : 20 | return new Duck(); 21 | default: 22 | return null; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /thread/thread-state/src/test/java/com/zwd/state/ThreadState.java: -------------------------------------------------------------------------------- 1 | //package com.zwd.state; 2 | // 3 | //import org.junit.Test; 4 | // 5 | //public class ThreadState { 6 | // 7 | // @Test 8 | // public void testJoin() { 9 | // Thread t = new Thread(new Runnable() { 10 | // @Override 11 | // public void run() { 12 | // try { 13 | // Thread.sleep(2000); 14 | // } catch (InterruptedException e) { 15 | // e.printStackTrace(); 16 | // } 17 | // System.out.println("i am "+Thread.currentThread()); 18 | // } 19 | // }); 20 | // 21 | // t.start(); 22 | //// t.join(); 23 | // System.out.println("i am "+Thread.currentThread()); 24 | // } 25 | //} 26 | -------------------------------------------------------------------------------- /spring5/spring-transaction/src/main/java/com/zwd/spring/transaction/domain/Account.java: -------------------------------------------------------------------------------- 1 | package com.zwd.spring.transaction.domain; 2 | 3 | /** 4 | * 账户对象 5 | * 6 | */ 7 | public class Account { 8 | 9 | private int accountid; 10 | private String name; 11 | private int balance; 12 | 13 | 14 | public int getAccountid() { 15 | return accountid; 16 | } 17 | public void setAccountid(int accountid) { 18 | this.accountid = accountid; 19 | } 20 | public String getName() { 21 | return name; 22 | } 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | public int getBalance() { 27 | return balance; 28 | } 29 | public void setBalance(int balance) { 30 | this.balance = balance; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring5/my-spring-mvc/src/main/java/org/springframework/web/servlet/MyView.java: -------------------------------------------------------------------------------- 1 | package org.springframework.web.servlet; 2 | 3 | import org.springframework.lang.Nullable; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | import java.util.Map; 8 | 9 | public interface MyView { 10 | 11 | String RESPONSE_STATUS_ATTRIBUTE = MyView.class.getName() + ".responseStatus"; 12 | 13 | String PATH_VARIABLES = MyView.class.getName() + ".pathVariables"; 14 | 15 | 16 | //渲染页面 17 | void render(@Nullable Map model, HttpServletRequest request, HttpServletResponse response) 18 | throws Exception; 19 | 20 | //获取网页文件的类型和编码 21 | @Nullable 22 | default String getContentType() { 23 | return null; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-enable/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | spring-boot 7 | com.java.advance 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | spring-boot-enable 13 | 14 | 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter 19 | 20 | 21 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-redis/src/main/java/com/example/zwd/springbootredis/domain/User.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootredis.domain; 2 | 3 | import java.io.Serializable; 4 | 5 | public class User implements Serializable { 6 | 7 | private String name; 8 | 9 | private int age; 10 | 11 | public String getName() { 12 | return name; 13 | } 14 | 15 | public void setName(String name) { 16 | this.name = name; 17 | } 18 | 19 | public int getAge() { 20 | return age; 21 | } 22 | 23 | public void setAge(int age) { 24 | this.age = age; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return "User{" + 30 | "name='" + name + '\'' + 31 | ", age=" + age + 32 | '}'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-jdbctemplate/src/main/java/com/example/jdbctemplate/controller/ShopController.java: -------------------------------------------------------------------------------- 1 | package com.example.jdbctemplate.controller; 2 | 3 | import com.example.jdbctemplate.entity.Shop; 4 | import com.example.jdbctemplate.service.ShopService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | /** 10 | * @description: 11 | * @author: 青阳 12 | * @create: 2019-11-19 09:45 13 | */ 14 | @RestController 15 | public class ShopController { 16 | 17 | @Autowired 18 | private ShopService shopService; 19 | 20 | @GetMapping(value = "decrease") 21 | public void decrease(Integer id) throws InterruptedException { 22 | shopService.decrease(id); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-controller-advice/src/main/java/com/example/zwd/springbootcontrolleradvice/controller/HelloWorldController.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springbootcontrolleradvice.controller; 2 | 3 | import org.springframework.http.ResponseEntity; 4 | import org.springframework.web.bind.annotation.*; 5 | 6 | /** 7 | * TODO... 8 | * 9 | * @author zwd 10 | * @since 2019-03-19 11 | **/ 12 | @RestController 13 | public class HelloWorldController { 14 | 15 | @GetMapping(value = "/") 16 | public void index (@RequestParam int a) { 17 | System.out.println(a); 18 | System.out.println("HelloWorld"); 19 | 20 | } 21 | // 22 | // @ExceptionHandler(Throwable.class) 23 | // public ResponseEntity handle(Throwable throwable) { 24 | // return ResponseEntity.ok(throwable.getMessage()); 25 | // } 26 | } 27 | -------------------------------------------------------------------------------- /thread/thread-pool/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | thread 7 | com.java.advance 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | thread-pool 13 | 14 | 15 | junit 16 | junit 17 | 4.12 18 | test 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /thread/thread-state/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | thread 7 | com.java.advance 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | thread-state 13 | 14 | 15 | junit 16 | junit 17 | 4.12 18 | test 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mybatis/mybatis-generator/src/main/java/com/zwd/mybatis/generator/domain/User.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.generator.domain; 2 | 3 | public class User { 4 | private Integer id; 5 | 6 | private String username; 7 | 8 | private String password; 9 | 10 | public Integer getId() { 11 | return id; 12 | } 13 | 14 | public void setId(Integer id) { 15 | this.id = id; 16 | } 17 | 18 | public String getUsername() { 19 | return username; 20 | } 21 | 22 | public void setUsername(String username) { 23 | this.username = username == null ? null : username.trim(); 24 | } 25 | 26 | public String getPassword() { 27 | return password; 28 | } 29 | 30 | public void setPassword(String password) { 31 | this.password = password == null ? null : password.trim(); 32 | } 33 | } -------------------------------------------------------------------------------- /mybatis/mybatis-link-query/src/main/java/com/zwd/mybatis/linkquery/domain/User.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.linkquery.domain; 2 | 3 | public class User { 4 | private Integer id; 5 | 6 | private String username; 7 | 8 | private String password; 9 | 10 | public Integer getId() { 11 | return id; 12 | } 13 | 14 | public void setId(Integer id) { 15 | this.id = id; 16 | } 17 | 18 | public String getUsername() { 19 | return username; 20 | } 21 | 22 | public void setUsername(String username) { 23 | this.username = username == null ? null : username.trim(); 24 | } 25 | 26 | public String getPassword() { 27 | return password; 28 | } 29 | 30 | public void setPassword(String password) { 31 | this.password = password == null ? null : password.trim(); 32 | } 33 | } -------------------------------------------------------------------------------- /mybatis/mybatis-link-query/src/test/java/com/zwd/mybatis/linkquery/TestUserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zwd.mybatis.linkquery; 2 | 3 | import com.zwd.mybatis.linkquery.domain.Course; 4 | import com.zwd.mybatis.linkquery.mapper.UserMapper; 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | import org.springframework.test.context.junit4.SpringRunner; 10 | 11 | @RunWith(SpringRunner.class) 12 | @SpringBootTest(classes = Application.class) 13 | public class TestUserMapper { 14 | 15 | 16 | @Autowired 17 | private UserMapper userMapper; 18 | 19 | @Test 20 | public void test() { 21 | 22 | Course course = userMapper.selectByusername("zzz"); 23 | 24 | System.out.println(course); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot/spring-boot-hot/src/main/java/com/example/zwd/springboothot/SpringBootHotApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.zwd.springboothot; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @SpringBootApplication 10 | @RestController 11 | public class SpringBootHotApplication { 12 | 13 | @Value(value = "${username}") 14 | private String name; 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(SpringBootHotApplication.class, args); 18 | } 19 | 20 | @GetMapping(value = "/") 21 | public String index() { 22 | return "hello "+ name; 23 | } 24 | 25 | } 26 | --------------------------------------------------------------------------------