|
|
@@ -7,6 +7,8 @@ import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.MessageUtils;
|
|
|
import com.ruoyi.system.utils.Auth;
|
|
|
import com.ruoyi.system.utils.JwtUtil;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestHeader;
|
|
|
@@ -23,6 +25,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("/pay")
|
|
|
public class PayMethodSwitchController {
|
|
|
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(PayMethodSwitchController.class);
|
|
|
+
|
|
|
private final PayMethodSwitchService switchService;
|
|
|
|
|
|
public PayMethodSwitchController(PayMethodSwitchService switchService) {
|
|
|
@@ -45,6 +49,9 @@ public class PayMethodSwitchController {
|
|
|
// 业务拒绝(订单不可支付/方式非法/闸门限制)携带国际化文案原样返回
|
|
|
return AjaxResult.error(exception.getMessage());
|
|
|
} catch (Exception exception) {
|
|
|
+ // 兜底前必须留痕:真实异常(网关调用/NPE/SQL)只有这里能看到,不打日志等于盲修
|
|
|
+ logger.error("pay switch failed orderId={}",
|
|
|
+ request == null ? null : request.getOrderId(), exception);
|
|
|
return AjaxResult.error(MessageUtils.message("no.pay.switch.failed"));
|
|
|
}
|
|
|
}
|