2020-04-14 Language►Java►SpringBoot springboot nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial SpringBoot与Web 先在idea中选择场景 springboot已经默认将这些常见配置好了,我们只需要在配置文件中指定少量配置就可以运行起来 然后我们可以开始编写业务代码了 Read More
2020-04-28 Language►Java►SpringBoot SpringBoot7-自定义starter nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial 如何编写理清依赖自动配置@Configuration 指定这个是配置类@ConditionalOnxxx 在某些条件下才生效@AutoConfigureAfter 指定自动配置类的顺序@Bean 给IOC加组件@ConfiguretionProperties 结合相关的xxxProperties配置类来绑定配置@EnableConfigurationProperties 让xxxProperties生效加入到容器中讲自动配置类配置在META-INF/spring.factories中 Read More
2021-01-25 Hexo hexo部署到私人服务器 nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial 仓库同步1234567yum install git -ymkdir /data/GitLibrarymkdir -p /data/www/hexogit init --bare hexo.gitvim /data/GitLibrary/hexo.git/hooks/post-receive# git --work-tree=/data/www/hexo --git-dir=/data/GitLibrary/hexo.git checkout -fchmod +x /data/GitLibrary/hexo.git/hooks/post-receive 部署123docker run -d --restart=always \-p 80:80 -v /data/www/hexo:/usr/share/nginx/html \--name=hexo-blog nginx
2021-01-03 Database mysql常用指令 nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial Mysql查看表的定义1show create table table_name; Read More
2020-12-29 Hexo hexo中valine出现403 nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial 配置安全域名即可
2020-12-27 Others typora nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial Typora自定义配置参考 Read More
2020-12-16 Language►Java►SpringCloud springcloud-cluster nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial Spring Cloud Cluster 1.0.1.RELEASE参考 Spring Cloud Cluster提供了分布式系统中集群的特性,例如选主,集群持久化信息储存,全局锁和一次性token 以下是Spring Cloud Cluster 1.0.1的Spring Boot 自动装配流程,其中的zk模式主要用到了第三方框架CuratorFramework
2020-12-06 Language►Java Java杂谈 nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial JAVAIDEASpring Boot 启动命令行太长修改文件.idea/workspace.xml 12<component name="PropertiesComponent"> <property name="dynamic.classpath" value="true" /> Read More
2020-11-23 Docker 容器化开发 nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial 容器化开发https://segmentfault.com/a/1190000023095631 注意事项对于所有的容器化开发,我们的时区都需要设置 1-v /etc/localtime:/etc/localtime Read More
2020-11-10 Language►Java►SpringCloud springcloud-gateway nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial Spring Cloud Gateway12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697package com.example.demo;import java.util.ArrayList;import java.util.List;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.cloud.gateway.event.RefreshRoutesEvent;import org.springframework.cloud.gateway.route.RouteDefinition;import org.springframework.cloud.gateway.route.RouteDefinitionRepository;import org.springframework.context.ApplicationEventPublisher;import org.springframework.context.ApplicationEventPublisherAware;import org.springframework.web.bind.annotation.DeleteMapping;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.PutMapping;import org.springframework.web.bind.annotation.RequestBody;import org.springframework.web.bind.annotation.RestController;import reactor.core.publisher.Flux;import reactor.core.publisher.Mono;// 动态路由// https://zhuanlan.zhihu.com/p/125018436@RestController@SpringBootApplicationpublic class DemoApplication implements RouteDefinitionRepository, ApplicationEventPublisherAware { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } // event publisher ApplicationEventPublisher applicationEventPublisher; @Override public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { this.applicationEventPublisher = applicationEventPublisher; } // router List<RouteDefinition> memery = new ArrayList<>(); private void refreshRoute() { applicationEventPublisher.publishEvent(new RefreshRoutesEvent(this)); } @PutMapping Mono<Void> putRoute(@RequestBody Mono<RouteDefinition> o) { return o.flatMap(routeDefinition -> { memery.add(routeDefinition); refreshRoute(); return Mono.empty(); }); } @PostMapping Mono<Void> postRoute(@RequestBody Mono<RouteDefinition> o) { return o.flatMap(routeDefinition -> { for (int i = 0; i < memery.size(); i++) { if (memery.get(i).getId().equals(routeDefinition.getId())) { memery.set(i, routeDefinition); } } refreshRoute(); return Mono.empty(); }); } @DeleteMapping Mono<Void> deleteRoute(@RequestBody Mono<String> o) { return o.flatMap(id -> { memery.removeIf(routeDefinition -> routeDefinition.getId().equals(id)); refreshRoute(); return Mono.empty(); }); } @GetMapping Mono<List<RouteDefinition>> getRoute(){ return Mono.just(memery); } @Override public Flux<RouteDefinition> getRouteDefinitions() { return Flux.fromIterable(memery); } @Override public Mono<Void> save(Mono<RouteDefinition> route) { return Mono.empty(); } @Override public Mono<Void> delete(Mono<String> routeId) { return Mono.empty(); }} Read More