Files
Chan/web/static/js/app/api_client.js
T
jackyu66gitandCursor 74dec4e50b refactor: 缠论引擎包化与 Web 分层(ECR-001)
将根目录引擎迁入 chanlun/ 并保留兼容 shim;拆分 TF_DF 与 web 服务;
前端模块化;strategies 改用 chanlun 导入;补充 ESS 文档与 golden 回归。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 18:48:20 +08:00

22 lines
675 B
JavaScript

/* Chan web API client helpers */
window.ChanApi = {
analyze: function(params) {
const q = new URLSearchParams(params);
return fetch('/api/analyze?' + q.toString()).then(r => r.json());
},
chartMetadata: function() {
return fetch('/api/chart_metadata').then(r => r.json());
},
symbols: function() {
return fetch('/api/symbols').then(r => r.json());
},
macdConfig: function(body) {
if (body === undefined) return fetch('/api/macd_config').then(r => r.json());
return fetch('/api/macd_config', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(body)
}).then(r => r.json());
}
};