feat: 增加 搜索股票代码

This commit is contained in:
zhangxiangliang 2020-08-20 22:10:22 +08:00
parent 7a4938ed3a
commit 952b9ca62e
6 changed files with 46 additions and 0 deletions

View File

@ -20,6 +20,14 @@ const Base: StockApi = {
*/ */
async getStocks(codes: string[]): Promise<Stock[]> { async getStocks(codes: string[]): Promise<Stock[]> {
throw new Error("未实现获取股票数据组"); throw new Error("未实现获取股票数据组");
},
/**
*
* @param key
*/
async searchStocks(key: string): Promise<Stock[]> {
throw new Error("未实现搜索股票代码");
} }
}; };

View File

@ -67,6 +67,14 @@ const Netease: StockApi = {
yesterday: 0, yesterday: 0,
}; };
}); });
},
/**
*
* @param key
*/
async searchStocks(key: string): Promise<Stock[]> {
throw new Error("未实现搜索股票代码");
} }
} }

View File

@ -60,6 +60,14 @@ const Sina: StockApi = {
return data.getStock(); return data.getStock();
}) })
},
/**
*
* @param key
*/
async searchStocks(key: string): Promise<Stock[]> {
throw new Error("未实现搜索股票代码");
} }
} }

View File

@ -60,6 +60,14 @@ const Tencent: StockApi = {
return data.getStock(); return data.getStock();
}) })
},
/**
*
* @param key
*/
async searchStocks(key: string): Promise<Stock[]> {
throw new Error("未实现搜索股票代码");
} }
} }

View File

@ -77,6 +77,14 @@ const Xueqiu: StockApi & { getToken(): Promise<string> } = {
const data = (new XueqiuStockTransform(code, params.quote)); const data = (new XueqiuStockTransform(code, params.quote));
return data.getStock(); return data.getStock();
}); });
},
/**
*
* @param key
*/
async searchStocks(key: string): Promise<Stock[]> {
throw new Error("未实现搜索股票代码");
} }
} }

View File

@ -12,6 +12,12 @@ export interface StockApi {
* @param codes * @param codes
*/ */
getStocks(codes: string[]): Promise<Stock[]>; getStocks(codes: string[]): Promise<Stock[]>;
/**
*
* @param key
*/
searchStocks(key: string): Promise<Stock[]>;
} }
export default StockApi; export default StockApi;