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
69643b71
Commit
69643b71
authored
Dec 29, 2018
by
lili
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
版权保护
parent
ed52b7be
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
2 deletions
+53
-2
BookAuthServeService.java
...m/pcloud/book/copyright/service/BookAuthServeService.java
+7
-0
AssistTempletConsr.java
...java/com/pcloud/book/consumer/app/AssistTempletConsr.java
+0
-2
BookAuthServeBiz.java
.../java/com/pcloud/book/copyright/biz/BookAuthServeBiz.java
+6
-0
BookAuthServeBizImpl.java
.../pcloud/book/copyright/biz/impl/BookAuthServeBizImpl.java
+29
-0
BookAuthServeServiceImpl.java
...book/copyright/service/impl/BookAuthServeServiceImpl.java
+11
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/copyright/service/BookAuthServeService.java
View file @
69643b71
package
com
.
pcloud
.
book
.
copyright
.
service
;
import
com.pcloud.book.book.dto.BookAuthServeStatusParam
;
import
com.pcloud.book.copyright.dto.QrcodeAuthServeDTO
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
io.swagger.annotations.Api
;
...
...
@@ -26,4 +27,10 @@ public interface BookAuthServeService {
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4ServeIds
(
@RequestBody
BookAuthServeStatusParam
bookAuthServeStatusParam
)
throws
BizException
;
@ApiOperation
(
value
=
"批量获取应用是否开启版权保护"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"/listIsOpen4ServeIdsAndQrcode"
,
method
=
RequestMethod
.
POST
)
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4ServeIdsAndQrcode
(
@RequestBody
QrcodeAuthServeDTO
qrcodeAuthServeDTO
)
throws
BizException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/app/AssistTempletConsr.java
View file @
69643b71
...
...
@@ -36,8 +36,6 @@ public class AssistTempletConsr {
/**
* 获取模板基本信息
*
* @param appIds
* @param object
* @return
*/
public
Map
<
Long
,
AssistTempletDTO
>
mapByIds
(
List
<
Long
>
assistTempletIds
)
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/BookAuthServeBiz.java
View file @
69643b71
...
...
@@ -33,4 +33,10 @@ public interface BookAuthServeBiz {
* @return
*/
Boolean
checkIsNeedAuth
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Long
serveId
,
String
serveType
);
/**
* 获取服务是否需要授权
* @return
*/
Map
<
String
,
Boolean
>
listIsOpen4ServeIdsAndQrcode
(
Long
sceneId
,
List
<
Long
>
serveIds
);
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthServeBizImpl.java
View file @
69643b71
package
com
.
pcloud
.
book
.
copyright
.
biz
.
impl
;
import
com.pcloud.book.base.enums.BookStatusEnum
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.dto.BookInfoAndAuthStatusDTO
;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.copyright.biz.BookAuthInfoBiz
;
import
com.pcloud.book.copyright.biz.BookAuthServeBiz
;
import
com.pcloud.book.copyright.dao.BookAuthServeDao
;
import
com.pcloud.book.copyright.dto.ServeDTO
;
import
com.pcloud.book.copyright.entity.BookAuthServe
;
import
com.pcloud.book.copyright.vo.BookAuthInfoVO
;
import
com.pcloud.book.copyright.vo.ServeVO
;
import
com.pcloud.channelcenter.base.exceptions.ChannelBizException
;
import
com.pcloud.channelcenter.qrcode.dto.QrcodeSceneDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.utils.ListUtils
;
import
io.swagger.annotations.ApiModel
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -26,6 +34,10 @@ import java.util.Map;
public
class
BookAuthServeBizImpl
implements
BookAuthServeBiz
{
@Autowired
private
BookAuthServeDao
bookAuthServeDao
;
@Autowired
private
QrcodeSceneConsr
qrcodeSceneConsr
;
@Autowired
private
BookBiz
bookBiz
;
@Override
@ParamLog
(
"设置图书授权服务"
)
...
...
@@ -69,6 +81,23 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
return
bookAuthServeDao
.
checkIsNeedAuth
(
bookId
,
channelId
,
adviserId
,
serveId
,
serveType
);
}
@Override
public
Map
<
String
,
Boolean
>
listIsOpen4ServeIdsAndQrcode
(
Long
sceneId
,
List
<
Long
>
serveIds
)
{
//获取二维码基本信息
QrcodeSceneDto
qrcodeSceneDTO
=
qrcodeSceneConsr
.
getById
(
sceneId
);
if
(
qrcodeSceneDTO
==
null
||
qrcodeSceneDTO
.
getAdviserBookId
()
==
null
)
return
null
;
//获取图书是否开启授权
Long
bookId
=
qrcodeSceneDTO
.
getAdviserBookId
();
Long
channelId
=
qrcodeSceneDTO
.
getChannelPartyId
();
Long
adviserId
=
qrcodeSceneDTO
.
getCreatedByUserLogin
();
BookInfoAndAuthStatusDTO
baseAndAuthStatus
=
bookBiz
.
getBaseAndAuthStatus
(
bookId
,
channelId
,
adviserId
);
if
(
baseAndAuthStatus
!=
null
&&
BookStatusEnum
.
PROTECT
.
value
.
equals
(
baseAndAuthStatus
.
getBookStatus
())
&&
BookStatusEnum
.
BookDeleteStatus
.
NOT_DELETE
.
value
.
equals
(
baseAndAuthStatus
.
getIsDelete
()))
{
Map
<
String
,
Boolean
>
setServeAuth
=
isSetServeAuth
(
bookId
,
channelId
,
adviserId
,
serveIds
);
return
setServeAuth
;
}
return
null
;
}
private
List
<
BookAuthServe
>
changeToBookAuthServe
(
List
<
ServeVO
>
serves
,
Long
bookId
,
Long
channelId
,
Long
adviserId
)
{
List
<
BookAuthServe
>
bookAuthServes
=
new
ArrayList
<>();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/service/impl/BookAuthServeServiceImpl.java
View file @
69643b71
...
...
@@ -2,6 +2,7 @@ package com.pcloud.book.copyright.service.impl;
import
com.pcloud.book.book.dto.BookAuthServeStatusParam
;
import
com.pcloud.book.copyright.biz.BookAuthServeBiz
;
import
com.pcloud.book.copyright.dto.QrcodeAuthServeDTO
;
import
com.pcloud.book.copyright.entity.BookAuthServe
;
import
com.pcloud.book.copyright.service.BookAuthServeService
;
import
com.pcloud.common.dto.ResponseDto
;
...
...
@@ -36,4 +37,14 @@ public class BookAuthServeServiceImpl implements BookAuthServeService {
}
return
ResponseHandleUtil
.
toResponse
(
isOpen4ServeIds
);
}
@Override
@PostMapping
(
"listIsOpen4ServeIdsAndQrcode"
)
public
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4ServeIdsAndQrcode
(
@RequestBody
QrcodeAuthServeDTO
qrcodeAuthServeDTO
)
throws
BizException
{
Map
<
String
,
Boolean
>
isOpen4ServeIds
=
null
;
if
(
qrcodeAuthServeDTO
!=
null
)
{
isOpen4ServeIds
=
bookAuthServeBiz
.
listIsOpen4ServeIdsAndQrcode
(
qrcodeAuthServeDTO
.
getSceneId
(),
qrcodeAuthServeDTO
.
getServeIds
());
}
return
ResponseHandleUtil
.
toResponse
(
isOpen4ServeIds
);
}
}
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