|
|
@@ -11,6 +11,7 @@ import org.springblade.core.tool.utils.SpringUtil;
|
|
|
import org.springblade.payment.entity.SuccessParams;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
|
|
+import java.time.Duration;
|
|
|
import java.util.Objects;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@@ -33,9 +34,6 @@ public class PaymentCache {
|
|
|
|
|
|
static {
|
|
|
bladeRedis = SpringUtil.getBean("bladeRedis");
|
|
|
- if(Objects.isNull(bladeRedis)){
|
|
|
- throw new ServiceException(ResCode.USER_PWS_ERROR);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -108,7 +106,8 @@ public class PaymentCache {
|
|
|
* @return
|
|
|
*/
|
|
|
public static void putSuccessParams(String billId, SuccessParams successParams) {
|
|
|
- CacheUtil.put(CacheNames.PAYMENT, ORDER_INFO, billId, JSON.toJSONString(successParams),false);
|
|
|
+ bladeRedis.setEx(CacheNames.PAYMENT.concat(ORDER_INFO).concat(billId), JSON.toJSONString(successParams),Duration.ofDays(1L));
|
|
|
+// CacheUtil.put(CacheNames.PAYMENT, ORDER_INFO, billId, JSON.toJSONString(successParams),false);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -117,7 +116,8 @@ public class PaymentCache {
|
|
|
* @return
|
|
|
*/
|
|
|
public static SuccessParams getSuccessParams(String billId) {
|
|
|
- String params = CacheUtil.get(CacheNames.PAYMENT, ORDER_INFO, billId,String.class,false);
|
|
|
+// String params = CacheUtil.get(CacheNames.PAYMENT, ORDER_INFO, billId,String.class,false);
|
|
|
+ String params = bladeRedis.get(CacheNames.PAYMENT.concat(ORDER_INFO).concat(billId));
|
|
|
return JSON.parseObject(params,SuccessParams.class);
|
|
|
}
|
|
|
|