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
a38092b1
Commit
a38092b1
authored
Jan 28, 2019
by
裴大威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取图书是否开启保护
parent
9e24a4d6
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
4 deletions
+115
-4
BookAuthServerDTO.java
...java/com/pcloud/book/copyright/dto/BookAuthServerDTO.java
+77
-0
BookAuthServeService.java
...m/pcloud/book/copyright/service/BookAuthServeService.java
+6
-0
BookAuthServeBiz.java
.../java/com/pcloud/book/copyright/biz/BookAuthServeBiz.java
+5
-0
BookAuthServeBizImpl.java
.../pcloud/book/copyright/biz/impl/BookAuthServeBizImpl.java
+13
-0
BookAuthServeServiceImpl.java
...book/copyright/service/impl/BookAuthServeServiceImpl.java
+14
-4
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/copyright/dto/BookAuthServerDTO.java
0 → 100644
View file @
a38092b1
package
com
.
pcloud
.
book
.
copyright
.
dto
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.util.CollectionUtils
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @author lily
* @date 2018/12/26 15:35
*/
@ApiModel
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BookAuthServerDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
9178152999605620185L
;
@ApiModelProperty
(
"图书id"
)
private
Long
bookId
;
@ApiModelProperty
(
"运营标识"
)
private
Long
channelId
;
@ApiModelProperty
(
"编辑标识"
)
private
Long
adviserId
;
@ApiModelProperty
(
"服务标识"
)
private
List
<
Long
>
serveIds
;
public
Boolean
check
(){
return
null
==
bookId
||
null
==
channelId
||
null
==
adviserId
||
CollectionUtils
.
isEmpty
(
serveIds
);
}
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
Long
getChannelId
()
{
return
channelId
;
}
public
void
setChannelId
(
Long
channelId
)
{
this
.
channelId
=
channelId
;
}
public
Long
getAdviserId
()
{
return
adviserId
;
}
public
void
setAdviserId
(
Long
adviserId
)
{
this
.
adviserId
=
adviserId
;
}
public
List
<
Long
>
getServeIds
()
{
return
serveIds
;
}
public
void
setServeIds
(
List
<
Long
>
serveIds
)
{
this
.
serveIds
=
serveIds
;
}
@Override
public
String
toString
()
{
return
"BookAuthServerDTO{"
+
"bookId="
+
bookId
+
", channelId="
+
channelId
+
", adviserId="
+
adviserId
+
", serveIds="
+
serveIds
+
'}'
;
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/copyright/service/BookAuthServeService.java
View file @
a38092b1
package
com
.
pcloud
.
book
.
copyright
.
service
;
import
com.pcloud.book.book.dto.BookAuthServeStatusParam
;
import
com.pcloud.book.copyright.dto.BookAuthServerDTO
;
import
com.pcloud.book.copyright.dto.QrcodeAuthServeDTO
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
...
...
@@ -33,4 +34,9 @@ public interface BookAuthServeService {
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4ServeIdsAndQrcode
(
@RequestBody
QrcodeAuthServeDTO
qrcodeAuthServeDTO
)
throws
BizException
;
@ApiOperation
(
value
=
"获取应用是否开启版权保护"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"/listIsOpen4ServeIdsAndBookId"
,
method
=
RequestMethod
.
POST
)
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4ServeIdsAndBookId
(
@RequestBody
BookAuthServerDTO
bookAuthServerDTO
)
throws
BizException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/BookAuthServeBiz.java
View file @
a38092b1
...
...
@@ -39,4 +39,9 @@ public interface BookAuthServeBiz {
* @return
*/
Map
<
String
,
Boolean
>
listIsOpen4ServeIdsAndQrcode
(
Long
sceneId
,
List
<
Long
>
serveIds
);
/**
* 获取图书是否开启版权保护
*/
Map
<
String
,
Boolean
>
listIsOpen4ServeIdsAndBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
List
<
Long
>
serveIds
);
}
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthServeBizImpl.java
View file @
a38092b1
...
...
@@ -55,6 +55,7 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
/**
* 是否设置应用授权 return key : typeCode_serveId
*/
@Override
@ParamLog
(
"是否设置应用授权"
)
public
Map
<
String
,
Boolean
>
isSetServeAuth
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
List
<
Long
>
serveIds
)
{
if
(
bookId
==
null
||
channelId
==
null
||
adviserId
==
null
||
ListUtils
.
isEmpty
(
serveIds
))
{
...
...
@@ -98,6 +99,18 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
return
null
;
}
@Override
@ParamLog
(
"listIsOpen4ServeIdsAndBookId"
)
public
Map
<
String
,
Boolean
>
listIsOpen4ServeIdsAndBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
List
<
Long
>
serveIds
)
{
BookInfoAndAuthStatusDTO
baseAndAuthStatus
=
bookBiz
.
getBaseAndAuthStatus
(
bookId
,
channelId
,
adviserId
);
final
boolean
boo
=
baseAndAuthStatus
!=
null
&&
BookStatusEnum
.
PROTECT
.
value
.
equals
(
baseAndAuthStatus
.
getBookStatus
())
&&
BookStatusEnum
.
BookDeleteStatus
.
NOT_DELETE
.
value
.
equals
(
baseAndAuthStatus
.
getIsDelete
());
if
(
boo
)
{
return
isSetServeAuth
(
bookId
,
channelId
,
adviserId
,
serveIds
);
}
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 @
a38092b1
...
...
@@ -2,8 +2,8 @@ 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.BookAuthServerDTO
;
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
;
import
com.pcloud.common.exceptions.BizException
;
...
...
@@ -32,7 +32,7 @@ public class BookAuthServeServiceImpl implements BookAuthServeService {
@PostMapping
(
"listIsOpen4ServeIds"
)
public
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4ServeIds
(
@RequestBody
BookAuthServeStatusParam
bookAuthServeStatusParam
)
throws
BizException
{
Map
<
String
,
Boolean
>
isOpen4ServeIds
=
null
;
if
(
bookAuthServeStatusParam
!=
null
)
{
if
(
bookAuthServeStatusParam
!=
null
)
{
isOpen4ServeIds
=
bookAuthServeBiz
.
isSetServeAuth
(
bookAuthServeStatusParam
.
getBookId
(),
bookAuthServeStatusParam
.
getChannelId
(),
bookAuthServeStatusParam
.
getAdviserId
(),
bookAuthServeStatusParam
.
getServeIds
());
}
return
ResponseHandleUtil
.
toResponse
(
isOpen4ServeIds
);
...
...
@@ -42,8 +42,18 @@ public class BookAuthServeServiceImpl implements BookAuthServeService {
@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
());
if
(
qrcodeAuthServeDTO
!=
null
)
{
isOpen4ServeIds
=
bookAuthServeBiz
.
listIsOpen4ServeIdsAndQrcode
(
qrcodeAuthServeDTO
.
getSceneId
(),
qrcodeAuthServeDTO
.
getServeIds
());
}
return
ResponseHandleUtil
.
toResponse
(
isOpen4ServeIds
);
}
@Override
@PostMapping
(
"listIsOpen4ServeIdsAndBookId"
)
public
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Boolean
>>>
listIsOpen4ServeIdsAndBookId
(
BookAuthServerDTO
bookAuthServerDTO
)
throws
BizException
{
Map
<
String
,
Boolean
>
isOpen4ServeIds
=
null
;
if
(
bookAuthServerDTO
!=
null
&&
!
bookAuthServerDTO
.
check
())
{
isOpen4ServeIds
=
bookAuthServeBiz
.
listIsOpen4ServeIdsAndBookId
(
bookAuthServerDTO
.
getBookId
(),
bookAuthServerDTO
.
getAdviserId
(),
bookAuthServerDTO
.
getChannelId
(),
bookAuthServerDTO
.
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