新增注释
This commit is contained in:
@@ -6,12 +6,15 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// LimitBoardService 提供涨停板概览、分组、收益统计等业务能力。
|
||||
type LimitBoardService struct {
|
||||
DB *gorm.DB
|
||||
DB *gorm.DB // 数据库连接。
|
||||
}
|
||||
|
||||
// stockLimitCombinedTable 是涨停合并数据表名,集中定义便于多个查询复用。
|
||||
const stockLimitCombinedTable = "stock_limit_combined_data"
|
||||
|
||||
// boardLabel 把连续涨停天数转换为中文连板标签。
|
||||
func boardLabel(boardCount int) string {
|
||||
switch boardCount {
|
||||
case 1:
|
||||
@@ -37,6 +40,9 @@ func boardLabel(boardCount int) string {
|
||||
}
|
||||
}
|
||||
|
||||
// loadTradeCalendar 查询不晚于 tradeDate 的上交所开市日,并返回 tradeDate 在切片中的索引。
|
||||
//
|
||||
// dateIndex 为 -1 表示传入日期不是当前交易日历中的开市日。
|
||||
func (s *LimitBoardService) loadTradeCalendar(tradeDate string) ([]string, int, error) {
|
||||
var tradeDates []string
|
||||
if err := s.DB.Table("trade_calendar").
|
||||
|
||||
Reference in New Issue
Block a user