Skip to content

Commit

Permalink
feat: #19 광고 상품 삭제 api 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
lsm-del committed Mar 5, 2024
1 parent ea9a6f4 commit 0e05437
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,16 @@ public BaseResponse<ProductResponse> getProduct(@PathVariable Long id) {
.data(productService.getProduct(id))
.build();
}

@DeleteMapping("/{id}")
public BaseResponse<Void> deleteProduct(@PathVariable Long id) {

productService.deleteProduct(id);

return BaseResponse.<Void>builder()
.isSuccess(true)
.code(200)
.message("광고 상품 삭제 성공")
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,10 @@ public List<ProductResponse> getAllProduct() {
}
return productResponses;
}

@Override
@Transactional
public void deleteProduct(Long id) {
productRepository.deleteById(id);
}
}

0 comments on commit 0e05437

Please sign in to comment.