modify recommend page

This commit is contained in:
simple321vip
2022-12-28 21:25:22 +08:00
parent ab326d5cbb
commit b23d35c29b
15 changed files with 527 additions and 226 deletions
+11 -11
View File
@@ -1,10 +1,10 @@
import { trader_service } from '../utils/request'
import { service } from '../utils/request'
"CTA strategy"
"query account"
const get_accounts = () => {
return trader_service({
return service({
url: '/trader/api/v1/accounts',
method: 'GET',
})
@@ -12,7 +12,7 @@ const get_accounts = () => {
"get contract"
const get_contract = (symbol: string) => {
return trader_service({
return service({
url: '/trader/api/v1/contract/' + symbol,
method: 'GET',
})
@@ -20,7 +20,7 @@ const get_contract = (symbol: string) => {
"get tick"
const get_tick = (symbol: string) => {
return trader_service({
return service({
url: '/trader/api/v1/tick/' + symbol,
method: 'GET',
})
@@ -28,7 +28,7 @@ const get_tick = (symbol: string) => {
"get ticks"
const get_ticks = () => {
return trader_service({
return service({
url: '/trader/api/v1/ticks',
method: 'GET',
})
@@ -36,16 +36,16 @@ const get_ticks = () => {
"send_order"
const send_order = (data: any) => {
return trader_service({
return service({
url: '/trader/api/v1/order',
method: 'POST',
data: data
})
}
"get tick"
"subscribe tick"
const subscribe = (symbol: string) => {
return trader_service({
return service({
url: '/trader/api/v1/subscribe/' + symbol,
method: 'GET',
})
@@ -53,7 +53,7 @@ const subscribe = (symbol: string) => {
"get subscribe vt_symbols"
const get_subscribe_vt_symbols = () => {
return trader_service({
return service({
url: '/trader/api/v1/subscribe/vt_symbols',
method: 'GET',
})
@@ -61,7 +61,7 @@ const get_subscribe_vt_symbols = () => {
"get all vt_symbols"
const get_vt_symbols = () => {
return trader_service({
return service({
url: '/trader/api/v1/vt_symbols',
method: 'GET',
})
@@ -69,7 +69,7 @@ const get_vt_symbols = () => {
"get exchanges"
const get_exchanges = () => {
return trader_service({
return service({
url: '/trader/api/v1/exchanges',
method: 'GET',
})
+14 -14
View File
@@ -1,10 +1,10 @@
import { trader_service } from '../utils/request'
import { service } from '../utils/request'
"CTA strategy"
"strategy file list"
const get_strategy_files = () => {
return trader_service({
return service({
url: '/trader/api/v1/strategy_file',
method: 'GET',
})
@@ -12,7 +12,7 @@ const get_strategy_files = () => {
"strategy file list"
const get_strategy_load_files = () => {
return trader_service({
return service({
url: '/trader/api/v1/strategy_file/load',
method: 'GET',
})
@@ -22,7 +22,7 @@ const get_strategy_load_files = () => {
const upload_strategy_file = (file: any) => {
const formData = new FormData();
formData.append("file", file)
return trader_service({
return service({
url: '/trader/api/v1/strategy_file',
method: 'POST',
data: formData,
@@ -34,7 +34,7 @@ const upload_strategy_file = (file: any) => {
"load a strategy file"
const load_strategy_file = (file_name: string) => {
return trader_service({
return service({
url: '/trader/api/v1/strategy_file/' + file_name,
method: 'PUT',
})
@@ -42,7 +42,7 @@ const load_strategy_file = (file_name: string) => {
"unload a strategy file"
const unload_strategy_file = (class_name: string) => {
return trader_service({
return service({
url: '/trader/api/v1/strategy_file/' + class_name,
method: 'PATCH',
})
@@ -50,7 +50,7 @@ const unload_strategy_file = (class_name: string) => {
"remove a strategy file"
const remove_strategy_file = (file_name: string) => {
return trader_service({
return service({
url: '/trader/api/v1/strategy_file/' + file_name,
method: 'DELETE',
})
@@ -59,7 +59,7 @@ const remove_strategy_file = (file_name: string) => {
"get strategy list"
const get_strategies = () => {
return trader_service({
return service({
url: '/trader/api/v1/strategies',
method: 'GET',
})
@@ -67,7 +67,7 @@ const get_strategies = () => {
"create a strategy"
const create_strategy = (ruleForm: any) => {
return trader_service({
return service({
url: '/trader/api/v1/strategy/' + ruleForm.strategy_name,
method: 'POST',
data: ruleForm
@@ -76,7 +76,7 @@ const create_strategy = (ruleForm: any) => {
"init a strategy"
const init_strategy = (strategy_name: string) => {
return trader_service({
return service({
url: '/trader/api/v1/strategy/init/' + strategy_name,
method: 'PUT',
})
@@ -84,7 +84,7 @@ const init_strategy = (strategy_name: string) => {
"start a strategy"
const start_strategy = (strategy_name: string) => {
return trader_service({
return service({
url: '/trader/api/v1/strategy/' + strategy_name,
method: 'PUT',
})
@@ -92,7 +92,7 @@ const start_strategy = (strategy_name: string) => {
"stop a strategy"
const stop_strategy = (strategy_name: string) => {
return trader_service({
return service({
url: '/trader/api/v1/strategy/' + strategy_name,
method: 'PATCH',
})
@@ -100,7 +100,7 @@ const stop_strategy = (strategy_name: string) => {
"remove a strategy"
const remove_strategy = (strategy_name: string) => {
return trader_service({
return service({
url: '/trader/api/v1/strategy/' + strategy_name,
method: 'DELETE',
})
@@ -108,7 +108,7 @@ const remove_strategy = (strategy_name: string) => {
"get a strategy status"
const get_strategy_status = (strategy_name: string) => {
return trader_service({
return service({
url: '/trader/api/v1/strategy/status/' + strategy_name,
method: 'GET',
})