更新carbon依赖

This commit is contained in:
dev
2026-01-25 13:03:31 +08:00
parent 89c6d1965a
commit 14435ba426
6 changed files with 48 additions and 21 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"github.com/assimon/luuu/mq/handle"
"github.com/assimon/luuu/util/constant"
"github.com/assimon/luuu/util/math"
"github.com/golang-module/carbon/v2"
"github.com/dromara/carbon/v2"
"github.com/hibiken/asynq"
"github.com/shopspring/decimal"
"math/rand"
+2 -1
View File
@@ -2,6 +2,7 @@ package service
import (
"errors"
"github.com/assimon/luuu/config"
"github.com/assimon/luuu/model/data"
"github.com/assimon/luuu/model/mdb"
@@ -21,7 +22,7 @@ func GetCheckoutCounterByTradeId(tradeId string) (*response.CheckoutCounterRespo
TradeId: orderInfo.TradeId,
ActualAmount: orderInfo.ActualAmount,
Token: orderInfo.Token,
ExpirationTime: orderInfo.CreatedAt.AddMinutes(config.GetOrderExpirationTime()).TimestampWithMillisecond(),
ExpirationTime: orderInfo.CreatedAt.AddMinutes(config.GetOrderExpirationTime()).TimestampMilli(),
RedirectUrl: orderInfo.RedirectUrl,
}
return resp, nil
+4 -4
View File
@@ -15,7 +15,7 @@ import (
"github.com/assimon/luuu/util/http_client"
"github.com/assimon/luuu/util/json"
"github.com/assimon/luuu/util/log"
"github.com/golang-module/carbon/v2"
"github.com/dromara/carbon/v2"
"github.com/gookit/goutil/stdutil"
"github.com/hibiken/asynq"
"github.com/shopspring/decimal"
@@ -72,8 +72,8 @@ func Trc20CallBack(token string, wg *sync.WaitGroup) {
}
}()
client := http_client.GetHttpClient()
startTime := carbon.Now().AddHours(-24).TimestampWithMillisecond()
endTime := carbon.Now().TimestampWithMillisecond()
startTime := carbon.Now().AddHours(-24).TimestampMilli()
endTime := carbon.Now().TimestampMilli()
resp, err := client.R().SetQueryParams(map[string]string{
"sort": "-timestamp",
"limit": "50",
@@ -121,7 +121,7 @@ func Trc20CallBack(token string, wg *sync.WaitGroup) {
panic(err)
}
// 区块的确认时间必须在订单创建时间之后
createTime := order.CreatedAt.TimestampWithMillisecond()
createTime := order.CreatedAt.TimestampMilli()
if transfer.BlockTimestamp < createTime {
panic("Orders cannot actually be matched")
}