fix schema
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// DatasetStockFinaIndicator 财务指标模型
|
||||
type DatasetStockFinaIndicator struct {
|
||||
// DatasetFinaIndicator 财务指标模型
|
||||
type DatasetFinaIndicator struct {
|
||||
gorm.Model
|
||||
TsCode string `gorm:"type:varchar(20);not null;index:fi_ts_code;uniqueIndex:un_fi_code_date;comment:TS代码"`
|
||||
Period int `gorm:"index:idx_period;uniqueIndex:un_fi_code_date;comment:报告期数"`
|
||||
@@ -205,12 +205,12 @@ type DatasetStockFinaIndicator struct {
|
||||
}
|
||||
|
||||
// TableName 设置表名
|
||||
func (DatasetStockFinaIndicator) TableName() string {
|
||||
func (DatasetFinaIndicator) TableName() string {
|
||||
return "dataset_fina_indicator"
|
||||
}
|
||||
|
||||
// Key 与表 uniqueIndex un_fi_code_date 一致:ts_code + period。
|
||||
func (f *DatasetStockFinaIndicator) Key() string {
|
||||
func (f *DatasetFinaIndicator) Key() string {
|
||||
if f.TsCode == "" && f.Period == 0 {
|
||||
return ""
|
||||
}
|
||||
@@ -218,7 +218,7 @@ func (f *DatasetStockFinaIndicator) Key() string {
|
||||
}
|
||||
|
||||
// RowLabel 便于日志/调试:ts_code + 报告期 end_date + 公告 ann_date。
|
||||
func (f *DatasetStockFinaIndicator) RowLabel() string {
|
||||
func (f *DatasetFinaIndicator) RowLabel() string {
|
||||
if f.EndDate != "" || f.AnnDate != "" {
|
||||
return f.TsCode + " end=" + f.EndDate + " ann=" + f.AnnDate
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user