import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.*; @RestController public class CheckoutController { @GetMapping("/checkout") public Map checkout( @RequestParam String products, @RequestParam(required = false) String coupon) { // Parse products Map productQuantities = new HashMap<>(); for (String productEntry : products.split(",")) { String[] parts = productEntry.split(":"); productQuantities.put( parts[0], // Product ID Integer.parseInt(parts[1]) // Quantity ); } // Build result Map result = new HashMap<>(); result.put("products", productQuantities); result.put("coupon", coupon != null ? coupon : "No coupon applied"); return result; } }

【 配送に関するご案内 】
現在、荷物増により配送会社側で全国的に配送遅延が起こっております。
マリリでは通常正午までのご注文を当日発送させていただくのですが、発送後~お届けまでに通常よりもお時間をいただいてしまう可能性が高く、ご希望いただいた日時からも遅れがでてしまう場合がございます。
※12/8(月)12時以降のご注文は、時間帯希望のみ承っております。

ご不便をおかけしてしまい大変申し訳ないのですが、どうかご容赦いただけますと幸いです。何卒、よろしくお願いいたします。


SEARCH

AND MORE

PICK UP

HOT

【配送方法】クール便発送(+220円)
【配送方法】クール便発送(+220円)

【配送方法】クール便発送(+220円)

商品番号 cooldelivery-01o1
販売価格 ¥ 220 税込
★同梱限定 (必須)
★配送会社について (必須)
★ご注意ください (必須)