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
1429b774
Commit
1429b774
authored
Sep 26, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加接口,批量更新资源配置
parent
a755a31a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
106 additions
and
21 deletions
+106
-21
BookGroupBiz.java
...src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
+7
-0
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+41
-20
BookGroupServeDao.java
...ain/java/com/pcloud/book/group/dao/BookGroupServeDao.java
+2
-0
BookGroupServeDaoImpl.java
...com/pcloud/book/group/dao/impl/BookGroupServeDaoImpl.java
+5
-0
BookGroupServe.java
...ain/java/com/pcloud/book/group/entity/BookGroupServe.java
+25
-1
BookGroupFacade.java
...in/java/com/pcloud/book/group/facade/BookGroupFacade.java
+7
-0
BookGroupFacadeImpl.java
...om/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
+12
-0
BookGroupServe.xml
...e-book/src/main/resources/mapper/group/BookGroupServe.xml
+7
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
View file @
1429b774
...
@@ -432,4 +432,11 @@ public interface BookGroupBiz {
...
@@ -432,4 +432,11 @@ public interface BookGroupBiz {
* 获取社群码暗号
* 获取社群码暗号
*/
*/
String
getBookGroupCipher
();
String
getBookGroupCipher
();
/**
* 批量更新资源配置
* @param partyId
* @param bookGroupServes
*/
void
batchUpdateBookGroupServe
(
Long
partyId
,
List
<
BookGroupServe
>
bookGroupServes
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
1429b774
...
@@ -2111,26 +2111,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -2111,26 +2111,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
public
void
batchAddBookGroupServe
(
Long
partyId
,
List
<
BookGroupServe
>
bookGroupServes
)
{
public
void
batchAddBookGroupServe
(
Long
partyId
,
List
<
BookGroupServe
>
bookGroupServes
)
{
if
(
ListUtils
.
isEmpty
(
bookGroupServes
))
{
checkBookGroupServe
(
bookGroupServes
);
return
;
}
for
(
BookGroupServe
bookGroupServe
:
bookGroupServes
)
{
if
(
bookGroupServe
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数不能为空!"
);
}
if
(
bookGroupServe
.
getBookGroupId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数社群书id不能为空!"
);
}
if
(
bookGroupServe
.
getServeId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数应用或作品id不能为空!"
);
}
if
(
StringUtil
.
isEmpty
(
bookGroupServe
.
getServeUrl
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"链接不能为空!"
);
}
if
(!(
"PRODUCT"
.
equals
(
bookGroupServe
.
getServeType
())
||
"APP"
.
equals
(
bookGroupServe
.
getServeType
())))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数应用或作品类型有误(APP或PRODUCT)!"
);
}
}
Long
bookGroupId
=
bookGroupServes
.
get
(
0
).
getBookGroupId
();
Long
bookGroupId
=
bookGroupServes
.
get
(
0
).
getBookGroupId
();
BookGroupDTO
dto
=
bookGroupDao
.
getDTOById
(
bookGroupId
);
BookGroupDTO
dto
=
bookGroupDao
.
getDTOById
(
bookGroupId
);
if
(
dto
==
null
){
if
(
dto
==
null
){
...
@@ -2181,8 +2162,10 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -2181,8 +2162,10 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
}
Map
<
Long
,
ProductDto
>
productDtoMap
=
new
HashMap
<>();
Map
<
Long
,
ProductDto
>
productDtoMap
=
new
HashMap
<>();
Map
<
Long
,
AppDto
>
appDtoMap
=
new
HashMap
<>();
Map
<
Long
,
AppDto
>
appDtoMap
=
new
HashMap
<>();
Map
<
Long
,
Boolean
>
isSuperMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
productIds
))
{
if
(!
ListUtils
.
isEmpty
(
productIds
))
{
productDtoMap
=
productConsr
.
getProBasesByIds
(
productIds
);
productDtoMap
=
productConsr
.
getProBasesByIds
(
productIds
);
isSuperMap
=
productConsr
.
getIsSuperByProductIdList
(
productIds
);
}
}
if
(!
ListUtils
.
isEmpty
(
appIds
))
{
if
(!
ListUtils
.
isEmpty
(
appIds
))
{
appDtoMap
=
appConsr
.
mapByIds
(
appIds
);
appDtoMap
=
appConsr
.
mapByIds
(
appIds
);
...
@@ -2192,12 +2175,15 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -2192,12 +2175,15 @@ public class BookGroupBizImpl implements BookGroupBiz {
ProductDto
productDto
=
productDtoMap
.
get
(
bookGroupServe
.
getServeId
());
ProductDto
productDto
=
productDtoMap
.
get
(
bookGroupServe
.
getServeId
());
if
(
productDto
!=
null
)
{
if
(
productDto
!=
null
)
{
bookGroupServe
.
setServeName
(
productDto
.
getProductName
());
bookGroupServe
.
setServeName
(
productDto
.
getProductName
());
bookGroupServe
.
setFromType
(
productDto
.
getProductTypeCode
());
bookGroupServe
.
setIsSuper
(
isSuperMap
.
get
(
bookGroupServe
.
getServeId
()));
}
}
}
}
if
(
"APP"
.
equals
(
bookGroupServe
.
getServeType
()))
{
if
(
"APP"
.
equals
(
bookGroupServe
.
getServeType
()))
{
AppDto
appDto
=
appDtoMap
.
get
(
bookGroupServe
.
getServeId
());
AppDto
appDto
=
appDtoMap
.
get
(
bookGroupServe
.
getServeId
());
if
(
appDto
!=
null
)
{
if
(
appDto
!=
null
)
{
bookGroupServe
.
setServeName
(
appDto
.
getTitle
());
bookGroupServe
.
setServeName
(
appDto
.
getTitle
());
bookGroupServe
.
setFromType
(
appDto
.
getTypeCode
());
}
}
}
}
}
}
...
@@ -2217,6 +2203,41 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -2217,6 +2203,41 @@ public class BookGroupBizImpl implements BookGroupBiz {
return
bookGroupCipher
;
return
bookGroupCipher
;
}
}
@ParamLog
(
"校验字段"
)
private
void
checkBookGroupServe
(
List
<
BookGroupServe
>
bookGroupServes
){
if
(
ListUtils
.
isEmpty
(
bookGroupServes
))
{
return
;
}
for
(
BookGroupServe
bookGroupServe
:
bookGroupServes
)
{
if
(
bookGroupServe
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数不能为空!"
);
}
if
(
bookGroupServe
.
getBookGroupId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数社群书id不能为空!"
);
}
if
(
bookGroupServe
.
getServeId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数应用或作品id不能为空!"
);
}
if
(
StringUtil
.
isEmpty
(
bookGroupServe
.
getServeUrl
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"链接不能为空!"
);
}
if
(!(
"PRODUCT"
.
equals
(
bookGroupServe
.
getServeType
())
||
"APP"
.
equals
(
bookGroupServe
.
getServeType
())))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数应用或作品类型有误(APP或PRODUCT)!"
);
}
}
}
@ParamLog
(
"批量更新资源配置"
)
@Override
public
void
batchUpdateBookGroupServe
(
Long
partyId
,
List
<
BookGroupServe
>
bookGroupServes
)
{
checkBookGroupServe
(
bookGroupServes
);
Long
bookGroupId
=
bookGroupServes
.
get
(
0
).
getBookGroupId
();
//删除之前旧的
bookGroupServeDao
.
deleteByBookGroupId
(
bookGroupId
);
//批量新增新的
batchAddBookGroupServe
(
partyId
,
bookGroupServes
);
}
@ParamLog
(
"生成暗号"
)
@ParamLog
(
"生成暗号"
)
private
String
createBookGroupCipher
(){
private
String
createBookGroupCipher
(){
//生成暗号规则:abc1234,前三位小写字母,后四位数字
//生成暗号规则:abc1234,前三位小写字母,后四位数字
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupServeDao.java
View file @
1429b774
...
@@ -9,4 +9,6 @@ public interface BookGroupServeDao extends BaseDao<BookGroupServe> {
...
@@ -9,4 +9,6 @@ public interface BookGroupServeDao extends BaseDao<BookGroupServe> {
Integer
batchInsert
(
List
<
BookGroupServe
>
bookGroupServes
);
Integer
batchInsert
(
List
<
BookGroupServe
>
bookGroupServes
);
List
<
BookGroupServe
>
getListByBookGroupId
(
Long
bookGroupId
);
List
<
BookGroupServe
>
getListByBookGroupId
(
Long
bookGroupId
);
void
deleteByBookGroupId
(
Long
bookGroupId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupServeDaoImpl.java
View file @
1429b774
...
@@ -23,4 +23,9 @@ public class BookGroupServeDaoImpl extends BaseDaoImpl<BookGroupServe> implement
...
@@ -23,4 +23,9 @@ public class BookGroupServeDaoImpl extends BaseDaoImpl<BookGroupServe> implement
public
List
<
BookGroupServe
>
getListByBookGroupId
(
Long
bookGroupId
)
{
public
List
<
BookGroupServe
>
getListByBookGroupId
(
Long
bookGroupId
)
{
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getListByBookGroupId"
),
bookGroupId
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getListByBookGroupId"
),
bookGroupId
);
}
}
@Override
public
void
deleteByBookGroupId
(
Long
bookGroupId
)
{
super
.
getSqlSession
().
delete
(
getStatement
(
"deleteByBookGroupId"
),
bookGroupId
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/entity/BookGroupServe.java
View file @
1429b774
...
@@ -32,6 +32,12 @@ public class BookGroupServe extends BaseEntity {
...
@@ -32,6 +32,12 @@ public class BookGroupServe extends BaseEntity {
@ApiModelProperty
(
"应用或作品名称"
)
@ApiModelProperty
(
"应用或作品名称"
)
private
String
serveName
;
private
String
serveName
;
@ApiModelProperty
(
"类型"
)
private
String
fromType
;
@ApiModelProperty
(
"是否超级作者"
)
private
Boolean
isSuper
;
public
Long
getServeId
()
{
public
Long
getServeId
()
{
return
serveId
;
return
serveId
;
...
@@ -90,16 +96,34 @@ public class BookGroupServe extends BaseEntity {
...
@@ -90,16 +96,34 @@ public class BookGroupServe extends BaseEntity {
this
.
serveName
=
serveName
;
this
.
serveName
=
serveName
;
}
}
public
String
getFromType
()
{
return
fromType
;
}
public
void
setFromType
(
String
fromType
)
{
this
.
fromType
=
fromType
;
}
public
Boolean
getIsSuper
()
{
return
isSuper
;
}
public
void
setIsSuper
(
Boolean
isSuper
)
{
this
.
isSuper
=
isSuper
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"BookGroupServe{"
+
return
"BookGroupServe{"
+
"serveId="
+
serveId
+
"serveId="
+
serveId
+
", serveType=
"
+
serveType
+
", serveType=
'"
+
serveType
+
'\''
+
", serveUrl='"
+
serveUrl
+
'\''
+
", serveUrl='"
+
serveUrl
+
'\''
+
", shortUrl='"
+
shortUrl
+
'\''
+
", shortUrl='"
+
shortUrl
+
'\''
+
", bookGroupId="
+
bookGroupId
+
", bookGroupId="
+
bookGroupId
+
", createUser="
+
createUser
+
", createUser="
+
createUser
+
", serveName='"
+
serveName
+
'\''
+
", serveName='"
+
serveName
+
'\''
+
", fromType='"
+
fromType
+
'\''
+
", isSuper="
+
isSuper
+
"} "
+
super
.
toString
();
"} "
+
super
.
toString
();
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/BookGroupFacade.java
View file @
1429b774
...
@@ -403,6 +403,13 @@ public interface BookGroupFacade {
...
@@ -403,6 +403,13 @@ public interface BookGroupFacade {
@RequestBody
List
<
BookGroupServe
>
bookGroupServes
@RequestBody
List
<
BookGroupServe
>
bookGroupServes
)
throws
BizException
,
PermissionException
,
JsonParseException
;
)
throws
BizException
,
PermissionException
,
JsonParseException
;
@ApiOperation
(
"批量更新资源配置"
)
@PostMapping
(
"batchUpdateBookGroupServe"
)
ResponseDto
<?>
batchUpdateBookGroupServe
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
List
<
BookGroupServe
>
bookGroupServes
)
throws
BizException
,
PermissionException
,
JsonParseException
;
@ApiOperation
(
"删除资源配置"
)
@ApiOperation
(
"删除资源配置"
)
@GetMapping
(
"deleteBookGroupServe"
)
@GetMapping
(
"deleteBookGroupServe"
)
ResponseDto
<?>
deleteBookGroupServe
(
ResponseDto
<?>
deleteBookGroupServe
(
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
View file @
1429b774
...
@@ -566,6 +566,18 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
...
@@ -566,6 +566,18 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
@ApiOperation
(
"批量更新资源配置"
)
@PostMapping
(
"batchUpdateBookGroupServe"
)
@Override
public
ResponseDto
<?>
batchUpdateBookGroupServe
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
List
<
BookGroupServe
>
bookGroupServes
)
throws
BizException
,
PermissionException
,
JsonParseException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
bookGroupBiz
.
batchUpdateBookGroupServe
(
partyId
,
bookGroupServes
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"删除资源配置"
)
@ApiOperation
(
"删除资源配置"
)
@GetMapping
(
"deleteBookGroupServe"
)
@GetMapping
(
"deleteBookGroupServe"
)
@Override
@Override
...
...
pcloud-service-book/src/main/resources/mapper/group/BookGroupServe.xml
View file @
1429b774
...
@@ -76,4 +76,10 @@
...
@@ -76,4 +76,10 @@
from book_group_serve
from book_group_serve
where book_group_id=#{bookGroupId}
where book_group_id=#{bookGroupId}
</select>
</select>
<!--根据bookGroupId删除-->
<delete
id=
"deleteByBookGroupId"
parameterType=
"long"
>
delete from book_group_serve
where book_group_id=#{bookGroupId}
</delete>
</mapper>
</mapper>
\ No newline at end of file
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