Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
d8e9b1ca
Commit
d8e9b1ca
authored
Mar 24, 2022
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixbug/1006818' into 'master'
feat:[1006818] 斗罗 See merge request rays/pcloud-book!1528
parents
b9dbcd89
0a982be3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
28 deletions
+41
-28
ResourcePageBizImpl.java
...a/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
+36
-28
ResourcePageConstants.java
...com/pcloud/book/group/constant/ResourcePageConstants.java
+5
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
View file @
d8e9b1ca
...
...
@@ -194,6 +194,8 @@ import cn.hutool.extra.qrcode.QrCodeUtil;
import
cn.hutool.http.HttpUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
static
com
.
pcloud
.
book
.
group
.
constant
.
ResourcePageConstants
.
DL_BOOK_SERVES_CACHE
;
/**
* @ClassName com.pcloud.book.group.biz.impl.ResourcePageBizImpl
* @Author zhuyajie
...
...
@@ -1894,6 +1896,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
});
//删除缓存
JedisClusterUtils
.
del
(
"FUNCTION:DOULUO_APP"
);
JedisClusterUtils
.
del
(
DL_BOOK_SERVES_CACHE
+
updateResourcePageVO
.
getSceneId
());
return
resourcePageId
;
}
...
...
@@ -3943,37 +3946,42 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
@Override
public
List
<
ResourcePageItemVO
>
getServerList4Wechat
(
Long
wechatUserId
,
Long
sceneId
)
{
ResourcePage
bySceneId
=
resourcePageDao
.
getBySceneId
(
sceneId
);
if
(
null
==
bySceneId
)
{
return
new
ArrayList
<>();
}
List
<
ResourcePageItemVO
>
itemVOList
=
resourcePageItemDao
.
getResourcePageItemByPageId
(
bySceneId
.
getId
(),
true
);
if
(
CollUtil
.
isEmpty
(
itemVOList
))
{
return
new
ArrayList
<>();
}
if
(
CollUtil
.
isNotEmpty
(
itemVOList
))
{
//二维码类型
fillQrcodeType
(
bySceneId
.
getId
(),
itemVOList
);
Map
<
String
,
List
<
ResourcePageItemVO
>>
listMap
=
itemVOList
.
stream
().
collect
(
Collectors
.
groupingBy
(
ResourcePageItemVO:
:
getServeType
));
itemVOList
=
new
ArrayList
<>();
//应用和作品提出来一起查
List
<
ResourcePageItemVO
>
itemAppAndProductVOList
=
new
ArrayList
<>();
//过滤一些资源,重新排序
for
(
Map
.
Entry
<
String
,
List
<
ResourcePageItemVO
>>
entry
:
listMap
.
entrySet
())
{
if
(
ResourcePageConstants
.
ServeTypeEnum
.
APP
.
getValue
().
equals
(
entry
.
getKey
())
||
ServeTypeEnum
.
PRODUCT
.
getValue
().
equals
(
entry
.
getKey
()))
{
itemAppAndProductVOList
.
addAll
(
entry
.
getValue
());
continue
;
List
<
ResourcePageItemVO
>
itemVOList
=
JedisClusterUtils
.
getJsonList
(
DL_BOOK_SERVES_CACHE
+
sceneId
,
ResourcePageItemVO
.
class
);
if
(
CollUtil
.
isEmpty
(
itemVOList
))
{
ResourcePage
bySceneId
=
resourcePageDao
.
getBySceneId
(
sceneId
);
if
(
null
==
bySceneId
)
{
return
new
ArrayList
<>();
}
itemVOList
=
resourcePageItemDao
.
getResourcePageItemByPageId
(
bySceneId
.
getId
(),
true
);
if
(
CollUtil
.
isEmpty
(
itemVOList
))
{
return
new
ArrayList
<>();
}
if
(
CollUtil
.
isNotEmpty
(
itemVOList
))
{
//二维码类型
Map
<
String
,
List
<
ResourcePageItemVO
>>
listMap
=
itemVOList
.
stream
().
collect
(
Collectors
.
groupingBy
(
ResourcePageItemVO:
:
getServeType
));
itemVOList
=
new
ArrayList
<>();
//应用和作品提出来一起查
List
<
ResourcePageItemVO
>
itemAppAndProductVOList
=
new
ArrayList
<>();
//过滤一些资源,重新排序
for
(
Map
.
Entry
<
String
,
List
<
ResourcePageItemVO
>>
entry
:
listMap
.
entrySet
())
{
if
(
ResourcePageConstants
.
ServeTypeEnum
.
APP
.
getValue
().
equals
(
entry
.
getKey
())
||
ServeTypeEnum
.
PRODUCT
.
getValue
().
equals
(
entry
.
getKey
()))
{
itemAppAndProductVOList
.
addAll
(
entry
.
getValue
());
continue
;
}
this
.
fillResourceByType
(
entry
.
getValue
(),
wechatUserId
,
entry
.
getKey
());
itemVOList
.
addAll
(
entry
.
getValue
());
}
if
(
CollUtil
.
isNotEmpty
(
itemAppAndProductVOList
))
{
fillAppProductServe
(
itemAppAndProductVOList
,
wechatUserId
);
//暂不返回 直接根据typecode进行判断
//fillTaskType(itemAppAndProductVOList);
itemVOList
.
addAll
(
itemAppAndProductVOList
);
}
this
.
fillResourceByType
(
entry
.
getValue
(),
wechatUserId
,
entry
.
getKey
());
itemVOList
.
addAll
(
entry
.
getValue
());
itemVOList
.
sort
(
Comparator
.
comparing
(
ResourcePageItemVO:
:
getId
));
}
if
(
CollUtil
.
isNotEmpty
(
itemAppAndProductVOList
))
{
fillAppProductServe
(
itemAppAndProductVOList
,
wechatUserId
);
//暂不返回 直接根据typecode进行判断
//fillTaskType(itemAppAndProductVOList);
itemVOList
.
addAll
(
itemAppAndProductVOList
);
if
(
CollUtil
.
isNotEmpty
(
itemVOList
))
{
JedisClusterUtils
.
setJsonList
(
DL_BOOK_SERVES_CACHE
+
sceneId
,
ResourcePageItemVO
.
class
,
3600
*
72
);
}
itemVOList
.
sort
(
Comparator
.
comparing
(
ResourcePageItemVO:
:
getId
));
}
return
itemVOList
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/constant/ResourcePageConstants.java
View file @
d8e9b1ca
...
...
@@ -463,4 +463,9 @@ public class ResourcePageConstants {
}
}
/**
* 斗罗首页缓存
*/
public
static
final
String
DL_BOOK_SERVES_CACHE
=
"BOOK:DL:SERVES:"
;
}
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