Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
browser-backend
Commits
d3b6e6d7
Commit
d3b6e6d7
authored
Sep 19, 2020
by
xuxinpc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收藏夹相关接口 修改传参
parent
cde32e8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
ShopRepositoryCustomImpl.java
...rbackend/browser/repository/ShopRepositoryCustomImpl.java
+3
-1
No files found.
src/main/java/com/edgec/browserbackend/browser/repository/ShopRepositoryCustomImpl.java
View file @
d3b6e6d7
...
@@ -7,6 +7,8 @@ import org.bson.Document;
...
@@ -7,6 +7,8 @@ import org.bson.Document;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.BasicQuery
;
import
org.springframework.data.mongodb.core.query.BasicQuery
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.data.mongodb.core.query.Update
;
import
static
org
.
springframework
.
data
.
mongodb
.
core
.
query
.
Criteria
.
where
;
import
static
org
.
springframework
.
data
.
mongodb
.
core
.
query
.
Criteria
.
where
;
...
@@ -33,7 +35,7 @@ public class ShopRepositoryCustomImpl implements ShopRepositoryCustom {
...
@@ -33,7 +35,7 @@ public class ShopRepositoryCustomImpl implements ShopRepositoryCustom {
BasicQuery
basicQuery
=
new
BasicQuery
(
doc
);
BasicQuery
basicQuery
=
new
BasicQuery
(
doc
);
basicQuery
.
addCriteria
(
where
(
"_id"
).
is
(
shopId
));
basicQuery
.
addCriteria
(
where
(
"_id"
).
is
(
shopId
));
Update
update
=
new
Update
();
Update
update
=
new
Update
();
update
.
pull
(
"favoritesUrls
.$.url"
,
favoriteUrl
.
getUrl
(
));
update
.
pull
(
"favoritesUrls
"
,
Query
.
query
(
Criteria
.
where
(
"url"
).
is
(
favoriteUrl
.
getUrl
())
));
UpdateResult
result
=
mongoTemplate
.
updateFirst
(
basicQuery
,
update
,
Shop
.
class
);
UpdateResult
result
=
mongoTemplate
.
updateFirst
(
basicQuery
,
update
,
Shop
.
class
);
return
result
.
getModifiedCount
()
>=
1
;
return
result
.
getModifiedCount
()
>=
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment