|
|
@@ -12,6 +12,7 @@ import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
@@ -142,7 +143,7 @@ public class SandPayService {
|
|
|
return requestServer(header, body, "https://cashier.sandpay.com.cn/qr/api/order/query");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @Cacheable(value = "sandPay", key = "#orderId")
|
|
|
public String payOrder(Long orderId) {
|
|
|
Order order = orderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
|
|
|
if (order.getStatus() != OrderStatus.NOT_PAID) {
|