支付状态 取消时

This commit is contained in:
2025-03-15 09:29:21 +08:00
parent 046ab99359
commit 434ffe3763
4 changed files with 27 additions and 2 deletions

View File

@@ -111,6 +111,14 @@ public class CzgControllerAdvice {
return CzgResult.success();
}
/**
* 订单超时 取消
*/
@ExceptionHandler(OrderCancelException.class)
public CzgResult<Object> handleOrderCancelException() {
return CzgResult.failure(701,"订单已过期,请重新下单");
}
/**
* 处理Hutool的断言抛出异常
*/

View File

@@ -18,7 +18,7 @@ public interface RedisCst {
*/
class classKeyExpired {
//订单key过期
public static final String EXPIRED_ORDER = "expired.order:";
public static final String EXPIRED_ORDER = "expired:order:";
}

View File

@@ -0,0 +1,16 @@
package com.czg.exception;
import java.io.Serial;
/**
* @author ww
* @description
*/
public class OrderCancelException extends RuntimeException{
@Serial
private static final long serialVersionUID = 1L;
public OrderCancelException(String message) {
super(message);
}
}