Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Khalid Ali
bookshare-backend
Commits
548281a6
Commit
548281a6
authored
Dec 17, 2018
by
Khalid Ali
Browse files
DELETE request for listing added
parent
1f264c2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/gmu/bookshare/service/ListingService.java
View file @
548281a6
...
@@ -39,4 +39,8 @@ public class ListingService {
...
@@ -39,4 +39,8 @@ public class ListingService {
public
void
updateListing
(
ListingEntity
listingEntity
)
{
public
void
updateListing
(
ListingEntity
listingEntity
)
{
listingRepository
.
save
(
listingEntity
);
listingRepository
.
save
(
listingEntity
);
}
}
public
void
deleteListing
(
Long
id
)
{
listingRepository
.
deleteById
(
id
);
}
}
}
src/main/java/com/gmu/bookshare/web/BookshareApiController.java
View file @
548281a6
...
@@ -61,6 +61,11 @@ public class BookshareApiController {
...
@@ -61,6 +61,11 @@ public class BookshareApiController {
listingService
.
updateListing
(
listingEntity
);
listingService
.
updateListing
(
listingEntity
);
}
}
@DeleteMapping
(
value
=
"/listing/{id}"
)
void
deleteListing
(
@PathVariable
Long
id
)
{
listingService
.
deleteListing
(
id
);
}
private
ListingDto
convertToDto
(
ListingEntity
listingEntity
)
{
private
ListingDto
convertToDto
(
ListingEntity
listingEntity
)
{
ListingDto
listingDto
=
modelMapper
.
map
(
listingEntity
,
ListingDto
.
class
);
ListingDto
listingDto
=
modelMapper
.
map
(
listingEntity
,
ListingDto
.
class
);
listingDto
.
setCreateDate
(
listingEntity
.
getCreateDate
());
listingDto
.
setCreateDate
(
listingEntity
.
getCreateDate
());
...
...
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