Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
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
poc
poc-api
Commits
b417649c
Commit
b417649c
authored
Oct 25, 2024
by
jennie chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.获取用户创建应用列表中增加是否收藏的查询条件
parent
9ffb8e4a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
7 deletions
+36
-7
AgentApplicationInfoSearchDto.java
.../agent_application/dto/AgentApplicationInfoSearchDto.java
+10
-0
AgentApplicationInfoRestImpl.java
...t_application/rest/impl/AgentApplicationInfoRestImpl.java
+26
-7
No files found.
src/main/java/cn/com/poc/agent_application/dto/AgentApplicationInfoSearchDto.java
View file @
b417649c
...
...
@@ -6,6 +6,8 @@ public class AgentApplicationInfoSearchDto {
private
String
publishStatus
;
private
String
isCollect
;
public
String
getPublishStatus
()
{
return
publishStatus
;
}
...
...
@@ -21,4 +23,12 @@ public class AgentApplicationInfoSearchDto {
public
void
setQuery
(
String
query
)
{
this
.
query
=
query
;
}
public
String
getIsCollect
()
{
return
isCollect
;
}
public
void
setIsCollect
(
String
isCollect
)
{
this
.
isCollect
=
isCollect
;
}
}
src/main/java/cn/com/poc/agent_application/rest/impl/AgentApplicationInfoRestImpl.java
View file @
b417649c
...
...
@@ -75,13 +75,33 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
List
<
AgentApplicationInfoDto
>
resultList
=
new
ArrayList
<>();
for
(
BizAgentApplicationInfoEntity
entity
:
bizAgentApplicationInfoEntities
){
AgentApplicationInfoDto
infoDto
=
AgentApplicationInfoConvert
.
entityToDto
(
entity
);
// 设置当前用户是否收藏了
if
(
infoDto
.
getBaseInfo
()
!=
null
){
BizMemberAgentApplicationCollectEntity
collect
=
bizMemberAgentApplicationCollectService
.
getByAgentId
(
infoDto
.
getBaseInfo
().
getAgentId
());
if
(
collect
!=
null
){
infoDto
.
setIsCollect
(
collect
.
getIsCollect
());
// 先判断有没有收藏的查询条件
if
(
StringUtils
.
isNotBlank
(
dto
.
getIsCollect
())){
// 如果有查询条件,则判断符不符合条件
if
(
infoDto
.
getBaseInfo
()
!=
null
){
BizMemberAgentApplicationCollectEntity
collect
=
bizMemberAgentApplicationCollectService
.
getByAgentId
(
infoDto
.
getBaseInfo
().
getAgentId
());
// 如果符合条件,则把值加入
if
(
collect
!=
null
&&
collect
.
getIsCollect
().
equals
(
dto
.
getIsCollect
())){
infoDto
.
setIsCollect
(
collect
.
getIsCollect
());
}
else
if
((
collect
==
null
&&
CommonConstant
.
IsDeleted
.
N
.
equals
(
dto
.
getIsCollect
())))
{
infoDto
.
setIsCollect
(
CommonConstant
.
IsDeleted
.
N
);
}
else
{
// 如果不符合条件,则continue
continue
;
}
}
else
{
infoDto
.
setIsCollect
(
CommonConstant
.
IsDeleted
.
N
);
continue
;
}
}
else
{
// 如何没有查询条件,则直接按照原来的逻辑走
// 设置当前用户是否收藏了
if
(
infoDto
.
getBaseInfo
()
!=
null
){
BizMemberAgentApplicationCollectEntity
collect
=
bizMemberAgentApplicationCollectService
.
getByAgentId
(
infoDto
.
getBaseInfo
().
getAgentId
());
if
(
collect
!=
null
){
infoDto
.
setIsCollect
(
collect
.
getIsCollect
());
}
else
{
infoDto
.
setIsCollect
(
CommonConstant
.
IsDeleted
.
N
);
}
}
}
// 判断是否发布了,若发布则设置agentPublishId
...
...
@@ -98,7 +118,6 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
}
else
{
infoDto
.
setAgentPublishId
(
null
);
}
resultList
.
add
(
infoDto
);
}
return
resultList
;
...
...
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