fix: ensure all timestamps use UTC timezone

- Add NowFunc to GORM config for UTC auto-generated timestamps
- Add .UTC() to all time.UnixMilli() calls in trader files
- Add .UTC() to all time.Now() calls in store and api files
- Fix TypeScript unused imports in frontend
This commit is contained in:
tinkle-community
2026-01-04 20:03:56 +08:00
parent 50923f6a2e
commit 5c9e134e99
25 changed files with 96 additions and 85 deletions

View File

@@ -1452,9 +1452,9 @@ func (s *Server) recordClosePositionOrder(traderID, exchangeID, exchangeType, sy
FilledQuantity: quantity,
AvgFillPrice: exitPrice,
Commission: fee,
FilledAt: time.Now(),
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
FilledAt: time.Now().UTC(),
CreatedAt: time.Now().UTC(),
UpdatedAt: time.Now().UTC(),
}
if err := s.store.Order().CreateOrder(orderRecord); err != nil {
@@ -1482,7 +1482,7 @@ func (s *Server) recordClosePositionOrder(traderID, exchangeID, exchangeType, sy
CommissionAsset: "USDT",
RealizedPnL: 0,
IsMaker: false,
CreatedAt: time.Now(),
CreatedAt: time.Now().UTC(),
}
if err := s.store.Order().CreateFill(fillRecord); err != nil {
@@ -1557,7 +1557,7 @@ func (s *Server) pollAndUpdateOrderStatus(orderRecordID int64, traderID, exchang
CommissionAsset: "USDT",
RealizedPnL: 0,
IsMaker: false,
CreatedAt: time.Now(),
CreatedAt: time.Now().UTC(),
}
if err := s.store.Order().CreateFill(fillRecord); err != nil {