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
e1420540
Commit
e1420540
authored
Nov 11, 2019
by
刘正
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加对超级作者的查询
parent
9a3c005a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
6 deletions
+46
-6
LiveCons.java
...src/main/java/com/pcloud/book/consumer/live/LiveCons.java
+20
-0
BookAuthUserBiz.java
...n/java/com/pcloud/book/copyright/biz/BookAuthUserBiz.java
+1
-1
BookAuthUserBizImpl.java
...m/pcloud/book/copyright/biz/impl/BookAuthUserBizImpl.java
+22
-2
BookAuthUserFacade.java
.../com/pcloud/book/copyright/facade/BookAuthUserFacade.java
+1
-1
BookAuthUserFacadeImpl.java
...ud/book/copyright/facade/impl/BookAuthUserFacadeImpl.java
+2
-2
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/consumer/live/LiveCons.java
View file @
e1420540
...
...
@@ -4,7 +4,9 @@ import com.google.common.collect.Lists;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.liveapp.live.dto.CourseListDto
;
import
com.pcloud.liveapp.live.service.LiveCourseService
;
...
...
@@ -13,6 +15,7 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.Map
;
import
javax.annotation.Resource
;
...
...
@@ -38,4 +41,21 @@ public class LiveCons {
return
Lists
.
newArrayList
();
}
@ParamLog
(
"调用liveApp获取超级作者应用情况"
)
public
Map
<
Long
,
Boolean
>
checkIsSuperMerchant
(
List
<
Long
>
serverIds
)
{
if
(
ListUtils
.
isEmpty
(
serverIds
))
{
return
null
;
}
try
{
return
ResponseHandleUtil
.
parseMap
(
liveCourseService
.
checkIsSuperMerchant
(
serverIds
),
Long
.
class
,
Boolean
.
class
);
}
catch
(
BizException
e
)
{
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"调用liveApp获取超级作者应用情况失败[labelService.getLabelName]:"
+
e
.
getMessage
(),
e
);
return
null
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/BookAuthUserBiz.java
View file @
e1420540
...
...
@@ -48,7 +48,7 @@ public interface BookAuthUserBiz {
/**
* 校验用户针对指定的服务是否被授权
*/
Boolean
checkIsHaveAuthWithServer
(
String
userInfo
,
Long
serverId
);
Boolean
checkIsHaveAuthWithServer
(
String
userInfo
,
Long
serverId
,
String
serverType
);
/**
* 获取授权信息总的统计数据
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthUserBizImpl.java
View file @
e1420540
...
...
@@ -2,6 +2,7 @@ package com.pcloud.book.copyright.biz.impl;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.consumer.live.LiveCons
;
import
com.pcloud.book.copyright.biz.BookAuthUserBiz
;
import
com.pcloud.book.copyright.dao.BookAuthServeDao
;
import
com.pcloud.book.copyright.dao.BookAuthUserDao
;
...
...
@@ -53,7 +54,8 @@ public class BookAuthUserBizImpl implements BookAuthUserBiz {
private
QrcodeSceneConsr
qrcodeSceneConsr
;
@Autowired
private
BookAuthServeDao
bookAuthServeDao
;
@Autowired
private
LiveCons
liveCons
;
@ParamLog
(
value
=
"获取授权用户数量"
)
@Override
...
...
@@ -164,11 +166,29 @@ public class BookAuthUserBizImpl implements BookAuthUserBiz {
}
@Override
public
Boolean
checkIsHaveAuthWithServer
(
String
userInfo
,
Long
serverId
)
{
public
Boolean
checkIsHaveAuthWithServer
(
String
userInfo
,
Long
serverId
,
String
serverType
)
{
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
);
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
))){
return
false
;
}
else
{
return
checkIsHaveAuthWithServer
(
bookId
,
channelId
,
adviserId
,
wecharUserId
,
serverId
);
}
}
else
{
return
checkIsHaveAuthWithServer
(
bookId
,
channelId
,
adviserId
,
wecharUserId
,
serverId
);
}
}
private
Boolean
checkIsHaveAuthWithServer
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Long
wecharUserId
,
Long
serverId
)
{
// 书类型指定为is_paper_book
Boolean
isUserAuth
=
checkIsHaveAuth
(
bookId
,
channelId
,
adviserId
,
wecharUserId
,
0
);
if
(
isUserAuth
){
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/facade/BookAuthUserFacade.java
View file @
e1420540
...
...
@@ -70,6 +70,6 @@ public interface BookAuthUserFacade {
@GetMapping
(
"checkIsHaveAuthWithServer"
)
@ApiOperation
(
"校验用户针对指定的服务是否被授权"
)
ResponseDto
<?>
checkIsHaveAuthWithServer
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
"serveId"
)
Long
serveId
)
ResponseDto
<?>
checkIsHaveAuthWithServer
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
"serveId"
)
Long
serveId
,
@RequestParam
(
value
=
"serverType"
,
required
=
false
)
String
serverType
)
throws
BizException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/facade/impl/BookAuthUserFacadeImpl.java
View file @
e1420540
...
...
@@ -101,7 +101,7 @@ public class BookAuthUserFacadeImpl implements BookAuthUserFacade {
@Override
@GetMapping
(
"checkIsHaveAuthWithServer"
)
public
ResponseDto
<?>
checkIsHaveAuthWithServer
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
"serveId"
)
Long
serveId
)
throws
BizException
{
return
new
ResponseDto
<>(
bookAuthUserBiz
.
checkIsHaveAuthWithServer
(
userInfo
,
serveId
));
public
ResponseDto
<?>
checkIsHaveAuthWithServer
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
"serveId"
)
Long
serveId
,
@RequestParam
(
value
=
"serverType"
,
required
=
false
)
String
serverType
)
throws
BizException
{
return
new
ResponseDto
<>(
bookAuthUserBiz
.
checkIsHaveAuthWithServer
(
userInfo
,
serveId
,
serverType
));
}
}
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