Blumonilr 6 سال پیش
والد
کامیت
7f8e6812a5

+ 2 - 0
src/main/java/com/nju/edu/pay/controller/api/AlipayController.java

@@ -17,6 +17,7 @@ import com.nju.edu.pay.service.AlipayService;
 import com.nju.edu.pay.service.OrderService;
 import com.nju.edu.pay.service.TradeService;
 import com.nju.edu.pay.util.enums.OrderStatus;
+import com.nju.edu.pay.web.annotation.RootAllowed;
 import com.nju.edu.pay.web.response.ErrorResponse;
 import com.nju.edu.pay.web.response.Response;
 import com.nju.edu.pay.web.response.SuccessResponse;
@@ -48,6 +49,7 @@ public class AlipayController {
     }
 
     @PostMapping("/pay")
+    @RootAllowed
     public Response pay(@RequestBody PayModelDTO payModelDTO) throws AlipayApiException, IOException {
         Order order=orderService.createOrder(payModelDTO.getUserId(),payModelDTO.getProductId(),payModelDTO.getPlatformType(),payModelDTO.getPrice());
         if (order==null)

+ 2 - 0
src/main/java/com/nju/edu/pay/controller/api/OrderController.java

@@ -2,6 +2,7 @@ package com.nju.edu.pay.controller.api;
 
 import com.nju.edu.pay.controller.dto.CheckOrderDTO;
 import com.nju.edu.pay.service.OrderService;
+import com.nju.edu.pay.web.annotation.RootAllowed;
 import com.nju.edu.pay.web.response.ErrorResponse;
 import com.nju.edu.pay.web.response.Response;
 import com.nju.edu.pay.web.response.SuccessResponse;
@@ -24,6 +25,7 @@ public class OrderController {
     }
 
     @GetMapping("/orderList")
+    @RootAllowed
     public Response getOrderList(){
         return new SuccessResponse(orderService.retrieveAll());
     }

+ 2 - 0
src/main/java/com/nju/edu/pay/controller/api/TradeController.java

@@ -1,6 +1,7 @@
 package com.nju.edu.pay.controller.api;
 
 import com.nju.edu.pay.service.TradeService;
+import com.nju.edu.pay.web.annotation.RootAllowed;
 import com.nju.edu.pay.web.response.Response;
 import com.nju.edu.pay.web.response.SuccessResponse;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -16,6 +17,7 @@ public class TradeController {
     TradeService tradeService;
 
     @GetMapping("/tradeList")
+    @RootAllowed
     public Response getTradeList(){
         return new SuccessResponse(tradeService.retrieveAll());
     }