feat(config): 增加新闻源配置与数据库迁移支持

- 在config.json.example中添加新闻源相关配置示例,支持telegram频道订阅
- 扩展数据库表结构,新增traders表多字段支持信号源和杠杆参数
- 新增NewsConfig结构体及相关telegram新闻配置数据模型
- 在交易决策上下文结构Context中添加新闻数据news字段支持传递新闻
- 在交易决策构建用户提示信息时加入相关新闻内容
- 优化数据库操作代码,支持交易所和交易员配置的完整字段读取与更新
- 添加数据库exchanges表迁移逻辑,重建表结构和触发器以支持新字段
- 引入第三方库github.com/samber/lo用于集合操作
- 在go.mod添加新的依赖模块,并更新相关依赖版本
This commit is contained in:
wwg
2025-11-01 23:10:02 +08:00
parent 17c927b04a
commit d2af549bac
12 changed files with 934 additions and 209 deletions

3
go.mod
View File

@@ -3,6 +3,7 @@ module nofx
go 1.25.0
require (
github.com/PuerkitoBio/goquery v1.10.3
github.com/adshao/go-binance/v2 v2.8.7
github.com/ethereum/go-ethereum v1.16.5
github.com/gin-gonic/gin v1.11.0
@@ -10,11 +11,13 @@ require (
github.com/google/uuid v1.6.0
github.com/mattn/go-sqlite3 v1.14.32
github.com/pquerna/otp v1.4.0
github.com/samber/lo v1.52.0
github.com/sonirico/go-hyperliquid v0.17.0
golang.org/x/crypto v0.42.0
)
require (
github.com/andybalholm/cascadia v1.3.3 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/bits-and-blooms/bitset v1.24.0 // indirect