Files
stock-analysis/internal/model/convertible.go
WarrenZhou e28bfec957 Initial commit: 可转债轮动分析系统
- 实时行情:东财push2主源 + 腾讯批量报价备用源(自动切换)
- 历史K线:东财push2his主源 + 腾讯web子域备用源(含熔断机制)
- 增量同步:支持 -incr/-since 参数按存档日期增量入库
- 策略回测:净值曲线/10指标/基准对比,含基本面过滤
- 用户认证:用户名密码 + 邮箱验证码双登录方式
- 前端:三Tab SPA(实时行情/策略回测/数据管理)
2026-08-17 20:23:22 +08:00

80 lines
2.9 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package model 定义领域模型,是 MVC 架构中的 Model 层核心,
// 与具体数据源(东财接口、数据库)解耦。
package model
// ConvertibleBond 表示可转债实时行情。
// 字段映射已对照东方财富数据中心(data.eastmoney.com/kzz/detail)逐一实测确认。
type ConvertibleBond struct {
Code string // 转债代码
Name string // 转债名称
Price float64 // 转债最新价
ChangePct float64 // 转债涨跌幅(%)
ListDate string // 上市日期(格式 2006-01-02)
DelistDate string // 退市日期(格式 2006-01-02,未退市为空)
StockCode string // 正股代码
StockName string // 正股名称
StockPrice float64 // 正股最新价
StockChangePct float64 // 正股涨跌幅(%)
ConvertPrice float64 // 当前转股价
InitialConvertPrice float64 // 初始转股价
ConvertValue float64 // 转股价值
PremiumRate float64 // 转股溢价率(%)
PureBondVal float64 // 纯债价值
PureBondPremium float64 // 纯债溢价率(%)
ResaleTrigPrice float64 // 回售触发价
RedeemTrigPrice float64 // 强赎触发价
}
// ConvertPrice 表示一次转股价变动(含初始转股价)。
type ConvertPrice struct {
Code string // 转债代码
EffectiveDate string // 转股价生效日期(格式 2006-01-02)
Price float64 // 转股价(元)
}
// Kline 表示单根K线数据。
type Kline struct {
Date string // 日期(格式 2006-01-02)
Open float64 // 开盘价
Close float64 // 收盘价
High float64 // 最高价
Low float64 // 最低价
Volume int64 // 成交量(手)
Amount float64 // 成交额(元)
ConvertPrice float64 // 当日转股价(元)
ConvertValue float64 // 转股价值(元)
PremiumRate float64 // 转股溢价率(%)
}
// StockFundamental 表示正股基本面数据(用于信用风险过滤)。
type StockFundamental struct {
Code string // 股票代码
Name string // 股票名称
ROE float64 // 净资产收益率(%)
DebtRatio float64 // 资产负债率(%)
NetProfit float64 // 净利润(元)
Status int // 上市状态:1=正常, 2=ST, 3=*ST
TotalAsset float64 // 总资产(元)
TotalDebt float64 // 总负债(元)
UpdateDate string // 数据更新日期
}
// User 表示系统注册用户。
type User struct {
ID int64
Username string // 用户名,用于密码登录
Email string // 邮箱,用于验证码登录
PasswordHash string
CreatedAt string
UpdatedAt string
}
// VerifyCode 表示邮箱验证码。
type VerifyCode struct {
Email string
Code string
Purpose string // register / login / reset
ExpiresAt int64 // unix timestamp
Used bool
}