Commit e82a452a by xiongyuwen

no message

parent 12fd1aa6
...@@ -224,12 +224,13 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -224,12 +224,13 @@ namespace Bailun.Discuz.Application.WeiPan
var apiOutput = HttpHelper.PostAsync<GetFileListRequest, GetFileListResponse>(apiUrl, getFileListRequest); var apiOutput = HttpHelper.PostAsync<GetFileListRequest, GetFileListResponse>(apiUrl, getFileListRequest);
return apiOutput; return apiOutput;
} }
List<WeipanUserFiles> weipanUserFileList = null;
/// <summary> /// <summary>
/// 递归获取所有首页下的所有文件列表数据 /// 递归获取所有首页下的所有文件列表数据
/// </summary> /// </summary>
public async Task<List<FileListTreeDto>> GetFileListTree(string userId, string fildId) public async Task<List<FileListTreeDto>> GetFileListTree(string userId, string fildId)
{ {
weipanUserFileList = new List<WeipanUserFiles>();
List<FileListTreeDto> fileListTreeDtos = new List<FileListTreeDto>(); List<FileListTreeDto> fileListTreeDtos = new List<FileListTreeDto>();
//判断缓存中是否有值,如果有值直接读取 //判断缓存中是否有值,如果有值直接读取
var redisKey = Constants.File_List_Tree; var redisKey = Constants.File_List_Tree;
...@@ -269,6 +270,7 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -269,6 +270,7 @@ namespace Bailun.Discuz.Application.WeiPan
weipanUserFiles.UserId = userId; weipanUserFiles.UserId = userId;
weipanUserFiles.FatherFileId = fildId; weipanUserFiles.FatherFileId = fildId;
weipanUserFiles.File_Id = u.fileid; weipanUserFiles.File_Id = u.fileid;
weipanUserFileList.Add(weipanUserFiles);
await _weipanUserFilesRepository.AddAsync(weipanUserFiles, true); await _weipanUserFilesRepository.AddAsync(weipanUserFiles, true);
} }
} }
...@@ -302,6 +304,7 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -302,6 +304,7 @@ namespace Bailun.Discuz.Application.WeiPan
{ {
throw new Exception(apiOutput.errmsg); throw new Exception(apiOutput.errmsg);
} }
_weipanUserFilesRepository.BulkInsert(weipanUserFileList.ToArray());
RedisHelper.HSet(redisKey, userId + "_" + fildId, fileListTreeDtos); RedisHelper.HSet(redisKey, userId + "_" + fildId, fileListTreeDtos);
} }
return fileListTreeDtos; return fileListTreeDtos;
...@@ -324,6 +327,7 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -324,6 +327,7 @@ namespace Bailun.Discuz.Application.WeiPan
/// <param name="token"></param> /// <param name="token"></param>
/// <param name="start"></param> /// <param name="start"></param>
/// <returns></returns> /// <returns></returns>
public async Task<List<FileListTreeDto>> GetChildrens(string userId, string fatherid, string token, int start,string parentId) public async Task<List<FileListTreeDto>> GetChildrens(string userId, string fatherid, string token, int start,string parentId)
{ {
...@@ -371,7 +375,7 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -371,7 +375,7 @@ namespace Bailun.Discuz.Application.WeiPan
weipanUserFiles.UserId = userId; weipanUserFiles.UserId = userId;
weipanUserFiles.FatherFileId = parentId; weipanUserFiles.FatherFileId = parentId;
weipanUserFiles.File_Id = i.fileid; weipanUserFiles.File_Id = i.fileid;
await _weipanUserFilesRepository.AddAsync(weipanUserFiles, true); weipanUserFileList.Add(weipanUserFiles);
} }
} }
} }
...@@ -530,6 +534,7 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -530,6 +534,7 @@ namespace Bailun.Discuz.Application.WeiPan
public async Task<string> ProcessWeiPanWorker() public async Task<string> ProcessWeiPanWorker()
{ {
await CreateUserFilesTreeRedis();
StringBuilder messageSb = new StringBuilder(); ; StringBuilder messageSb = new StringBuilder(); ;
string userId = "chenzekai"; string userId = "chenzekai";
List<WeiPanFileList> inserWeiPanFileList = new List<WeiPanFileList>(); List<WeiPanFileList> inserWeiPanFileList = new List<WeiPanFileList>();
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"Defaultdatabase": 1 "Defaultdatabase": 1
}, },
"PublishWeiPanWorkerRunTime": { "PublishWeiPanWorkerRunTime": {
"minute": "360" "minute": "60"
}, },
"QYWeChat": { "QYWeChat": {
"AppId": "ww833808f6b8dc0745", "AppId": "ww833808f6b8dc0745",
......
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