From 01e222e7fc362a92356142e794a849c1387857e4 Mon Sep 17 00:00:00 2001 From: simple321vip Date: Sun, 29 Jan 2023 23:27:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20bk=20futrue=20mock?= =?UTF-8?q?=EF=BC=8C=20=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=8E=86=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=BC=8F=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/bookmark.ts | 34 +++++++++++- mock/future.ts | 102 ++++++++++++++++++++++++++++++++++++ src/view/calendar/index.vue | 32 ++++++----- 3 files changed, 155 insertions(+), 13 deletions(-) diff --git a/mock/bookmark.ts b/mock/bookmark.ts index ded3879..723bf7c 100644 --- a/mock/bookmark.ts +++ b/mock/bookmark.ts @@ -9,5 +9,37 @@ export default [ count: 53, } } - } + }, + { + url: '/bookmark/api/v1/bookmark', + method: 'get', + response: () => { + return [ + { + bk_id: '001', + bk_type_id: '2', + bk_type_name: '3', + comment: '4', + url: '5' + }, + { + bk_id: '002', + bk_type_id: '2', + bk_type_name: '3', + comment: '4', + url: '5' + } + ] + } + }, + { + url: '/bookmark/api/v1/bookmark_type', + method: 'get', + response: () => { + return [ + + ] + } + }, + ] as MockMethod[] diff --git a/mock/future.ts b/mock/future.ts index e3cb5d6..3c67827 100644 --- a/mock/future.ts +++ b/mock/future.ts @@ -130,5 +130,107 @@ export default [ } } }, + { + url: '/trader/api/v1/accounts', + method: 'get', + response: ({ body, query }) => { + return { + accounts: [ + { + gateway_name: 'cpt', + account_id: '7788', + balance: '7', + frozen: '8', + }, + { + gateway_name: 'cpt', + account_id: '778899', + balance: '8', + frozen: '9', + } + ], + positions: [ + { + symbol: 'czce', + exchange: 'RM301', + direction: '1', + volume: 222, + price: 2500, + frozen: 3, + pnl: 2, + yd_volume: 1, + } + ], + trades: [ + { + symbol: 'string', + exchange: 'string', + direction: 'string', + volume: 2, + price: 4, + orderid: 'string', + tradeid: 'string', + offset: 'string', + } + ], + orders: [{ + symbol: 'string', + exchange: 'string', + direction: 'string', + volume: 6, + price: 4, + orderid: 'string', + type: 'string', + offset: 'string', + traded: 7, + status: 'string', + // datetime :datetime + reference: 'string', + }] + } + } + }, + { + url: '/trader/api/v1/strategy_file', + method: 'get', + response: ({ body, query }) => { + return [ + { + file_name: 'string', + class_name: 'string', + status: 'string', + } + ] + } + }, + { + url: '/trader/api/v1/strategies', + method: 'get', + response: ({ body, query }) => { + return [ + { + strategy_name: 'string', + class_name: 'string', + vt_symbol: 'string', + setting: Object, + status: 1, + } + ] + } + }, + { + url: '/trader/api/v1/strategy_file/load', + method: 'get', + response: ({ body, query }) => { + return [ + { + class_names: 'asdasdas' + } + ] + } + }, + + + ] as MockMethod[] diff --git a/src/view/calendar/index.vue b/src/view/calendar/index.vue index 2294110..4b33c77 100644 --- a/src/view/calendar/index.vue +++ b/src/view/calendar/index.vue @@ -1,6 +1,7 @@