新增按交易所同步股票功能,支持 SSE/SZSE/BSE

This commit is contained in:
2026-07-04 14:51:52 +08:00
parent 44fb305f8a
commit d370d2e10a
5 changed files with 145 additions and 42 deletions
+20 -11
View File
@@ -8,17 +8,26 @@ import (
// Stock 存储股票基础信息。
type Stock struct {
ID string `json:"id" gorm:"type:uuid;primaryKey;default:gen_random_uuid()"`
TsCode string `json:"ts_code" gorm:"size:32;not null;uniqueIndex"`
Symbol string `json:"symbol" gorm:"size:32;not null;index"`
Name string `json:"name" gorm:"size:128"`
Area string `json:"area" gorm:"size:64"`
Industry string `json:"industry" gorm:"size:64"`
Market string `json:"market" gorm:"size:16"`
Exchange string `json:"exchange" gorm:"size:16"`
ListStatus string `json:"list_status" gorm:"size:8"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ID string `json:"id" gorm:"type:uuid;primaryKey;default:gen_random_uuid()"`
TsCode string `json:"ts_code" gorm:"size:32;not null;uniqueIndex"`
Symbol string `json:"symbol" gorm:"size:32;not null;index"`
Name string `json:"name" gorm:"size:128"`
Area string `json:"area" gorm:"size:64"`
Industry string `json:"industry" gorm:"size:64"`
Fullname string `json:"fullname" gorm:"size:256"`
Enname string `json:"enname" gorm:"size:256"`
Cnspell string `json:"cnspell" gorm:"size:64"`
Market string `json:"market" gorm:"size:16"`
Exchange string `json:"exchange" gorm:"size:16;index"`
CurrType string `json:"curr_type" gorm:"size:16"`
ListStatus string `json:"list_status" gorm:"size:8"`
ListDate string `json:"list_date" gorm:"size:16"`
DelistDate string `json:"delist_date" gorm:"size:16"`
IsHs string `json:"is_hs" gorm:"size:8"`
ActName string `json:"act_name" gorm:"size:128"`
ActEntType string `json:"act_ent_type" gorm:"size:64"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// AutoMigrateStocks 迁移股票基础信息表。