model

package
v0.0.0-...-7ba27d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StockTables = []interface{}{
	&Quote{},
}

Functions

func MigrateTables

func MigrateTables(db *gorm.DB, tabs ...[]any) (err error)

Types

type BaseColumns

type BaseColumns struct {
	ID         int64     `gorm:"primaryKey;comment:自增主键" json:"id"`
	CreateTime time.Time `gorm:"not null;default:'1970-01-01 00:00:00'" json:"createTime"`
}

type Quote

type Quote struct {
	BaseColumns
	Date          time.Time `gorm:"not null;index:idx_date;comment:时间" json:"day"`
	Market        string    `` /* 138-byte string literal not displayed */
	Number        string    `gorm:"size:6;not null;index:idx_market_number,priority:2;default:'';comment:证券号码" json:"number"`
	Name          string    `gorm:"size:16;not null;default:'';comment:证券名称" json:"name"`
	PreClose      float64   `gorm:"not null;default:0.0" json:"preClose"`
	Open          float64   `gorm:"not null;default:0.0" json:"open"`
	High          float64   `gorm:"not null;default:0.0" json:"high"`
	Low           float64   `gorm:"not null;default:0.0" json:"low"`
	Close         float64   `gorm:"not null;default:0.0" json:"close"`
	Volume        float64   `gorm:"not null;default:0.0" json:"volume"`
	SMA5          float64   `gorm:"not null;default:0.0" json:"sma5"`
	SMA10         float64   `gorm:"not null;default:0.0" json:"sma10"`
	SMA20         float64   `gorm:"not null;default:0.0" json:"sma20"`
	SMA60         float64   `gorm:"not null;default:0.0" json:"sma60"`
	SMA120        float64   `gorm:"not null;default:0.0" json:"sma120"`
	SMA250        float64   `gorm:"not null;default:0.0" json:"sma250"`
	UpBoll        float64   `gorm:"not null;default:0.0" json:"upBoll"`
	MidBoll       float64   `gorm:"not null;default:0.0" json:"midBoll"`
	LowBoll       float64   `gorm:"not null;default:0.0" json:"lowBoll"`
	OutMACD       float64   `gorm:"not null;default:0.0" json:"outMacd"`
	OutMACDSignal float64   `gorm:"not null;default:0.0" json:"outMacdSignal"`
	OutMACDHist   float64   `gorm:"not null;default:0.0" json:"outMacdHist"`
}

func (*Quote) TableName

func (c *Quote) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL