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
e82a452a
Commit
e82a452a
authored
Jan 25, 2021
by
xiongyuwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
12fd1aa6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
WeiPanService.cs
src/Bailun.Discuz.Application/WeiPan/WeiPanService.cs
+7
-2
appsettings.Production.json
...lun.Discuz.ConsoleApp.Publish/appsettings.Production.json
+1
-1
No files found.
src/Bailun.Discuz.Application/WeiPan/WeiPanService.cs
View file @
e82a452a
...
@@ -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
>();
...
...
src/console/Bailun.Discuz.ConsoleApp.Publish/appsettings.Production.json
View file @
e82a452a
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"Defaultdatabase"
:
1
"Defaultdatabase"
:
1
},
},
"PublishWeiPanWorkerRunTime"
:
{
"PublishWeiPanWorkerRunTime"
:
{
"minute"
:
"
3
60"
"minute"
:
"60"
},
},
"QYWeChat"
:
{
"QYWeChat"
:
{
"AppId"
:
"ww833808f6b8dc0745"
,
"AppId"
:
"ww833808f6b8dc0745"
,
...
...
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