Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
515714ca
Commit
515714ca
authored
Sep 25, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客态展示关注关系
parent
0e0babdf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
...java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
+14
-9
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
View file @
515714ca
...
@@ -183,7 +183,7 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
...
@@ -183,7 +183,7 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
}
}
followFansRecordVos
.
add
(
followFansRecordVo
);
followFansRecordVos
.
add
(
followFansRecordVo
);
});
});
List
<
FollowFansRecordVo
>
followFansRecordVoList
=
getCurrentFollowRelation
(
dto
,
followFansRecordVos
);
List
<
FollowFansRecordVo
>
followFansRecordVoList
=
getCurrentFollowRelation
(
dto
,
followFansRecordVos
,
"follow"
);
return
Result
.
success
(
PageSearchResult
.
of
(
pageInfo
,
followFansRecordVoList
));
return
Result
.
success
(
PageSearchResult
.
of
(
pageInfo
,
followFansRecordVoList
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"{} 查询关注列表 {}"
,
dto
.
getId
(),
e
);
logger
.
error
(
"{} 查询关注列表 {}"
,
dto
.
getId
(),
e
);
...
@@ -223,7 +223,7 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
...
@@ -223,7 +223,7 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
}
}
followFansRecordVos
.
add
(
followFansRecordVo
);
followFansRecordVos
.
add
(
followFansRecordVo
);
});
});
List
<
FollowFansRecordVo
>
followFansRecordVoList
=
getCurrentFollowRelation
(
dto
,
followFansRecordVos
);
List
<
FollowFansRecordVo
>
followFansRecordVoList
=
getCurrentFollowRelation
(
dto
,
followFansRecordVos
,
"fans"
);
return
Result
.
success
(
PageSearchResult
.
of
(
pageInfo
,
followFansRecordVoList
));
return
Result
.
success
(
PageSearchResult
.
of
(
pageInfo
,
followFansRecordVoList
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"{} 查询粉丝列表 {}"
,
dto
.
getId
(),
e
);
logger
.
error
(
"{} 查询粉丝列表 {}"
,
dto
.
getId
(),
e
);
...
@@ -232,29 +232,34 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
...
@@ -232,29 +232,34 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
}
}
public
List
<
FollowFansRecordVo
>
getCurrentFollowRelation
(
FollowFansRecordRequestDto
dto
,
List
<
FollowFansRecordVo
>
followFansRecordVos
)
{
public
List
<
FollowFansRecordVo
>
getCurrentFollowRelation
(
FollowFansRecordRequestDto
dto
,
List
<
FollowFansRecordVo
>
followFansRecordVos
,
String
type
)
{
if
(
dto
.
getCurrentUserId
()
!=
null
)
{
if
(
dto
.
getCurrentUserId
()
!=
null
)
{
//查询当前用户关注的人
//查询当前用户关注的人
FollowFansRecordRequestDto
currentFollowDto
=
new
FollowFansRecordRequestDto
();
FollowFansRecordRequestDto
currentFollowDto
=
new
FollowFansRecordRequestDto
();
d
to
.
setFansId
(
dto
.
getCurrentUserId
());
currentFollowD
to
.
setFansId
(
dto
.
getCurrentUserId
());
List
<
FollowFansRecord
>
currentFollowFansRecordList
=
followFansRecordDao
.
findList
(
currentFollowDto
);
List
<
FollowFansRecord
>
currentFollowFansRecordList
=
followFansRecordDao
.
findList
(
currentFollowDto
);
List
<
Long
>
currentFollowIdList
=
currentFollowFansRecordList
.
stream
().
map
(
FollowFansRecord:
:
getFollowerId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
currentFollowIdList
=
currentFollowFansRecordList
.
stream
().
map
(
FollowFansRecord:
:
getFollowerId
).
collect
(
Collectors
.
toList
());
//查询当前用户的粉丝
//查询当前用户的粉丝
FollowFansRecordRequestDto
currentFansDto
=
new
FollowFansRecordRequestDto
();
FollowFansRecordRequestDto
currentFansDto
=
new
FollowFansRecordRequestDto
();
d
to
.
setFollowerId
(
dto
.
getCurrentUserId
());
currentFansD
to
.
setFollowerId
(
dto
.
getCurrentUserId
());
List
<
FollowFansRecord
>
currentFansRecordList
=
followFansRecordDao
.
findList
(
currentFansDto
);
List
<
FollowFansRecord
>
currentFansRecordList
=
followFansRecordDao
.
findList
(
currentFansDto
);
List
<
Long
>
currentFansIdList
=
currentFansRecordList
.
stream
().
map
(
FollowFansRecord:
:
getFansId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
currentFansIdList
=
currentFansRecordList
.
stream
().
map
(
FollowFansRecord:
:
getFansId
).
collect
(
Collectors
.
toList
());
followFansRecordVos
.
forEach
(
followFansRecordVo
->
{
followFansRecordVos
.
forEach
(
followFansRecordVo
->
{
long
followerId
=
followFansRecordVo
.
getFollowerId
();
long
id
;
if
(
currentFollowIdList
.
contains
(
followerId
)
&&
currentFansIdList
.
contains
(
followerId
))
{
if
(
"fans"
.
equals
(
type
))
{
id
=
followFansRecordVo
.
getFansId
();
}
else
{
id
=
followFansRecordVo
.
getFollowerId
();
}
if
(
currentFollowIdList
.
contains
(
id
)
&&
currentFansIdList
.
contains
(
id
))
{
followFansRecordVo
.
setRelation
(
"互相关注"
);
followFansRecordVo
.
setRelation
(
"互相关注"
);
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
BOTH_FOLLOWED
.
getCode
());
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
BOTH_FOLLOWED
.
getCode
());
}
else
if
(
currentFollowIdList
.
contains
(
followerId
)
&&
!
currentFansIdList
.
contains
(
followerI
d
))
{
}
else
if
(
currentFollowIdList
.
contains
(
id
)
&&
!
currentFansIdList
.
contains
(
i
d
))
{
followFansRecordVo
.
setRelation
(
"已关注"
);
followFansRecordVo
.
setRelation
(
"已关注"
);
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
FOLLOWED
.
getCode
());
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
FOLLOWED
.
getCode
());
}
else
if
(!
currentFollowIdList
.
contains
(
followerId
)
&&
currentFansIdList
.
contains
(
followerI
d
))
{
}
else
if
(!
currentFollowIdList
.
contains
(
id
)
&&
currentFansIdList
.
contains
(
i
d
))
{
followFansRecordVo
.
setRelation
(
"回关"
);
followFansRecordVo
.
setRelation
(
"回关"
);
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
BACK_FOLLOWED
.
getCode
());
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
BACK_FOLLOWED
.
getCode
());
}
else
{
}
else
{
...
...
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