Ai
7 Star 43 Fork 44

王布衣/gotdx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
block_data.go 926 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2025-08-07 13:19 +08:00 . sort imports
package securities
import (
"os"
"gitee.com/quant1x/exchange"
"gitee.com/quant1x/gotdx/quotes"
"gitee.com/quant1x/gox/api"
)
// 同步板块数据
func syncBlockFiles() {
downloadBlockRawData(quotes.BLOCK_DEFAULT)
downloadBlockRawData(quotes.BLOCK_GAINIAN)
downloadBlockRawData(quotes.BLOCK_FENGGE)
downloadBlockRawData(quotes.BLOCK_ZHISHU)
updateCacheBlockFile()
}
// 更新缓存csv数据文件
func updateCacheBlockFile() {
// 如果板块数据不存在, 从应用内导出
blockFile := SectorFilename()
createOrUpdate := false
if !api.FileExist(blockFile) {
createOrUpdate = true
} else {
dataStat, err := os.Stat(blockFile)
if err == nil || os.IsExist(err) {
dataModifyTime := dataStat.ModTime()
toInit := exchange.CanInitialize(dataModifyTime)
if toInit {
createOrUpdate = true
}
} else {
createOrUpdate = true
}
}
if createOrUpdate {
parseAndGenerateBlockFile()
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/gotdx.git
git@gitee.com:quant1x/gotdx.git
quant1x
gotdx
gotdx
v1.23.15

搜索帮助