comment
This commit is contained in:
parent
8ded07048f
commit
d165490661
@ -135,7 +135,7 @@ public class UserInfoController extends BaseInfoProperties {
|
|||||||
@ApiOperation(value = "根据昵称搜索用户")
|
@ApiOperation(value = "根据昵称搜索用户")
|
||||||
@GetMapping("searchByNickname")
|
@GetMapping("searchByNickname")
|
||||||
public GraceJSONResult searchByNickname(@RequestParam String nickname,
|
public GraceJSONResult searchByNickname(@RequestParam String nickname,
|
||||||
@RequestParam String id,
|
@RequestParam(defaultValue = "") String id,
|
||||||
@RequestParam Integer page,
|
@RequestParam Integer page,
|
||||||
@RequestParam Integer pageSize){
|
@RequestParam Integer pageSize){
|
||||||
try {
|
try {
|
||||||
|
@ -295,6 +295,9 @@ public class UserServiceImpl implements UserService {
|
|||||||
try {
|
try {
|
||||||
PageHelper.startPage(page, pageSize);
|
PageHelper.startPage(page, pageSize);
|
||||||
List<UsersVO> userList = usersMapper.searchByNickname(nickname);
|
List<UsersVO> userList = usersMapper.searchByNickname(nickname);
|
||||||
|
if(currentUserId.isEmpty()){
|
||||||
|
return userList;
|
||||||
|
}
|
||||||
|
|
||||||
// 提取模糊查询出的用户 ID 列表
|
// 提取模糊查询出的用户 ID 列表
|
||||||
List<String> vlogerIds = userList.stream().map(UsersVO::getId).collect(Collectors.toList());
|
List<String> vlogerIds = userList.stream().map(UsersVO::getId).collect(Collectors.toList());
|
||||||
|
@ -134,6 +134,8 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
|||||||
|
|
||||||
// 获得当前视频被点赞过的总数
|
// 获得当前视频被点赞过的总数
|
||||||
v.setLikeCounts(getVlogBeLikedCounts(vlogId));
|
v.setLikeCounts(getVlogBeLikedCounts(vlogId));
|
||||||
|
// 评论数
|
||||||
|
v.setCommentsCounts(getVlogComment(vlogId));
|
||||||
}
|
}
|
||||||
|
|
||||||
// return list;
|
// return list;
|
||||||
@ -167,6 +169,16 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
|||||||
}
|
}
|
||||||
return Integer.valueOf(countsStr);
|
return Integer.valueOf(countsStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Integer getVlogComment(String vlogId) {
|
||||||
|
String countsStr = redis.get(REDIS_VLOG_COMMENT_COUNTS + ":" + vlogId);
|
||||||
|
if (StringUtils.isBlank(countsStr)) {
|
||||||
|
countsStr = "0";
|
||||||
|
}
|
||||||
|
return Integer.valueOf(countsStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
private boolean doILikeVlog(String myId, String vlogId) {
|
private boolean doILikeVlog(String myId, String vlogId) {
|
||||||
|
|
||||||
|
BIN
vlogdata/IMG20241212102441.jpg
Normal file
BIN
vlogdata/IMG20241212102441.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 MiB |
BIN
vlogdata/VID_20240225_124900.mp4
Normal file
BIN
vlogdata/VID_20240225_124900.mp4
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user