44 lines
909 B
Plaintext
44 lines
909 B
Plaintext
|
|
/**
|
||
|
|
* 资产API
|
||
|
|
*/
|
||
|
|
import { get, post } from './request.uts'
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取资产总览
|
||
|
|
*/
|
||
|
|
export func getAssetOverview (): Promise<any> {
|
||
|
|
return get('/api/asset/overview', null)
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取资金账户
|
||
|
|
*/
|
||
|
|
export func getFundAccount (): Promise<any> {
|
||
|
|
return get('/api/asset/fund', null)
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取交易账户
|
||
|
|
*/
|
||
|
|
export func getTradeAccounts (): Promise<any> {
|
||
|
|
return get('/api/asset/trade', null)
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 资金划转
|
||
|
|
*/
|
||
|
|
export func transfer (direction: number, amount: string): Promise<any> {
|
||
|
|
return post('/api/asset/transfer', { direction, amount } as UTSJSONObject)
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取资金流水
|
||
|
|
*/
|
||
|
|
export func getFlows (flowType: number | null, pageNum: number, pageSize: number): Promise<any> {
|
||
|
|
const params: UTSJSONObject = { pageNum: pageNum, pageSize: pageSize }
|
||
|
|
if (flowType !== null) {
|
||
|
|
params['flowType'] = flowType
|
||
|
|
}
|
||
|
|
return get('/api/asset/flow', params)
|
||
|
|
}
|