0
我的項目使用一個簡單的彈簧,內存緩存到緩存服務的方法集合或數組的參數,但它簡化版,工作,具體如下:如何緩存簡單的彈簧,內存緩存
@ReadThroughSingleCache(namespace = "AdvServiceImpl.findByIdList", expiration = 60)
public List<Adv> findByIdList(@ParameterValueKeyProvider(order = 0) List<String> idList, @ParameterValueKeyProvider(order = 1) String deviceType, @ParameterValueKeyProvider(order = 2) String sourceId) throws Exception {
但我寫這樣它可以工作:如果與ParameterValueKeyProvider註釋的方法的一個參數的類型是List
@ReadThroughSingleCache(namespace = "AdvServiceImpl.findByIdList", expiration = 60)
public List<Adv> findByIdList(List<String> idList, @ParameterValueKeyProvider(order = 0) String deviceType, @ParameterValueKeyProvider(order = 1) String sourceId) throws Exception {