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