models

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinTradeInflowDto

type CoinTradeInflowDto struct {
	ID                        uint    `gorm:"primaryKey;comment:主键ID" json:"id"`
	Symbol                    string  `json:"symbol" gorm:"index;comment:币种符号"`
	TimeParticleEnum          int     `json:"timeParticleEnum" gorm:"comment:时间粒度枚举"`
	Time                      string  `json:"time" gorm:"comment:时间粒度标识(如 5m/15m/1h)"`
	Stop                      bool    `json:"stop" gorm:"comment:是否统计现货(Stop)"`
	StopTradeInflow           float64 `json:"stopTradeInflow" gorm:"comment:现货资金流入(净值)"`
	StopTradeAmount           float64 `json:"stopTradeAmount" gorm:"comment:现货成交额"`
	StopTradeInflowChange     float64 `json:"stopTradeInflowChange" gorm:"comment:现货资金流入变化率"`
	StopTradeAmountChange     float64 `json:"stopTradeAmountChange" gorm:"comment:现货成交额变化率"`
	Contract                  bool    `json:"contract" gorm:"comment:是否统计合约(Contract)"`
	ContractTradeInflow       float64 `json:"contractTradeInflow" gorm:"comment:合约资金流入(净值)"`
	ContractTradeAmount       float64 `json:"contractTradeAmount" gorm:"comment:合约成交额"`
	ContractTradeInflowChange float64 `json:"contractTradeInflowChange" gorm:"comment:合约资金流入变化率"`
	ContractTradeAmountChange float64 `json:"contractTradeAmountChange" gorm:"comment:合约成交额变化率"`
	StopTradeIn               float64 `json:"stopTradeIn" gorm:"comment:现货流入"`
	StopTradeOut              float64 `json:"stopTradeOut" gorm:"comment:现货流出"`
	ContractTradeIn           float64 `json:"contractTradeIn" gorm:"comment:合约流入"`
	ContractTradeOut          float64 `json:"contractTradeOut" gorm:"comment:合约流出"`
}

func (CoinTradeInflowDto) TableName

func (CoinTradeInflowDto) TableName() string

type Subscription added in v1.0.2

type Subscription struct {
	ID        uint      `gorm:"primaryKey;comment:主键ID"`
	Symbol    string    `gorm:"uniqueIndex:idx_sub_user_symbol_cycle;not null;comment:交易对(如 BTCUSDT)"`
	Cycle     string    `gorm:"uniqueIndex:idx_sub_user_symbol_cycle;not null;comment:周期(如 15m, 1h)"`
	UserID    uint      `gorm:"uniqueIndex:idx_sub_user_symbol_cycle;not null;comment:用户ID"`
	CreatedAt time.Time `gorm:"comment:创建时间"`
}

Subscription 订阅表(public 库),按 symbol+cycle 订阅

func (Subscription) TableName added in v1.0.2

func (Subscription) TableName() string

type SymbolRecord

type SymbolRecord struct {
	ID              uint      `gorm:"primaryKey;comment:主键ID"`                                          // 主键ID
	Symbol          string    `gorm:"index:idx_symbol_cycle,unique;comment:交易对 (e.g. BTCUSDT)"`         // 交易对 (e.g. BTCUSDT)
	Cycle           string    `gorm:"index:idx_symbol_cycle,unique;comment:周期 (e.g. 5m, 1h)"`           // 周期 (e.g. 5m, 1h)
	Price           float64   `json:"price" gorm:"comment:当前价格"`                                        // 当前价格
	Volume          float64   `json:"volume" gorm:"comment:成交量"`                                        // 成交量
	TakerBuyVolume  float64   `json:"taker_buy_volume" gorm:"comment:主动买入量"`                            // 主动买入量
	TakerBuyRatio   float64   `json:"taker_buy_ratio" gorm:"comment:主动买入占比"`                            // 主动买入占比
	Rsi             float64   `json:"rsi" gorm:"comment:RSI值"`                                          // RSI值
	Rate            float64   `json:"rate" gorm:"comment:资金费率"`                                         // 资金费率
	RateCycle       int       `json:"rate_cycle" gorm:"comment:费率结算周期(小时)"`                             // 费率结算周期
	CrossType       int       `json:"cross_type" gorm:"comment:MACD交叉类型(1表示金叉0轴上2金叉0轴下,3死叉0轴上,4死叉0轴下)"` // MACD交叉类型 (金叉/死叉)
	CrossTime       time.Time `json:"cross_time" gorm:"comment:交叉时间"`                                   // 交叉时间
	Shape           int       `json:"shape" gorm:"comment:缠论分型 (1表示顶分型,2表示底分型)"`                        // 缠论分型 (顶分型/底分型)
	VpSignal        string    `json:"vp_signal" gorm:"comment:量价分析信号"`                                  // 量价分析信号
	Change          float64   `json:"change" gorm:"comment:涨跌幅"`                                        // 涨跌幅
	Description     string    `json:"description" gorm:"type:text;comment:详情描述"`                        // 详情描述
	NextFundingTime int64     `json:"next_funding_time" gorm:"comment:下次结算时间"`                          // 下次结算时间
	UpdatedAt       time.Time `json:"updated_at" gorm:"comment:更新时间"`                                   // 更新时间
	Support         float64   `json:"support" gorm:"comment:支撑位"`                                       // 支撑位
	Resistance      float64   `json:"resistance" gorm:"comment:压力位"`                                    // 压力位
	SMCSignal       string    `json:"smc_signal" gorm:"comment:SMC信号 (BOS/CHoCH)"`                      // SMC信号
	Fvg             string    `json:"fvg" gorm:"comment:FVG缺口"`                                         // FVG缺口
	Ob              string    `json:"ob" gorm:"comment:订单块 OB"`                                         // 订单块 OB
}

func (SymbolRecord) TableName

func (SymbolRecord) TableName() string

type UserInfo added in v1.0.2

type UserInfo struct {
	ID         uint      `gorm:"primaryKey;comment:主键ID"`
	Email      string    `gorm:"uniqueIndex;not null;comment:邮箱"`
	Password   string    `gorm:"not null;comment:密码(bcrypt哈希)"`
	TelegramID string    `gorm:"column:telegram_id;comment:Telegram用户ID"`
	CreatedAt  time.Time `gorm:"comment:创建时间"`
	UpdatedAt  time.Time `gorm:"comment:更新时间"`
}

UserInfo 用户信息表(public 库)

func (UserInfo) TableName added in v1.0.2

func (UserInfo) TableName() string

type VsCoinInfo

type VsCoinInfo struct {
	ID        uint    `gorm:"primaryKey;comment:主键ID" json:"id"`
	VSTokenID int64   `json:"vsTokenId" gorm:"uniqueIndex;comment:ValueScan Token ID"`
	Name      string  `json:"name" gorm:"comment:币种名称"`
	Symbol    string  `json:"symbol" gorm:"index;comment:币种符号"`
	MarketCap float64 `json:"marketCap,string" gorm:"type:double precision;comment:市值"`
}

func (VsCoinInfo) TableName

func (VsCoinInfo) TableName() string

Jump to

Keyboard shortcuts

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