Commit c53cc695 by xiongyuwen

no message

parent 043f3516
......@@ -40,7 +40,7 @@ namespace Bailun.Discuz.Application.WeiPan
/// <summary>
/// 递归获取所有首页下的所有文件列表数据
/// </summary>
Task<List<FileListTreeDto>> GetFileListTree(string userId, string fildId);
Task<List<FileListTreeDto>> GetFileListTree(string userId, string fildId,bool isGetRedis = true);
Task<AttachmentsDto> GetAttchmattachmentByFileId(string fileId);
......
......@@ -231,12 +231,17 @@ namespace Bailun.Discuz.Application.WeiPan
/// <summary>
/// 递归获取所有首页下的所有文件列表数据
/// </summary>
public async Task<List<FileListTreeDto>> GetFileListTree(string userId, string fildId)
public async Task<List<FileListTreeDto>> GetFileListTree(string userId, string fildId, bool isGetRedis = true)
{
List<FileListTreeDto> fileListTreeDtos = new List<FileListTreeDto>();
List<FileListTreeDto> cachingResponse = null;
//判断缓存中是否有值,如果有值直接读取
var redisKey = Constants.File_List_Tree;
var cachingResponse = RedisHelper.HGet<List<FileListTreeDto>>(redisKey, userId+"_"+ fildId);
if (isGetRedis)
{
cachingResponse = RedisHelper.HGet<List<FileListTreeDto>>(redisKey, userId + "_" + fildId);
}
if (cachingResponse != null)
{
return cachingResponse;
......@@ -607,8 +612,8 @@ namespace Bailun.Discuz.Application.WeiPan
messageSb.Append($"新增帖子数量为:{inserWeiPanFileList.Count},分别为:{string.Join(",", inserWeiPanFileList.Select(u => u.FileName).ToArray()) };");
RedisHelper.Del(Constants.File_List_Tree);//清除缓存
RedisHelper.Del(Constants.First_File_List);//清除缓存
}
await CreateUserFilesTreeRedis();
}
_weiPanFileListRepository.BulkInsert(inserWeiPanFileList.ToArray());
var noTieZilist=await _weiPanFileListRepository.Query().AsNoTracking().Where(u => u.ThreadId == 0).ToListAsync();
foreach (var item in noTieZilist)
......@@ -664,8 +669,7 @@ namespace Bailun.Discuz.Application.WeiPan
await _weipanUserFilesRepository.DeleteAsync(u => u.UserId == item.UserId);
foreach (var file in firstFiles.file_list.item)
{
await GetFileListTree(item.UserId, file.fileid);
await GetFileListTree(item.UserId, file.fileid,false);
}
await _weipanUserFilesRepository.BulkInsertAsync(weipanUserFileList.ToArray());
}
......
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