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
6c09e200
Commit
6c09e200
authored
Sep 19, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'staging' into 'master'
Staging See merge request
!178
parents
a575b78a
d3b6e6d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
TempController.java
...gec/browserbackend/browser/controller/TempController.java
+1
-1
ShopRepositoryCustomImpl.java
...rbackend/browser/repository/ShopRepositoryCustomImpl.java
+3
-1
No files found.
src/main/java/com/edgec/browserbackend/browser/controller/TempController.java
View file @
6c09e200
...
@@ -63,7 +63,7 @@ public class TempController {
...
@@ -63,7 +63,7 @@ public class TempController {
public
ResultDto
deleteFavoritesByShopId
(
@RequestBody
FavoriteUrlDto
favoriteUrlDto
)
{
public
ResultDto
deleteFavoritesByShopId
(
@RequestBody
FavoriteUrlDto
favoriteUrlDto
)
{
ResultDto
resultDto
=
new
ResultDto
();
ResultDto
resultDto
=
new
ResultDto
();
try
{
try
{
FavoriteUrl
favoriteUrl
=
new
FavoriteUrl
(
favoriteUrlDto
.
getTitle
()
,
favoriteUrlDto
.
getUrl
());
FavoriteUrl
favoriteUrl
=
new
FavoriteUrl
(
""
,
favoriteUrlDto
.
getUrl
());
resultDto
.
setData
(
shopService
.
deleteFavoritesByShopId
(
favoriteUrlDto
.
getShopId
(),
favoriteUrl
));
resultDto
.
setData
(
shopService
.
deleteFavoritesByShopId
(
favoriteUrlDto
.
getShopId
(),
favoriteUrl
));
resultDto
.
setStatus
(
0
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
}
catch
(
ClientRequestException
e
)
{
...
...
src/main/java/com/edgec/browserbackend/browser/repository/ShopRepositoryCustomImpl.java
View file @
6c09e200
...
@@ -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"
,
favoriteUrl
);
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