修正逻辑
This commit is contained in:
@@ -66,6 +66,18 @@ GET /api/v1/limit-board/overview?trade_date=2026-04-24
|
|||||||
| `close` | `number` | 收盘价 |
|
| `close` | `number` | 收盘价 |
|
||||||
| `limit_price` | `number` | 理论涨停价 |
|
| `limit_price` | `number` | 理论涨停价 |
|
||||||
| `pct_chg` | `number` | 当日涨跌幅 |
|
| `pct_chg` | `number` | 当日涨跌幅 |
|
||||||
|
| `ak_amount` | `number \| null` | AKShare 成交额 |
|
||||||
|
| `ak_float_market_value` | `number \| null` | AKShare 流通市值 |
|
||||||
|
| `ak_total_market_value` | `number \| null` | AKShare 总市值 |
|
||||||
|
| `ak_turnover_rate` | `number \| null` | AKShare 换手率 |
|
||||||
|
| `ak_seal_amount` | `number \| null` | AKShare 封板资金 |
|
||||||
|
| `ak_first_limit_time` | `string \| null` | AKShare 首次封板时间 |
|
||||||
|
| `ak_last_limit_time` | `string \| null` | AKShare 最后封板时间 |
|
||||||
|
| `ak_break_limit_count` | `int \| null` | AKShare 炸板次数 |
|
||||||
|
| `ak_limit_up_stat` | `string \| null` | AKShare 涨停统计 |
|
||||||
|
| `ak_limit_up_days` | `int \| null` | AKShare 连板数 |
|
||||||
|
| `ak_industry` | `string \| null` | AKShare 所属行业 |
|
||||||
|
| `vol` | `int \| null` | 成交量 |
|
||||||
| `board_count` | `int` | 该股票对应的连续涨停板数 |
|
| `board_count` | `int` | 该股票对应的连续涨停板数 |
|
||||||
| `board_label` | `string` | 连板展示文案,如 `首板`、`二板` |
|
| `board_label` | `string` | 连板展示文案,如 `首板`、`二板` |
|
||||||
| `display_status` | `string` | 页面可直接使用的状态文案,当前与 `board_label` 一致 |
|
| `display_status` | `string` | 页面可直接使用的状态文案,当前与 `board_label` 一致 |
|
||||||
@@ -109,6 +121,18 @@ GET /api/v1/limit-board/overview?trade_date=2026-04-24
|
|||||||
"close": 12.35,
|
"close": 12.35,
|
||||||
"limit_price": 12.35,
|
"limit_price": 12.35,
|
||||||
"pct_chg": 10.01,
|
"pct_chg": 10.01,
|
||||||
|
"ak_amount": 1523000000,
|
||||||
|
"ak_float_market_value": 8245000000,
|
||||||
|
"ak_total_market_value": 12678000000,
|
||||||
|
"ak_turnover_rate": 18.64,
|
||||||
|
"ak_seal_amount": 286000000,
|
||||||
|
"ak_first_limit_time": "09:35:12",
|
||||||
|
"ak_last_limit_time": "14:42:08",
|
||||||
|
"ak_break_limit_count": 2,
|
||||||
|
"ak_limit_up_stat": "4天4板",
|
||||||
|
"ak_limit_up_days": 4,
|
||||||
|
"ak_industry": "软件开发",
|
||||||
|
"vol": 123456789,
|
||||||
"board_count": 4,
|
"board_count": 4,
|
||||||
"board_label": "四板",
|
"board_label": "四板",
|
||||||
"display_status": "四板"
|
"display_status": "四板"
|
||||||
|
|||||||
+3
-1
@@ -34,6 +34,7 @@ GET /api/v1/stock/kline/000001.SZ
|
|||||||
| `low` | `number` | 最低价 |
|
| `low` | `number` | 最低价 |
|
||||||
| `close` | `number` | 收盘价 |
|
| `close` | `number` | 收盘价 |
|
||||||
| `pct_chg` | `number` | 涨跌幅 |
|
| `pct_chg` | `number` | 涨跌幅 |
|
||||||
|
| `vol` | `number` | 成交量 |
|
||||||
|
|
||||||
## 4. 响应示例
|
## 4. 响应示例
|
||||||
|
|
||||||
@@ -46,7 +47,8 @@ GET /api/v1/stock/kline/000001.SZ
|
|||||||
"high": 10.55,
|
"high": 10.55,
|
||||||
"low": 9.98,
|
"low": 9.98,
|
||||||
"close": 10.43,
|
"close": 10.43,
|
||||||
"pct_chg": 3.24
|
"pct_chg": 3.24,
|
||||||
|
"vol": 1234567
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -13,6 +13,18 @@ type LimitBoardStock struct {
|
|||||||
Close float64 `json:"close"`
|
Close float64 `json:"close"`
|
||||||
LimitPrice float64 `json:"limit_price"`
|
LimitPrice float64 `json:"limit_price"`
|
||||||
PctChg float64 `json:"pct_chg"`
|
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"`
|
BoardCount int `json:"board_count"`
|
||||||
BoardLabel string `json:"board_label"`
|
BoardLabel string `json:"board_label"`
|
||||||
DisplayStatus string `json:"display_status"`
|
DisplayStatus string `json:"display_status"`
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ type StockDaily struct {
|
|||||||
Low float64 `gorm:"column:low" json:"low"`
|
Low float64 `gorm:"column:low" json:"low"`
|
||||||
Close float64 `gorm:"column:close" json:"close"`
|
Close float64 `gorm:"column:close" json:"close"`
|
||||||
PctChg float64 `gorm:"column:pct_chg" json:"pct_chg"`
|
PctChg float64 `gorm:"column:pct_chg" json:"pct_chg"`
|
||||||
|
Vol float64 `gorm:"column:vol" json:"vol"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AnalyzeRequest 用于接收前端 POST 请求的参数
|
// AnalyzeRequest 用于接收前端 POST 请求的参数
|
||||||
|
|||||||
@@ -176,7 +176,19 @@ func (s *LimitBoardService) loadCurrentLimitStocks(tradeDate string) ([]model.Li
|
|||||||
DATE_FORMAT(l.trade_date, '%Y-%m-%d') AS trade_date,
|
DATE_FORMAT(l.trade_date, '%Y-%m-%d') AS trade_date,
|
||||||
COALESCE(d.close, l.close, 0) AS close,
|
COALESCE(d.close, l.close, 0) AS close,
|
||||||
COALESCE(l.limit_price, 0) AS limit_price,
|
COALESCE(l.limit_price, 0) AS limit_price,
|
||||||
COALESCE(d.pct_chg, 0) AS pct_chg
|
COALESCE(d.pct_chg, 0) AS pct_chg,
|
||||||
|
l.ak_amount,
|
||||||
|
l.ak_float_market_value,
|
||||||
|
l.ak_total_market_value,
|
||||||
|
l.ak_turnover_rate,
|
||||||
|
l.ak_seal_amount,
|
||||||
|
l.ak_first_limit_time,
|
||||||
|
l.ak_last_limit_time,
|
||||||
|
l.ak_break_limit_count,
|
||||||
|
l.ak_limit_up_stat,
|
||||||
|
l.ak_limit_up_days,
|
||||||
|
l.ak_industry,
|
||||||
|
l.vol
|
||||||
FROM stock_limit_data l
|
FROM stock_limit_data l
|
||||||
LEFT JOIN stock_daily d
|
LEFT JOIN stock_daily d
|
||||||
ON d.ts_code = l.ts_code AND d.trade_date = l.trade_date
|
ON d.ts_code = l.ts_code AND d.trade_date = l.trade_date
|
||||||
|
|||||||
Reference in New Issue
Block a user