Skip to content

Commit

Permalink
不可以買自己
Browse files Browse the repository at this point in the history
  • Loading branch information
wei-chun-Nien authored Jan 2, 2024
1 parent cf3d936 commit 8cd7afb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ ResponseEntity<Map<String, String>> buyProduct(@Valid @RequestBody BuyProductReq
Map<String, String> errorMessage = Collections.singletonMap("message", "只能將不二價商品加入購物車");
Map<String, String> productNotExistMessage = Collections.singletonMap("message", "商品不存在或無法購買");

Map<String, String> violate = Collections.singletonMap("message", "不可以出價自己的商品");
Map<String, String> violate = Collections.singletonMap("message", "不可以買自己的商品");

if(Objects.equals(userService.findByUsername(userIdentity.getUsername()).getId(), productService.getID(request.getProductID()).getSellerID())){
return ResponseEntity.badRequest().body(violate);
Expand Down

0 comments on commit 8cd7afb

Please sign in to comment.