支付回调

获取数据列表接口问题
token有效期 及 续期
订单详情 为null的情况
根据桌码获取shopid接口调整
首页 默认值
This commit is contained in:
2024-06-04 11:59:58 +08:00
parent c85f82f385
commit fefb4c3a85
24 changed files with 289 additions and 113 deletions

View File

@@ -10,6 +10,7 @@ public class RedisCst {
//在线用户
public static final String ONLINE_USER = "ONLINE_USER:";
public static final String PHONE_LIMIT = "PHONE_LIMIT:";
public static final String ONLINE_APP_USER = "ONLINE_APP_USER:";
public static final String LDBL_APP_VERSION = "LDBL_APP_VERSION:";
public static final String TABLE_CART = "TABLE:CART:";

View File

@@ -1,7 +1,5 @@
package com.chaozhanggui.system.cashierservice.redis;
import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -112,7 +110,7 @@ public class RedisUtil{
* @author wgc
* @date 2018-12-19 19:49
*/
public Integer saveMessage(String key, String message, int expire) {
public Integer saveMessage(String key, String message, Long expire) {
Jedis jedis = null;
try {
if (StringUtils.isEmpty(key)) {
@@ -162,6 +160,53 @@ public class RedisUtil{
}
return flag;
}
/**
* 通过key 获取数据的剩余存活时间
*/
public long getRemainingTime(String key) {
Jedis jedis = null;
long remainingTime = -1;
try {
// 从jedis池中获取一个jedis实例
jedis = pool.getResource();
if (database != 0) {
jedis.select(database);
}
// 获取键的剩余生存时间
remainingTime = jedis.ttl(key);
} catch (Exception e) {
e.printStackTrace();
} finally {
// 释放对象池即获取jedis实例使用后要将对象还回去
if (jedis != null) {
jedis.close();
}
}
return remainingTime;
}
public void setKeyExpirationTime(String key, long seconds) {
Jedis jedis = null;
try {
// 从jedis池中获取一个jedis实例
jedis = pool.getResource();
if (database != 0) {
jedis.select(database);
}
// 设置键的存活时间
jedis.expire(key, seconds);
} catch (Exception e) {
e.printStackTrace();
} finally {
// 释放对象池即获取jedis实例使用后要将对象还回去
if (jedis != null) {
jedis.close();
}
}
}
/**
* @param key
* @param message