mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-13 15:57:01 +08:00
refactor: align variable naming and add Binance time sync
1. Rename `traderRecord` to `trader` in handleCreateTrader - Aligns with upstream naming convention (nofxaios/dev) - Line 403: variable definition - Line 424: CreateTrader call 2. Add Binance server time synchronization (PR #145 simple fix) - Fixes timestamp errors (code=-1021) - Sets UseTestnet=false (ensure production network) - Syncs server time on trader initialization - Based on commit 64299c1 from pr-145 branch Both changes improve compatibility with upstream and prevent timestamp-related API failures.
This commit is contained in:
@@ -400,7 +400,7 @@ func (s *Server) handleCreateTrader(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 创建交易员配置(数据库实体)
|
||||
traderRecord := &config.TraderRecord{
|
||||
trader := &config.TraderRecord{
|
||||
ID: traderID,
|
||||
UserID: userID,
|
||||
Name: req.Name,
|
||||
@@ -421,7 +421,7 @@ func (s *Server) handleCreateTrader(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 保存到数据库
|
||||
err = s.database.CreateTrader(traderRecord)
|
||||
err = s.database.CreateTrader(trader)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("创建交易员失败: %v", err)})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user