1.代客下单 创建订单增加锁

2.代客下单 主扫支付
This commit is contained in:
2024-09-02 14:50:40 +08:00
parent 94e875008b
commit be4f8cbbdd
13 changed files with 902 additions and 259 deletions

View File

@@ -18,6 +18,9 @@ public interface RedisConstant {
String ADD_TABLE_CART_LOCK = "ADD_TABLE_CART";
String PC_OUT_NUMBER = "PC_OUT_NUMBER:";
String LOCK_KEY = "LOCK:";
String CREATE_ORDER = "CREATE_ORDER";
static String getCurrentOrderKey(String tableId, String shopId) {
return CURRENT_TABLE_ORDER + shopId + ":" + tableId;
@@ -26,4 +29,12 @@ public interface RedisConstant {
static String getTableCartKey(String tableId, String shopId) {
return TABLE_CART + tableId + "-" + shopId;
}
static String getLockKey(String sign, Object... args) {
StringBuilder key = new StringBuilder(LOCK_KEY + ":" + sign + ":");
for (Object arg : args) {
key.append(":").append(arg.toString());
}
return key.toString();
}
}