From ce1985a0fc44cb2a8ca5f70cb2361556712804d0 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期三, 25 六月 2025 15:28:35 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 8797567..82aa550 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,47 @@ - **宸ュ叿闆�**: Hutool 5.8.22 - **鏃ュ織妗嗘灦**: Log4j2 2.20.0 +## ID鐢熸垚鍣ㄤ娇鐢ㄨ鏄� + +绯荤粺浣跨敤鑷畾涔夌殑IDLongGenerator鏉ョ敓鎴愬敮涓�鐨凩ong鍨婭D锛岀‘淇濆湪鍒嗗竷寮忕幆澧冧笅鐨処D鍞竴鎬с�� + +### IDLongGenerator鐗规�� + +- **鏍煎紡**: `骞存湀鏃ユ椂鍒嗙` + `3浣嶈嚜澧炲簭鍒梎 + `2浣嶇郴缁熷悗缂�` +- **闀垮害**: 19浣嶆暟瀛楋紙濡傦細20231218104504069**00**锛� +- **骞跺彂鎬�**: 鏀寔鍚屼竴绉掑唴鐢熸垚1000涓笉鍚孖D +- **鍒嗗竷寮�**: 閫氳繃鍚庣紑鍖哄垎涓嶅悓瀛愮郴缁燂紝閬垮厤ID鍐茬獊 + +### 浣跨敤鏂瑰紡 + +```java +// 渚濊禆娉ㄥ叆 +@Autowired +private IDLongGenerator idLongGenerator; + +// 鐢熸垚ID +Long id = idLongGenerator.generate(); +``` + +### 搴旂敤鍦烘櫙 + +- **绠$悊鍗″垱寤�**: createManagementCard鏂规硶涓娇鐢↖DLongGenerator鐢熸垚绠$悊鍗D +- **瀹炰綋涓婚敭**: 鎵�鏈変笟鍔″疄浣撶殑涓婚敭ID鐢熸垚 +- **璁㈠崟鍙�**: 涓氬姟娴佹按鍙风敓鎴� +- **鏃ュ織璁板綍**: 鎿嶄綔璁板綍鐨勫敮涓�鏍囪瘑 + +### 閰嶇疆璇存槑 + +绯荤粺鍚姩鏃朵細鑷姩璁剧疆ID鍚庣紑锛屼笉鍚岀殑鏈嶅姟妯″潡浣跨敤涓嶅悓鐨勫悗缂�鏉ラ伩鍏岻D鍐茬獊锛� + +```xml +<!-- web.xml鎴朣pring閰嶇疆 --> +<context-param> + <param-name>idSuffix</param-name> + <param-value>01</param-value> <!-- 涓嶅悓鏈嶅姟浣跨敤涓嶅悓鍚庣紑 --> +</context-param> +``` + ## 寮�鍙戠幆澧冩惌寤� ### 鍓嶇疆鏉′欢 -- Gitblit v1.8.0