优化没有图片时不查询url

This commit is contained in:
cjw 2024-08-23 17:08:48 +08:00
parent caa26fa87b
commit ebd94660ca
1 changed files with 5 additions and 2 deletions

View File

@ -126,8 +126,11 @@ public class CounselorServiceImpl implements ICounselorService {
List<CounselorVo> records = result.getRecords();
for (CounselorVo one : records) {
SysUserVo user = userService.selectUserById(one.getId());
String url = ossService.selectUrlByIds(String.valueOf(user.getAvatar()));
one.setAvatarUrl(url);
Long avatar = user.getAvatar();
if (avatar != null) {
String url = ossService.selectUrlByIds(String.valueOf(user.getAvatar()));
one.setAvatarUrl(url);
}
one.setReservationNum(100);
Date practiceTime = one.getPracticeTime();
String betweenYear = DateUtils.getBetweenYear(practiceTime, new Date());