Commit 8d2fe7df by fudahua

本地缓存

parent 9724d050
......@@ -572,7 +572,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
departmentService.cleanDepartment(wxEnterpriseId,groupIdList);
}
RedisUtil.delCache("department-list-cache-"+wxEnterpriseId);
RedisUtil.delLocalCache("department-list-cache-"+wxEnterpriseId);
}
}
......@@ -819,7 +819,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
@RedisCache(value = "department-list-cache-${wxEnterpriseId}")
public List<DepartmentShortDTO> listAllDepartment(String wxEnterpriseId) {
List<DepartmentShortDTO> list = departmentService.listAllDepartment(wxEnterpriseId);
return list;
......
......@@ -858,10 +858,10 @@ public class DepartmentContoller extends WebBaseController{
if (StringUtils.isBlank(wxEnterpriseId)) {
return resultResponse(HaoBanErrCode.ERR_6);
}
Object cache = RedisUtil.getCache("department-list-cache-"+wxEnterpriseId);
Object cache = RedisUtil.getLocalCache("department-list-cache-"+wxEnterpriseId);
if (null == cache) {
List<DepartmentShortDTO> list = departmentApiService.listAllDepartment(wxEnterpriseId);
RedisUtil.setCache("department-list-cache-"+wxEnterpriseId,list);
RedisUtil.setLocalCache("department-list-cache-"+wxEnterpriseId,list,-1L);
return resultResponse(HaoBanErrCode.ERR_1, list);
}else {
return resultResponse(HaoBanErrCode.ERR_1, cache);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment