master:系统调优;

pull/1121/head
liujiang 2025-09-20 18:28:28 +08:00
parent ba7a8e1f63
commit ac0720f3f4
2 changed files with 6 additions and 2 deletions

View File

@ -96,7 +96,7 @@ public class UserFavoritesServiceImpl implements IUserFavoritesService {
// 新增用户收藏商品消息通知
this.noticeService.createSingleNotice(SecurityUtils.getUserId(), "收藏商品成功!", NoticeType.NOTICE.getValue(), NoticeOwnerType.SYSTEM.getValue(),
userFav.getStoreId(), UserNoticeType.FAVORITE_PRODUCT.getValue(),
"恭喜您,收藏" + (ObjectUtils.isNotEmpty(store) ? store.getStoreName() : "") + " 家商品: " +
"恭喜您,收藏 " + (ObjectUtils.isNotEmpty(store) ? store.getStoreName() : "") + " 家商品: " +
(ObjectUtils.isNotEmpty(storeProd) ? storeProd.getProdArtNum() : "") + "成功!");
});
return count;

View File

@ -46,8 +46,12 @@ public class UserNoticeServiceImpl implements IUserNoticeService {
@Override
@Transactional(readOnly = true)
public Page<UserNoticeResDTO> pcPage(UserNoticePageDTO pageDTO) {
final Long userId = SecurityUtils.getUserIdSafe();
if (ObjectUtils.isEmpty(userId)) {
throw new ServiceException("用户未登录,请先登录!", HttpStatus.ERROR);
}
PageHelper.startPage(pageDTO.getPageNum(), pageDTO.getPageSize());
List<UserNoticeResDTO> list = this.userNoticeMapper.selectUserNoticeList(SecurityUtils.getUserId(), pageDTO.getNoticeTitle(), pageDTO.getNoticeType());
List<UserNoticeResDTO> list = this.userNoticeMapper.selectUserNoticeList(userId, pageDTO.getNoticeTitle(), pageDTO.getNoticeType());
list.forEach(x -> x.setTargetNoticeTypeName(UserNoticeType.of(x.getTargetNoticeType()).getLabel()));
return Page.convert(new PageInfo<>(list));
}