From c506dbabecff8411379dc28d7ec67166fd693e0f Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Sun, 29 Sep 2024 17:24:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=9B=E5=BB=BA=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=20=E5=88=87=E6=8D=A2=E5=B0=B1=E9=A4=90=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/controller/OrderController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/OrderController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/OrderController.java index a0e1ec7..75c3c77 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/OrderController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/OrderController.java @@ -2,12 +2,16 @@ package com.chaozhanggui.system.cashierservice.controller; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.annotation.LimitSubmit; import com.chaozhanggui.system.cashierservice.entity.TbShopTable; import com.chaozhanggui.system.cashierservice.entity.dto.OrderDto; import com.chaozhanggui.system.cashierservice.service.CartService; import com.chaozhanggui.system.cashierservice.service.OrderService; import com.chaozhanggui.system.cashierservice.sign.Result; +import com.chaozhanggui.system.cashierservice.util.Utils; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -24,6 +28,8 @@ public class OrderController { @Resource private OrderService orderService; private final CartService cartService; + @Autowired + private StringRedisTemplate stringRedisTemplate; public OrderController(CartService cartService) { this.cartService = cartService; @@ -33,6 +39,7 @@ public class OrderController { * 添加订单 * @return */ + @LimitSubmit(key = "memeberIn:%s") @PostMapping("/creatOrder") public Result createOrder(@RequestBody JSONObject jsonObject){ return cartService.createOrder(jsonObject);