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
a9c05740
Commit
a9c05740
authored
Mar 11, 2022
by
guiq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug: [none] 接口优化 checkIsHaveAuthWithServer
parent
68860f17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
27 deletions
+7
-27
BookAuthUserBizImpl.java
...m/pcloud/book/copyright/biz/impl/BookAuthUserBizImpl.java
+7
-27
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthUserBizImpl.java
View file @
a9c05740
...
...
@@ -2,7 +2,6 @@ package com.pcloud.book.copyright.biz.impl;
import
cn.hutool.core.collection.CollUtil
;
import
com.google.common.collect.Lists
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.consumer.live.LiveCons
;
...
...
@@ -32,10 +31,8 @@ import com.pcloud.common.utils.DateUtils;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.cookie.Cookie
;
import
com.pcloud.readercenter.wechat.entity.WechatUser
;
import
com.pcloud.resourcecenter.base.constants.ResourceRedisCons
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.MapUtils
;
import
org.slf4j.Logger
;
...
...
@@ -191,41 +188,24 @@ public class BookAuthUserBizImpl implements BookAuthUserBiz {
@Override
public
Boolean
checkIsHaveAuthWithServer
(
String
userInfo
,
Long
serverId
,
String
serverType
)
{
// 如果包含超级作者资源, 则直接返回
long
t1
=
System
.
currentTimeMillis
();
if
(
checkIsSuperProduct
(
serverId
)){
long
t2
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"第0阶段耗时="
+
(
t2
-
t1
));
if
(
checkIsSuperProduct
(
serverId
))
{
return
false
;
}
long
t2
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"第1阶段耗时="
+
(
t2
-
t1
));
// 否则查询授权关系
Long
bookId
=
qrcodeSceneConsr
.
getBookId4SceneId
(
Cookie
.
getId
(
userInfo
,
Cookie
.
_SCENE_ID
));
long
t3
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"第2阶段耗时="
+
(
t3
-
t2
));
Long
bookId
=
qrcodeSceneConsr
.
getBookId4SceneId
(
Cookie
.
getId
(
userInfo
,
Cookie
.
_SCENE_ID
));
Long
channelId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_CHANNEL_ID
);
Long
adviserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_ADVISER_ID
);
Long
wecharUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
Long
adviserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_ADVISER_ID
);
Long
wecharUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
if
(
"live"
.
equalsIgnoreCase
(
serverType
))
{
if
(
"live"
.
equalsIgnoreCase
(
serverType
))
{
List
<
Long
>
id
=
new
ArrayList
<>(
1
);
id
.
add
(
serverId
);
Map
<
Long
,
Boolean
>
map
=
liveCons
.
checkIsSuperMerchant
(
id
);
if
(
map
!=
null
&&
Boolean
.
TRUE
.
equals
(
map
.
get
(
serverId
)))
{
if
(
map
!=
null
&&
Boolean
.
TRUE
.
equals
(
map
.
get
(
serverId
)))
{
return
false
;
}
else
{
return
checkIsHaveAuthWithServer
(
bookId
,
channelId
,
adviserId
,
wecharUserId
,
serverId
);
}
}
else
{
Boolean
aBoolean
=
checkIsHaveAuthWithServer
(
bookId
,
channelId
,
adviserId
,
wecharUserId
,
serverId
);
long
t4
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"第3阶段耗时="
+
(
t4
-
t3
));
return
aBoolean
;
}
return
checkIsHaveAuthWithServer
(
bookId
,
channelId
,
adviserId
,
wecharUserId
,
serverId
);
}
private
Boolean
checkIsHaveAuthWithServer
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Long
wecharUserId
,
Long
serverId
)
{
...
...
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