Xiajijian
2026-05-27 402fe914957546a820c60731181501c554826fa4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.ard.work.domain.cache;
 
import com.ard.data.region.domain.ArdDeptRegion;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.ConcurrentHashMap;
 
/**
 * 无人机区域缓存(简化版)
 *
 * @author 刘苏义
 */
@Slf4j
public class UavRegionCache {
 
    // 无人机当前区域名称缓存 Map<无人机ID, 区域>
    private static final ConcurrentHashMap<String, ArdDeptRegion> cache = new ConcurrentHashMap<>();
 
    // 存储数据到缓存
    public static void put(String boxSn, ArdDeptRegion region) {cache.put(boxSn, region);}
 
    // 从缓存中获取数据
    public static ArdDeptRegion get(String boxSn) {
        return cache.get(boxSn);
    }
 
    // 删除缓存中的数据
    public static void remove(String boxSn) {
        cache.remove(boxSn);
    }
}