Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
ts-api-demo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wmvm
ts-api-demo
Commits
17f0c8f7
Commit
17f0c8f7
authored
Nov 18, 2024
by
1486327116
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加查询用户交易系统配置接口 可以用户判断用户是不是代理
parent
dda6fcb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
coreSystemUtils.ts
src/utils/coreSystemUtils.ts
+18
-5
No files found.
src/utils/coreSystemUtils.ts
View file @
17f0c8f7
...
@@ -193,10 +193,10 @@ export const changeTradingFee = async (symbol,user_id,maker_fee,taker_fee) => {
...
@@ -193,10 +193,10 @@ export const changeTradingFee = async (symbol,user_id,maker_fee,taker_fee) => {
return
res
;
return
res
;
}
}
// 成为代理
// 成为代理
user_id==agent_id 代理商 user_id!=agent_id 代理用户
export
const
setAgent
=
async
(
user_id
)
=>
{
export
const
setAgent
=
async
(
user_id
,
agent_id
)
=>
{
let
body
=
{
let
body
=
{
user_id
user_id
,
agent_id
}
}
let
res
=
{
let
res
=
{
is_success
:
true
,
is_success
:
true
,
...
@@ -212,7 +212,7 @@ export const setAgent = async (user_id) => {
...
@@ -212,7 +212,7 @@ export const setAgent = async (user_id) => {
return
res
;
return
res
;
}
}
// 移除代理
// 移除代理
商或者代理用户
export
const
removeAgent
=
async
(
user_id
)
=>
{
export
const
removeAgent
=
async
(
user_id
)
=>
{
let
body
=
{
let
body
=
{
user_id
user_id
...
@@ -253,7 +253,7 @@ export const addAgentSetting = async (user_id,market,symbol,ratio) => {
...
@@ -253,7 +253,7 @@ export const addAgentSetting = async (user_id,market,symbol,ratio) => {
}
}
// {"agentId":0,"takerFee":"1","makerFee":"1","id":12321321}
// {"agentId":0,"takerFee":"1","makerFee":"1","id":12321321}
// agentId=0 表示不是代理
agentId = userId(id) 目前agentid 只有这2种情况 表示是代理商
// agentId=0 表示不是代理
商或者代理用户 user_id==agent_id 代理商 user_id!=agent_id 代理用户
// 所以这个接口的返回里的agentId 可以判断是不是代理商
// 所以这个接口的返回里的agentId 可以判断是不是代理商
export
const
getUserDetail
=
async
(
user_id
)
=>
{
export
const
getUserDetail
=
async
(
user_id
)
=>
{
const
url
=
`
${
webadmin_endpoint
}
/user/detail?user_id=
${
user_id
}
`
const
url
=
`
${
webadmin_endpoint
}
/user/detail?user_id=
${
user_id
}
`
...
@@ -263,4 +263,17 @@ export const getUserDetail = async (user_id) => {
...
@@ -263,4 +263,17 @@ export const getUserDetail = async (user_id) => {
return
null
return
null
}
}
return
data
.
result
;
return
data
.
result
;
}
// 获取代理商配置配置
// [{"product":"BTC_USDT","qty":"0","id":1,"ratio":"0.5"}]
// 交易对 对冲数量 交易对id 对冲比例
export
const
getAgentSettings
=
async
(
agent_id
)
=>
{
const
url
=
`
${
webadmin_endpoint
}
/market_maker/agent_settings?agent_id=
${
agent_id
}
`
let
{
data
}
=
await
axios
.
get
(
url
);
if
(
data
.
state
!=
0
)
{
logger
.
error
(
"getUserDetail"
,
data
.
msg
);
return
null
}
return
data
.
result
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment