Commit e5d19519 authored by muhong's avatar muhong

修改 小程序收藏

parent 0ff1459d
......@@ -305,14 +305,14 @@ public class FavoritesServiceImpl implements FavoritesService {
@Override
public Result addItem(ItemRequestDto dto) {
try {
if (favoritesItemsRelationDao.isCollected(dto.getUserId(), dto.getId())) {
Result.failed("您已经收藏过该藏品");
}
Favorites favorites = favoritesDao.info(dto.getFavoritesId());
if (Objects.isNull(favorites)) {
Result.failed("数据异常,收藏册不存在");
}
if (favoritesItemsRelationDao.isCollected(favorites.getUserId(), dto.getId())) {
Result.failed("您已经收藏过该藏品");
}
FavoritesItemsRelation favoritesItemsRelation = new FavoritesItemsRelation();
favoritesItemsRelation.setUserId(favorites.getUserId());
favoritesItemsRelation.setFavoritesId(dto.getFavoritesId());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment