trade/pkg/core/symbol.go
2024-06-26 00:19:25 +08:00

17 lines
465 B
Go

package core
import "strings"
// SymbolInfo symbol infos
type SymbolInfo struct {
ID int64 `xorm:"pk autoincr null 'id'"`
Exchange string `xorm:"notnull unique(esr) 'exchange'"`
Symbol string `xorm:"notnull unique(esr) 'symbol'"`
Resolutions string `xorm:"notnull unique(esr) 'resolutions'"`
Pricescale int `xorm:"notnull 'pricescale'"`
}
func (si *SymbolInfo) GetResolutions() []string {
return strings.Split(si.Resolutions, ",")
}