Commit 8b847be9 authored by xuxinpc's avatar xuxinpc

收藏夹相关接口 修改传参

parent 1942954b
......@@ -63,7 +63,7 @@ public class TempController {
public ResultDto deleteFavoritesByShopId(@RequestBody FavoriteUrlDto favoriteUrlDto) {
ResultDto resultDto = new ResultDto();
try {
FavoriteUrl favoriteUrl = new FavoriteUrl(favoriteUrlDto.getTitle(),favoriteUrlDto.getUrl());
FavoriteUrl favoriteUrl = new FavoriteUrl("",favoriteUrlDto.getUrl());
resultDto.setData(shopService.deleteFavoritesByShopId(favoriteUrlDto.getShopId(), favoriteUrl));
resultDto.setStatus(0);
} catch (ClientRequestException e) {
......
......@@ -33,7 +33,7 @@ public class ShopRepositoryCustomImpl implements ShopRepositoryCustom {
BasicQuery basicQuery = new BasicQuery(doc);
basicQuery.addCriteria(where("_id").is(shopId));
Update update = new Update();
update.pull("favoritesUrls", favoriteUrl);
update.pull("favoritesUrls.url", favoriteUrl.getUrl());
UpdateResult result = mongoTemplate.updateFirst(basicQuery, update, Shop.class);
return result.getModifiedCount() >= 1;
}
......
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