You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
968 B
44 lines
968 B
|
3 months ago
|
import { Router } from 'express';
|
||
|
|
import {
|
||
|
|
healthCheck,
|
||
|
|
getStockKLines,
|
||
|
|
getBatchStockKLines,
|
||
|
|
getStockSymbols,
|
||
|
|
getTradingDates,
|
||
|
|
getSourceStatus,
|
||
|
|
switchSource,
|
||
|
|
backfillData,
|
||
|
|
} from '../controllers/customDataSourceController';
|
||
|
|
|
||
|
|
const router = Router();
|
||
|
|
|
||
|
|
// ========== 管理接口 ==========
|
||
|
|
|
||
|
|
// 健康检查(无需认证)
|
||
|
|
router.get('/admin/health', healthCheck);
|
||
|
|
|
||
|
|
// 获取数据源状态
|
||
|
|
router.get('/admin/source/status', getSourceStatus);
|
||
|
|
|
||
|
|
// 切换数据源
|
||
|
|
router.post('/admin/source/switch', switchSource);
|
||
|
|
|
||
|
|
// 历史数据补录
|
||
|
|
router.post('/admin/backfill', backfillData);
|
||
|
|
|
||
|
|
// ========== 股票接口 ==========
|
||
|
|
|
||
|
|
// 查询股票K线
|
||
|
|
router.get('/stock/klines/:symbol', getStockKLines);
|
||
|
|
|
||
|
|
// 批量查询股票K线
|
||
|
|
router.post('/stock/klines/batch', getBatchStockKLines);
|
||
|
|
|
||
|
|
// 查询股票列表
|
||
|
|
router.get('/stock/symbols', getStockSymbols);
|
||
|
|
|
||
|
|
// 查询交易日历
|
||
|
|
router.get('/stock/trading-dates', getTradingDates);
|
||
|
|
|
||
|
|
export default router;
|