新增注释

This commit is contained in:
2026-05-09 17:50:40 +08:00
parent d5c053e59d
commit 8504838ccb
19 changed files with 404 additions and 217 deletions
+177 -159
View File
@@ -1,214 +1,232 @@
package model
// LimitBoardRequest 是按交易日查询涨停板数据的通用请求。
type LimitBoardRequest struct {
TradeDate string `form:"trade_date" json:"trade_date"`
TradeDate string `form:"trade_date" json:"trade_date"` // 目标交易日,格式 YYYY-MM-DD。
}
// LimitBreakNextPerformanceRequest 是查询炸板股次日表现的请求。
type LimitBreakNextPerformanceRequest struct {
TradeStartDate string `form:"tradeStartDate" json:"trade_start_date"`
TradeEndDate string `form:"tradeEndDate" json:"trade_end_date"`
Page int `form:"page" json:"page"`
PageSize int `form:"pageSize" json:"page_size"`
TOpenGainLt101 *bool `json:"t_open_gain_lt_101,omitempty"`
BreakTimeBefore1100 *bool `json:"break_time_before_1100,omitempty"`
TradeStartDate string `form:"tradeStartDate" json:"trade_start_date"` // 查询起始交易日。
TradeEndDate string `form:"tradeEndDate" json:"trade_end_date"` // 查询结束交易日。
Page int `form:"page" json:"page"` // 当前页码,从 1 开始。
PageSize int `form:"pageSize" json:"page_size"` // 每页数量。
TOpenGainLt101 *bool `json:"t_open_gain_lt_101,omitempty"` // 可选过滤:T 日开盘是否低于前收 101%。
BreakTimeBefore1100 *bool `json:"break_time_before_1100,omitempty"` // 可选过滤:炸板时间是否早于 11:00。
}
// LimitBoardStock 表示单只涨停股在涨停概览中的展示数据。
type LimitBoardStock struct {
Symbol string `json:"symbol"`
TsCode string `json:"ts_code"`
Name string `json:"name"`
Market string `json:"market"`
TradeDate string `json:"trade_date"`
Close float64 `json:"close"`
LimitPrice float64 `json:"limit_price"`
PctChg float64 `json:"pct_chg"`
AkAmount *float64 `json:"ak_amount"`
AkFloatMarketValue *float64 `json:"ak_float_market_value"`
AkTotalMarketValue *float64 `json:"ak_total_market_value"`
AkTurnoverRate *float64 `json:"ak_turnover_rate"`
AkSealAmount *float64 `json:"ak_seal_amount"`
AkFirstLimitTime *string `json:"ak_first_limit_time"`
AkLastLimitTime *string `json:"ak_last_limit_time"`
AkBreakLimitCount *int `json:"ak_break_limit_count"`
AkLimitUpStat *string `json:"ak_limit_up_stat"`
AkLimitUpDays *int `json:"ak_limit_up_days"`
AkIndustry *string `json:"ak_industry"`
Vol *int64 `json:"vol"`
BoardCount int `json:"board_count"`
BoardLabel string `json:"board_label"`
DisplayStatus string `json:"display_status"`
Symbol string `json:"symbol"` // 市场展示用股票代码。
TsCode string `json:"ts_code"` // TuShare 股票代码。
Name string `json:"name"` // 股票简称。
Market string `json:"market"` // 所属市场。
TradeDate string `json:"trade_date"` // 交易日。
Close float64 `json:"close"` // 收盘价。
LimitPrice float64 `json:"limit_price"` // 涨停价。
PctChg float64 `json:"pct_chg"` // 当日涨跌幅。
AkAmount *float64 `json:"ak_amount"` // 成交额,数据库为空时返回 null。
AkFloatMarketValue *float64 `json:"ak_float_market_value"` // 流通市值。
AkTotalMarketValue *float64 `json:"ak_total_market_value"` // 总市值。
AkTurnoverRate *float64 `json:"ak_turnover_rate"` // 换手率。
AkSealAmount *float64 `json:"ak_seal_amount"` // 封单额。
AkFirstLimitTime *string `json:"ak_first_limit_time"` // 首次涨停时间。
AkLastLimitTime *string `json:"ak_last_limit_time"` // 最后涨停时间。
AkBreakLimitCount *int `json:"ak_break_limit_count"` // 开板次数。
AkLimitUpStat *string `json:"ak_limit_up_stat"` // 连板状态原始描述。
AkLimitUpDays *int `json:"ak_limit_up_days"` // 连续涨停天数。
AkIndustry *string `json:"ak_industry"` // 行业。
Vol *int64 `json:"vol"` // 成交量。
BoardCount int `json:"board_count"` // 计算出的连板数。
BoardLabel string `json:"board_label"` // 连板标签,例如 二板。
DisplayStatus string `json:"display_status"` // 前端展示状态,当前与 BoardLabel 保持一致。
}
// LimitOpenCompareStock 表示“今日涨停且昨日涨停”的开盘价对比数据。
type LimitOpenCompareStock struct {
Symbol string `json:"symbol"`
TsCode string `json:"ts_code"`
Name string `json:"name"`
Market string `json:"market"`
TradeDate string `json:"trade_date"`
HasOpen bool `json:"-"`
Open float64 `json:"open"`
Close float64 `json:"close"`
PreviousTradeDate string `json:"previous_trade_date"`
PreviousTwoTradeDate string `json:"previous_two_trade_date"`
HasPreviousClose bool `json:"-"`
PreviousClose float64 `json:"previous_close"`
IsFirstToSecondBoard bool `json:"is_first_to_second_board"`
IsFirstSecondBeforeEleven bool `json:"is_first_second_before_eleven"`
HighlightLabel string `json:"highlight_label"`
LimitPrice float64 `json:"limit_price"`
PctChg float64 `json:"pct_chg"`
AkAmount *float64 `json:"ak_amount"`
AkFloatMarketValue *float64 `json:"ak_float_market_value"`
AkTotalMarketValue *float64 `json:"ak_total_market_value"`
AkTurnoverRate *float64 `json:"ak_turnover_rate"`
AkSealAmount *float64 `json:"ak_seal_amount"`
AkFirstLimitTime *string `json:"ak_first_limit_time"`
AkLastLimitTime *string `json:"ak_last_limit_time"`
AkBreakLimitCount *int `json:"ak_break_limit_count"`
AkLimitUpStat *string `json:"ak_limit_up_stat"`
AkLimitUpDays *int `json:"ak_limit_up_days"`
AkIndustry *string `json:"ak_industry"`
Vol *int64 `json:"vol"`
Symbol string `json:"symbol"` // 市场展示用股票代码。
TsCode string `json:"ts_code"` // TuShare 股票代码。
Name string `json:"name"` // 股票简称。
Market string `json:"market"` // 所属市场。
TradeDate string `json:"trade_date"` // 查询交易日。
HasOpen bool `json:"-"` // 数据库是否存在今日开盘价,内部计算使用。
Open float64 `json:"open"` // 今日开盘价。
Close float64 `json:"close"` // 今日收盘价。
PreviousTradeDate string `json:"previous_trade_date"` // 上一个交易日。
PreviousTwoTradeDate string `json:"previous_two_trade_date"` // 上上个交易日。
HasPreviousClose bool `json:"-"` // 数据库是否存在前收价,内部计算使用。
PreviousClose float64 `json:"previous_close"` // 上一个交易日收盘价。
IsFirstToSecondBoard bool `json:"is_first_to_second_board"` // 是否属于首板进二板。
IsFirstSecondBeforeEleven bool `json:"is_first_second_before_eleven"` // 首板进二板且 11 点前封板。
HighlightLabel string `json:"highlight_label"` // 前端高亮标签。
LimitPrice float64 `json:"limit_price"` // 今日涨停价。
PctChg float64 `json:"pct_chg"` // 今日涨跌幅。
AkAmount *float64 `json:"ak_amount"` // 成交额。
AkFloatMarketValue *float64 `json:"ak_float_market_value"` // 流通市值。
AkTotalMarketValue *float64 `json:"ak_total_market_value"` // 总市值。
AkTurnoverRate *float64 `json:"ak_turnover_rate"` // 换手率。
AkSealAmount *float64 `json:"ak_seal_amount"` // 封单额。
AkFirstLimitTime *string `json:"ak_first_limit_time"` // 首次涨停时间。
AkLastLimitTime *string `json:"ak_last_limit_time"` // 最后涨停时间。
AkBreakLimitCount *int `json:"ak_break_limit_count"` // 开板次数。
AkLimitUpStat *string `json:"ak_limit_up_stat"` // 连板状态原始描述。
AkLimitUpDays *int `json:"ak_limit_up_days"` // 连续涨停天数。
AkIndustry *string `json:"ak_industry"` // 行业。
Vol *int64 `json:"vol"` // 成交量。
}
// LimitOpenThresholdStock 表示昨日涨停股在今日开盘阈值分组中的单股数据。
type LimitOpenThresholdStock struct {
Symbol string `json:"symbol"`
TsCode string `json:"ts_code"`
Name string `json:"name"`
Market string `json:"market"`
TradeDate string `json:"trade_date"`
HasOpen bool `json:"-"`
Open float64 `json:"open"`
Close float64 `json:"close"`
PreviousTradeDate string `json:"previous_trade_date"`
HasPreviousClose bool `json:"-"`
PreviousClose float64 `json:"previous_close"`
OpenThresholdPrice float64 `json:"open_threshold_price"`
OpenPreviousCloseRatio float64 `json:"open_previous_close_ratio"`
LimitPrice float64 `json:"limit_price"`
PctChg float64 `json:"pct_chg"`
AkAmount *float64 `json:"ak_amount"`
AkFloatMarketValue *float64 `json:"ak_float_market_value"`
AkTotalMarketValue *float64 `json:"ak_total_market_value"`
AkTurnoverRate *float64 `json:"ak_turnover_rate"`
AkSealAmount *float64 `json:"ak_seal_amount"`
AkFirstLimitTime *string `json:"ak_first_limit_time"`
AkLastLimitTime *string `json:"ak_last_limit_time"`
AkBreakLimitCount *int `json:"ak_break_limit_count"`
AkLimitUpStat *string `json:"ak_limit_up_stat"`
AkLimitUpDays *int `json:"ak_limit_up_days"`
AkIndustry *string `json:"ak_industry"`
Vol *int64 `json:"vol"`
Symbol string `json:"symbol"` // 市场展示用股票代码。
TsCode string `json:"ts_code"` // TuShare 股票代码。
Name string `json:"name"` // 股票简称。
Market string `json:"market"` // 所属市场。
TradeDate string `json:"trade_date"` // 查询交易日。
HasOpen bool `json:"-"` // 数据库是否存在今日开盘价,内部计算使用。
Open float64 `json:"open"` // 今日开盘价。
Close float64 `json:"close"` // 今日收盘价。
PreviousTradeDate string `json:"previous_trade_date"` // 上一个交易日。
HasPreviousClose bool `json:"-"` // 数据库是否存在前收价,内部计算使用。
PreviousClose float64 `json:"previous_close"` // 上一个交易日收盘价。
OpenThresholdPrice float64 `json:"open_threshold_price"` // 前收价乘以阈值比例后的开盘阈值。
OpenPreviousCloseRatio float64 `json:"open_previous_close_ratio"` // 今日开盘价与前收价的比值。
LimitPrice float64 `json:"limit_price"` // 今日涨停价。
PctChg float64 `json:"pct_chg"` // 今日涨跌幅。
AkAmount *float64 `json:"ak_amount"` // 成交额。
AkFloatMarketValue *float64 `json:"ak_float_market_value"` // 流通市值。
AkTotalMarketValue *float64 `json:"ak_total_market_value"` // 总市值。
AkTurnoverRate *float64 `json:"ak_turnover_rate"` // 换手率。
AkSealAmount *float64 `json:"ak_seal_amount"` // 封单额。
AkFirstLimitTime *string `json:"ak_first_limit_time"` // 首次涨停时间。
AkLastLimitTime *string `json:"ak_last_limit_time"` // 最后涨停时间。
AkBreakLimitCount *int `json:"ak_break_limit_count"` // 开板次数。
AkLimitUpStat *string `json:"ak_limit_up_stat"` // 连板状态原始描述。
AkLimitUpDays *int `json:"ak_limit_up_days"` // 连续涨停天数。
AkIndustry *string `json:"ak_industry"` // 行业。
Vol *int64 `json:"vol"` // 成交量。
}
// LimitBreakNextPerformanceStock 表示首板后次日炸板股票的 T+1 表现。
type LimitBreakNextPerformanceStock struct {
TradeDate string `json:"trade_date"`
Symbol string `json:"symbol"`
TsCode string `json:"ts_code"`
Name string `json:"name"`
Market string `json:"market"`
Industry string `json:"industry"`
TOpen *float64 `json:"t_open"`
TOpenPctChg *float64 `json:"t_open_pct_chg"`
TOpenGainLt101 bool `json:"t_open_gain_lt_101"`
THigh *float64 `json:"t_high"`
TClose *float64 `json:"t_close"`
TPctChg *float64 `json:"t_pct_chg"`
FirstTime string `json:"first_time"`
BreakTimeBefore1100 bool `json:"break_time_before_1100"`
HasTushareBreakData bool `json:"has_tushare_break_data"`
NextOpen *float64 `json:"next_open"`
NextHigh *float64 `json:"next_high"`
NextLow *float64 `json:"next_low"`
NextClose *float64 `json:"next_close"`
NextOpenPctChg *float64 `json:"next_open_pct_chg"`
NextIntradayProfitable *bool `json:"next_intraday_profitable"`
NextHighProfitPct *float64 `json:"next_high_profit_pct"`
NextLowLossPct *float64 `json:"next_low_loss_pct"`
NextClosePctChg *float64 `json:"next_close_pct_chg"`
TradeDate string `json:"trade_date"` // T 日交易日,即炸板发生日。
Symbol string `json:"symbol"` // 市场展示用股票代码。
TsCode string `json:"ts_code"` // TuShare 股票代码。
Name string `json:"name"` // 股票简称。
Market string `json:"market"` // 所属市场。
Industry string `json:"industry"` // 行业。
TOpen *float64 `json:"t_open"` // T 日开盘价。
TOpenPctChg *float64 `json:"t_open_pct_chg"` // T 日开盘相对前收的涨跌幅。
TOpenGainLt101 bool `json:"t_open_gain_lt_101"` // T 日开盘价是否低于前收 101%。
THigh *float64 `json:"t_high"` // T 日最高价。
TClose *float64 `json:"t_close"` // T 日收盘价。
TPctChg *float64 `json:"t_pct_chg"` // T 日涨跌幅。
FirstTime string `json:"first_time"` // TuShare 首次炸板/涨停时间,已格式化为 HH:MM:SS。
BreakTimeBefore1100 bool `json:"break_time_before_1100"` // 炸板相关时间是否早于 11:00。
HasTushareBreakData bool `json:"has_tushare_break_data"` // TuShare 是否明确标记为炸板。
NextOpen *float64 `json:"next_open"` // T+1 开盘价。
NextHigh *float64 `json:"next_high"` // T+1 最高价。
NextLow *float64 `json:"next_low"` // T+1 最低价。
NextClose *float64 `json:"next_close"` // T+1 收盘价。
NextOpenPctChg *float64 `json:"next_open_pct_chg"` // T+1 开盘相对 T 日收盘的收益率。
NextIntradayProfitable *bool `json:"next_intraday_profitable"` // T+1 最高价是否覆盖 T 日最高价。
NextHighProfitPct *float64 `json:"next_high_profit_pct"` // T+1 最高价相对 T 日收盘的最大收益率。
NextLowLossPct *float64 `json:"next_low_loss_pct"` // T+1 最低价相对 T 日收盘的最大回撤率。
NextClosePctChg *float64 `json:"next_close_pct_chg"` // T+1 收盘相对 T 日收盘的收益率。
}
// LimitOpenCompareGroup 是开盘价低于前收接口的分组结果。
type LimitOpenCompareGroup struct {
Key string `json:"key"`
Label string `json:"label"`
Count int `json:"count"`
Stocks []LimitOpenCompareStock `json:"stocks"`
Key string `json:"key"` // 分组唯一标识。
Label string `json:"label"` // 分组展示名称。
Count int `json:"count"` // 分组内股票数量。
Stocks []LimitOpenCompareStock `json:"stocks"` // 分组内股票列表。
}
// LimitOpenThresholdGroup 是开盘价阈值接口的分组结果。
type LimitOpenThresholdGroup struct {
Key string `json:"key"`
Label string `json:"label"`
Count int `json:"count"`
Stocks []LimitOpenThresholdStock `json:"stocks"`
Key string `json:"key"` // 分组唯一标识。
Label string `json:"label"` // 分组展示名称。
Count int `json:"count"` // 分组内股票数量。
Stocks []LimitOpenThresholdStock `json:"stocks"` // 分组内股票列表。
}
// LimitOpenCompareSummary 汇总昨日涨停股今日开盘表现。
type LimitOpenCompareSummary struct {
LimitCount int `json:"limit_count"`
OpenLowerPreviousCloseCount int `json:"open_lower_previous_close_count"`
OthersCount int `json:"others_count"`
FirstToSecondBoardCount int `json:"first_to_second_board_count"`
FirstSecondBeforeElevenCount int `json:"first_second_before_eleven_count"`
LimitCount int `json:"limit_count"` // 昨日涨停且今日继续涨停的股票总数。
OpenLowerPreviousCloseCount int `json:"open_lower_previous_close_count"` // 今日开盘低于昨日收盘的股票数量。
OthersCount int `json:"others_count"` // 未进入低开分组的其他股票数量。
FirstToSecondBoardCount int `json:"first_to_second_board_count"` // 首板进二板股票数量。
FirstSecondBeforeElevenCount int `json:"first_second_before_eleven_count"` // 首板进二板且 11 点前封板数量。
}
// LimitOpenThresholdSummary 汇总开盘阈值分组统计。
type LimitOpenThresholdSummary struct {
LimitCount int `json:"limit_count"`
OpenWithinThresholdCount int `json:"open_within_threshold_count"`
OpenAtOrAboveThresholdCount int `json:"open_at_or_above_threshold_count"`
ThresholdRatio float64 `json:"threshold_ratio"`
LimitCount int `json:"limit_count"` // 昨日涨停且今日继续涨停的股票总数。
OpenWithinThresholdCount int `json:"open_within_threshold_count"` // 今日开盘低于阈值的股票数量。
OpenAtOrAboveThresholdCount int `json:"open_at_or_above_threshold_count"` // 今日开盘达到或超过阈值的股票数量。
ThresholdRatio float64 `json:"threshold_ratio"` // 阈值比例,例如 1.01 表示前收 101%。
}
// LimitBreakNextPerformanceSummary 汇总炸板股次日表现统计。
type LimitBreakNextPerformanceSummary struct {
BreakCount int `json:"break_count"`
NextTradeDataCount int `json:"next_trade_data_count"`
BreakCount int `json:"break_count"` // 命中过滤条件的炸板股票数量。
NextTradeDataCount int `json:"next_trade_data_count"` // 具备 T+1 行情数据的股票数量。
}
// LimitOpenCompareResponse 是开盘价低于前收接口响应。
type LimitOpenCompareResponse struct {
TradeDate string `json:"trade_date"`
PreviousTradeDate string `json:"previous_trade_date"`
PreviousTwoTradeDate string `json:"previous_two_trade_date"`
Summary LimitOpenCompareSummary `json:"summary"`
Groups []LimitOpenCompareGroup `json:"groups"`
TradeDate string `json:"trade_date"` // 查询交易日。
PreviousTradeDate string `json:"previous_trade_date"` // 上一个交易日。
PreviousTwoTradeDate string `json:"previous_two_trade_date"` // 上上个交易日。
Summary LimitOpenCompareSummary `json:"summary"` // 汇总统计。
Groups []LimitOpenCompareGroup `json:"groups"` // 固定分组结果。
}
// LimitBreakNextPerformanceResponse 是炸板股次日表现接口响应。
type LimitBreakNextPerformanceResponse struct {
TradeStartDate string `json:"trade_start_date"`
TradeEndDate string `json:"trade_end_date"`
Page int `json:"page"`
PageSize int `json:"page_size"`
Total int `json:"total"`
TotalPages int `json:"total_pages"`
Summary LimitBreakNextPerformanceSummary `json:"summary"`
List []LimitBreakNextPerformanceStock `json:"list"`
TradeStartDate string `json:"trade_start_date"` // 查询起始交易日。
TradeEndDate string `json:"trade_end_date"` // 查询结束交易日。
Page int `json:"page"` // 当前页码。
PageSize int `json:"page_size"` // 每页数量。
Total int `json:"total"` // 命中过滤条件的总记录数。
TotalPages int `json:"total_pages"` // 总页数。
Summary LimitBreakNextPerformanceSummary `json:"summary"` // 汇总统计。
List []LimitBreakNextPerformanceStock `json:"list"` // 当前页记录。
}
// LimitOpenThresholdResponse 是开盘价阈值分组接口响应。
type LimitOpenThresholdResponse struct {
TradeDate string `json:"trade_date"`
PreviousTradeDate string `json:"previous_trade_date"`
Summary LimitOpenThresholdSummary `json:"summary"`
Groups []LimitOpenThresholdGroup `json:"groups"`
TradeDate string `json:"trade_date"` // 查询交易日。
PreviousTradeDate string `json:"previous_trade_date"` // 上一个交易日。
Summary LimitOpenThresholdSummary `json:"summary"` // 汇总统计。
Groups []LimitOpenThresholdGroup `json:"groups"` // 固定分组结果。
}
// LimitBoardGroup 是涨停概览按连板数聚合后的分组。
type LimitBoardGroup struct {
BoardCount int `json:"board_count"`
Label string `json:"label"`
Count int `json:"count"`
Stocks []LimitBoardStock `json:"stocks"`
BoardCount int `json:"board_count"` // 连板数。
Label string `json:"label"` // 连板展示标签。
Count int `json:"count"` // 分组股票数量。
Stocks []LimitBoardStock `json:"stocks"` // 分组股票列表。
}
// LimitBoardSummary 汇总涨停概览的核心统计。
type LimitBoardSummary struct {
MaxBoardCount int `json:"max_board_count"`
LimitCount int `json:"limit_count"`
GroupCount int `json:"group_count"`
MaxBoardCount int `json:"max_board_count"` // 当日最高连板数。
LimitCount int `json:"limit_count"` // 当日涨停股票数量。
GroupCount int `json:"group_count"` // 连板分组数量。
}
// LimitBoardDailyMax 表示某个交易日的最高连板数。
type LimitBoardDailyMax struct {
TradeDate string `json:"trade_date"`
MaxBoardCount int `json:"max_board_count"`
TradeDate string `json:"trade_date"` // 交易日。
MaxBoardCount int `json:"max_board_count"` // 当日最高连板数。
}
// LimitBoardResponse 是涨停概览接口响应。
type LimitBoardResponse struct {
TradeDate string `json:"trade_date"`
Summary LimitBoardSummary `json:"summary"`
RecentMaxBoardStats []LimitBoardDailyMax `json:"recent_max_board_stats"`
Groups []LimitBoardGroup `json:"groups"`
TradeDate string `json:"trade_date"` // 查询交易日。
Summary LimitBoardSummary `json:"summary"` // 当日概览统计。
RecentMaxBoardStats []LimitBoardDailyMax `json:"recent_max_board_stats"` // 最近窗口内每日最高连板数。
Groups []LimitBoardGroup `json:"groups"` // 按连板数倒序排列的股票分组。
}