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
a5603a11
Commit
a5603a11
authored
Sep 21, 2023
by
muhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 收藏册详情的客态判断
parent
63617974
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/FavoritesResponseVo.java
...in/java/com/wwdz/ch/wx/entity/vo/FavoritesResponseVo.java
+1
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
...c/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
+4
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+2
-8
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/FavoritesResponseVo.java
View file @
a5603a11
...
...
@@ -17,4 +17,5 @@ public class FavoritesResponseVo implements Entity {
private
Boolean
deleted
;
private
List
<
String
>
images
;
private
long
count
;
private
Boolean
isGuest
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
View file @
a5603a11
...
...
@@ -192,6 +192,10 @@ public class FavoritesServiceImpl implements FavoritesService {
vo
.
setCount
(
favoritesItemsRelationDao
.
countByFavoritesId
(
favorites
.
getId
()));
// 设置封面图
vo
.
setImages
(
getFavoritesImage
(
favorites
.
getId
(),
request
.
getHeader
(
"Authorization"
)));
// 是否客态
Long
userId
=
userTokenManager
.
getUserId
(
request
.
getHeader
(
"Authorization"
));
boolean
isGuest
=
!
favorites
.
getUserId
().
equals
(
userId
);
vo
.
setIsGuest
(
isGuest
);
logger
.
info
(
"【请求结束】查看收藏册详情成功"
);
return
Result
.
success
(
vo
);
}
catch
(
Exception
e
)
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
a5603a11
...
...
@@ -251,10 +251,7 @@ public class ItemServiceImpl implements ItemService {
vo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
item
.
getImages
(),
item
.
getVideos
()));
// 设置是否收藏和是否是自己发布的
vo
.
setIsCollected
(
0
);
vo
.
setIsMine
(
1
);
if
(
isGuest
)
{
vo
.
setIsMine
(
0
);
}
vo
.
setIsMine
(
isGuest
?
0
:
1
);
vo
.
setIsCollected
(
favoritesItemsRelationDao
.
isCollected
(
dto
.
getUserId
(),
item
.
getId
(),
null
)
?
1
:
0
);
// 设置收藏数
long
count
=
favoritesItemsRelationDao
.
countByItemId
(
item
.
getId
());
...
...
@@ -302,10 +299,7 @@ public class ItemServiceImpl implements ItemService {
// 设置图片或视频
vo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
es
.
getImages
(),
es
.
getVideos
()));
// 设置是否收藏和是否是自己发布的
vo
.
setIsMine
(
1
);
if
(
isGuest
)
{
vo
.
setIsMine
(
0
);
}
vo
.
setIsMine
(
isGuest
?
0
:
1
);
vo
.
setIsCollected
(
favoritesItemsRelationDao
.
isCollected
(
dto
.
getUserId
(),
es
.
getId
(),
null
)
?
1
:
0
);
// 设置收藏数
long
count
=
favoritesItemsRelationDao
.
countByItemId
(
es
.
getId
());
...
...
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