Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
WeiPanAPI
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Discuz
WeiPanAPI
Commits
e4122f45
Commit
e4122f45
authored
May 13, 2021
by
xiongyuwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
47596c0e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
WeiPanService.cs
src/Bailun.Discuz.Application/WeiPan/WeiPanService.cs
+27
-0
No files found.
src/Bailun.Discuz.Application/WeiPan/WeiPanService.cs
View file @
e4122f45
...
@@ -146,6 +146,30 @@ namespace Bailun.Discuz.Application.WeiPan
...
@@ -146,6 +146,30 @@ namespace Bailun.Discuz.Application.WeiPan
}
}
return
userId
;
return
userId
;
}
}
/// <summary>
/// 判断当前微盘文件夹是否为公司制度,如果是则userid统一为:fengxiaoyin的缓存中获取,加快加载速度
/// </summary>
/// <param name="userId"></param>
/// <param name="companyName"></param>
/// <returns></returns>
public
string
GetBailunShareFileUserId
(
string
userId
,
string
fileId
)
{
if
(
fileId
==
"s.ww833808f6b8dc0745.610693393XlV_d.611837185H935"
)
//公司制度及资讯--固定的fileId
{
return
"fengxiaoyin"
;
}
return
userId
;
}
public
async
void
RefreshWeiPanListRedis
(
string
companyName
)
{
Console
.
WriteLine
(
"开始刷新【公司制度及资讯】缓存中"
);
var
userId
=(
companyName
==
"广州百伦供应链科技有限公司"
?
"fengxiaoyin"
:
"gaodesheng"
);
await
GetFirstFileList
(
userId
,
companyName
,
false
,
true
);
var
fileId
=
companyName
==
"广州百伦供应链科技有限公司"
?
"s.ww833808f6b8dc0745.610693393XlV_d.611837185H935"
:
"s.ww4e7dd5ae312eb101.614679173dzT_d.619409339X1T9"
;
await
GetFileListTree
(
userId
,
companyName
,
fileId
,
false
,
true
);
Console
.
WriteLine
(
"刷新【公司制度及资讯】缓存完毕"
);
}
///// <summary>
///// <summary>
///// 获取首层文件列表
///// 获取首层文件列表
...
@@ -272,6 +296,8 @@ namespace Bailun.Discuz.Application.WeiPan
...
@@ -272,6 +296,8 @@ namespace Bailun.Discuz.Application.WeiPan
public
async
Task
<
List
<
FileListTreeDto
>>
GetFileListTree
(
string
userId
,
string
companyName
,
string
fildId
,
bool
isGetRedis
=
true
,
bool
isDelCaching
=
false
)
public
async
Task
<
List
<
FileListTreeDto
>>
GetFileListTree
(
string
userId
,
string
companyName
,
string
fildId
,
bool
isGetRedis
=
true
,
bool
isDelCaching
=
false
)
{
{
userId
=
GetVisitFourKUserId
(
userId
,
companyName
);
userId
=
GetVisitFourKUserId
(
userId
,
companyName
);
//判断当前微盘文件夹是否为公司制度,如果是则userid统一为:fengxiaoyin的缓存中获取,加快加载速度
userId
=
GetBailunShareFileUserId
(
userId
,
fildId
);
List
<
FileListTreeDto
>
fileListTreeDtos
=
new
List
<
FileListTreeDto
>();
List
<
FileListTreeDto
>
fileListTreeDtos
=
new
List
<
FileListTreeDto
>();
List
<
FileListTreeDto
>
cachingResponse
=
null
;
List
<
FileListTreeDto
>
cachingResponse
=
null
;
//判断缓存中是否有值,如果有值直接读取
//判断缓存中是否有值,如果有值直接读取
...
@@ -808,6 +834,7 @@ namespace Bailun.Discuz.Application.WeiPan
...
@@ -808,6 +834,7 @@ namespace Bailun.Discuz.Application.WeiPan
RedisHelper
.
Del
(
Constants
.
File_List_Tree
+
$"_
{
companyName
}
"
);
//清除缓存
RedisHelper
.
Del
(
Constants
.
File_List_Tree
+
$"_
{
companyName
}
"
);
//清除缓存
RedisHelper
.
Del
(
Constants
.
First_File_List
+
$"_
{
companyName
}
"
);
//清除缓存
RedisHelper
.
Del
(
Constants
.
First_File_List
+
$"_
{
companyName
}
"
);
//清除缓存
await
CreateUserFilesTreeRedis
(
companyName
);
await
CreateUserFilesTreeRedis
(
companyName
);
RefreshWeiPanListRedis
(
companyName
);
}
}
var
noTieZilist
=
await
_weiPanFileListRepository
.
Query
().
AsNoTracking
().
Where
(
u
=>
u
.
ThreadId
==
0
&&
u
.
CompanyName
==
companyName
&&!
u
.
QiniuUrl
.
IsNullOrEmpty
()).
ToListAsync
();
var
noTieZilist
=
await
_weiPanFileListRepository
.
Query
().
AsNoTracking
().
Where
(
u
=>
u
.
ThreadId
==
0
&&
u
.
CompanyName
==
companyName
&&!
u
.
QiniuUrl
.
IsNullOrEmpty
()).
ToListAsync
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment