原创 配置文件加載的方式

@Component public class RobotUtils { private static String active; @Value("${spring.profiles.active}") p

原创 集合切分工具

<dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId>

原创 idea必裝插件

開發規約:Alibaba Java Coding Guidelines 翻譯:Translation mybatis:Free Mybatis plugin json:GsonFormat 簡化代碼:Lombok 進度條:Nyan Pro

原创 lambda表達式創建多線程

1.普通開啓多線程 public static void main(String[] args) { new Thread(() -> System.out.println("xzh")).start();

原创 SmartGit過期處理

在C:\Users\Administrator\AppData\Roaming\syntevo\SmartGit\18.1路徑下刪除settings.xml文件。 可以直接使用快捷鍵win+R輸入%APPDATA%找到\syntevo\S

原创 關閉SmartGit自動更新

在C:\Windows\System32\drivers\etc路徑下的hosts文件中加入 127.0.0.1 www.syntevo.com  

原创 idea新建類自動加註釋

在路徑:File>Setting>Editor>File and Code Templates 分別在Class、Interface、Enum、AnnotationType 加入: /** * ${description} * *@au

原创 MySQL 真·常用函數

聚合函數  統計總數 COUNT()  統計平均數 AVG()  找出最小值 MIN()  找出最大值 MAX()  -- 查詢用戶總數 SELECT COUNT(*) FROM `users`; -- 查詢用戶總數(忽略age爲nu

原创 Git提交的代碼消失

Git提交的代碼消失,但是又沒有人修改代碼。 原因是其他人在本地提交代碼的時候,把你的代碼拉到他本地,但是沒有合併到分支上。

原创 zookeeper在windows環境下載與安裝

1.官網下載https://zookeeper.apache.org/releases.html 百度雲鏈接:https://pan.baidu.com/s/1qKE5njpVV49kp81AFTJ0kA  提取碼:4dc2    2.解

原创 MyBatis設置空值更新

@TableField(updateStrategy = FieldStrategy.IGNORED) private Date expireTime;  

原创 Spring容器啓動完畢發佈的刷新事件 ContextRefreshedEvent事件

寫一個類實現ApplicationListener<ContextRefreshedEvent>接口 @Service public class Xzh implements ApplicationListener<ContextRef

原创 解決跨域問題

import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; impor

原创 Swagger2 被攔截處理

@Configuration public class MyWebConfigurer extends WebMvcConfigurationSupport { @Bean LoginInterceptor login

原创 編碼實現兩個線程,線程A不斷打印1-10的數字,要求在打印到第五個數字的時候通知線程B

import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * @author: 向振華 * @date: 201