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
91e1a9a1
Commit
91e1a9a1
authored
Feb 03, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-fix500' into 'master'
fix500 See merge request rays/pcloud-book!335
parents
2b6937de
a7b25e07
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
29 deletions
+38
-29
SelfRobotKeywordBiz.java
...ava/com/pcloud/book/keywords/biz/SelfRobotKeywordBiz.java
+0
-1
SelfRobotKeywordBizImpl.java
...cloud/book/keywords/biz/impl/SelfRobotKeywordBizImpl.java
+19
-12
SelfRobotKeywordDao.java
...ava/com/pcloud/book/keywords/dao/SelfRobotKeywordDao.java
+2
-0
SelfRobotKeywordDaoImpl.java
...cloud/book/keywords/dao/impl/SelfRobotKeywordDaoImpl.java
+7
-0
SelfRobotKeywordFacade.java
...m/pcloud/book/keywords/facade/SelfRobotKeywordFacade.java
+0
-6
SelfRobotKeywordFacadeImpl.java
...book/keywords/facade/impl/SelfRobotKeywordFacadeImpl.java
+0
-10
SelfRobotKeyword.xml
...book/src/main/resources/mapper/group/SelfRobotKeyword.xml
+10
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/SelfRobotKeywordBiz.java
View file @
91e1a9a1
...
...
@@ -18,5 +18,4 @@ public interface SelfRobotKeywordBiz {
String
getAppOrProductServeUrl
(
Long
bookGroupId
,
Long
serveId
,
String
serveType
,
String
serveUrl
);
String
getMaxKeyword
(
Long
bookGroupId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/SelfRobotKeywordBizImpl.java
View file @
91e1a9a1
...
...
@@ -180,18 +180,6 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
return
linkUrl
;
}
@Override
public
String
getMaxKeyword
(
Long
bookGroupId
)
{
List
<
String
>
keywords
=
selfRobotKeywordDao
.
getKeywords
(
bookGroupId
);
Integer
max
=
0
;
for
(
String
keyword
:
keywords
)
{
Integer
iKeyword
=
new
Integer
(
keyword
);
if
(
iKeyword
>
max
)
{
max
=
iKeyword
;
}
}
return
max
.
toString
();
}
@ParamLog
(
"填充列表"
)
private
void
fillSelfRobotKeyword
(
List
<
SelfRobotKeyword
>
selfRobotKeywords
)
{
...
...
@@ -274,8 +262,23 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
if
(
ListUtils
.
isEmpty
(
selfRobotKeywords
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数为空!"
);
}
List
<
Long
>
bookGroupIds
=
selfRobotKeywords
.
stream
().
map
(
SelfRobotKeyword:
:
getBookGroupId
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
SelfRobotKeyword
>
list
=
selfRobotKeywordDao
.
getListByBookGroupIds
(
bookGroupIds
);
Map
<
Long
,
List
<
SelfRobotKeyword
>>
map
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
list
)){
map
=
list
.
stream
().
filter
(
s
->
s
.
getBookGroupId
()!=
null
).
collect
(
Collectors
.
groupingBy
(
SelfRobotKeyword:
:
getBookGroupId
));
}
for
(
SelfRobotKeyword
selfRobotKeyword
:
selfRobotKeywords
)
{
checkAddSelfRobotKeyword
(
selfRobotKeyword
);
List
<
SelfRobotKeyword
>
keywordList
=
map
.
get
(
selfRobotKeyword
.
getBookGroupId
());
if
(!
ListUtils
.
isEmpty
(
keywordList
)){
List
<
String
>
keywords
=
keywordList
.
stream
().
map
(
SelfRobotKeyword:
:
getKeyword
).
collect
(
Collectors
.
toList
());
if
(!
ListUtils
.
isEmpty
(
keywords
)){
if
(
keywords
.
contains
(
selfRobotKeyword
.
getKeyword
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"关键词不能重复!"
);
}
}
}
}
}
...
...
@@ -287,6 +290,10 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
if
(
selfRobotKeyword
.
getId
()==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"id不能为空!"
);
}
List
<
String
>
keywords
=
selfRobotKeywordDao
.
getKeywords
(
selfRobotKeyword
.
getBookGroupId
());
if
(!
ListUtils
.
isEmpty
(
keywords
)&&
keywords
.
contains
(
selfRobotKeyword
.
getKeyword
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"关键词不能重复!"
);
}
checkAddSelfRobotKeyword
(
selfRobotKeyword
);
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/dao/SelfRobotKeywordDao.java
View file @
91e1a9a1
...
...
@@ -29,4 +29,6 @@ public interface SelfRobotKeywordDao extends BaseDao<SelfRobotKeyword> {
void
updateSeqNum
(
Long
id
,
Integer
seqNum
);
List
<
String
>
getKeywords
(
Long
bookGroupId
);
List
<
SelfRobotKeyword
>
getListByBookGroupIds
(
List
<
Long
>
bookGroupIds
);
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/dao/impl/SelfRobotKeywordDaoImpl.java
View file @
91e1a9a1
...
...
@@ -77,4 +77,11 @@ public class SelfRobotKeywordDaoImpl extends BaseDaoImpl<SelfRobotKeyword> imple
map
.
put
(
"bookGroupId"
,
bookGroupId
);
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getKeywords"
),
map
);
}
@Override
public
List
<
SelfRobotKeyword
>
getListByBookGroupIds
(
List
<
Long
>
bookGroupIds
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookGroupIds"
,
bookGroupIds
);
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getListByBookGroupIds"
),
map
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/facade/SelfRobotKeywordFacade.java
View file @
91e1a9a1
...
...
@@ -78,10 +78,4 @@ public interface SelfRobotKeywordFacade {
@RequestParam
(
"serveUrl"
)
@ApiParam
(
"作品或应用链接"
)
String
serveUrl
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"获取最大关键词"
)
@GetMapping
(
"getMaxKeyword"
)
ResponseDto
<?>
getMaxKeyword
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"bookGroupId"
)
@ApiParam
(
"社群码id"
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/facade/impl/SelfRobotKeywordFacadeImpl.java
View file @
91e1a9a1
...
...
@@ -124,14 +124,4 @@ public class SelfRobotKeywordFacadeImpl implements SelfRobotKeywordFacade {
return
new
ResponseDto
<>(
selfRobotKeywordBiz
.
getAppOrProductServeUrl
(
bookGroupId
,
serveId
,
serveType
,
serveUrl
));
}
@ApiOperation
(
"获取最大关键词"
)
@GetMapping
(
"getMaxKeyword"
)
@Override
public
ResponseDto
<?>
getMaxKeyword
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"bookGroupId"
)
@ApiParam
(
"社群码id"
)
Long
bookGroupId
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
selfRobotKeywordBiz
.
getMaxKeyword
(
bookGroupId
));
}
}
pcloud-service-book/src/main/resources/mapper/group/SelfRobotKeyword.xml
View file @
91e1a9a1
...
...
@@ -194,4 +194,13 @@
select keyword from self_robot_keyword
where book_group_id=#{bookGroupId}
</select>
<select
id=
"getListByBookGroupIds"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from self_robot_keyword
where book_group_id in
<foreach
collection=
"bookGroupIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
</select>
</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