优化支付通知的逻辑,解决并发的问题。

同时,收到支付结果时,立马回调业务,避免延迟
This commit is contained in:
YunaiV
2021-10-27 10:06:49 +08:00
parent 72b64dc526
commit dd2d8a2ba9
16 changed files with 363 additions and 10 deletions

View File

@ -6,6 +6,8 @@ import java.util.Date;
/**
* 时间工具类
*
* @author 芋道源码
*/
public class DateUtils {
@ -14,6 +16,11 @@ public class DateUtils {
*/
public static final String TIME_ZONE_DEFAULT = "GMT+8";
/**
* 秒转换成毫秒
*/
public static final long SECOND_MILLIS = 1000;
public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss";
public static Date addTime(Duration duration) {
@ -74,4 +81,12 @@ public class DateUtils {
return a.compareTo(b) > 0 ? a : b;
}
public static boolean beforeNow(Date date) {
return date.getTime() < System.currentTimeMillis();
}
public static boolean afterNow(Date date) {
return date.getTime() >= System.currentTimeMillis();
}
}