Commit 17f0c8f7 authored by 1486327116's avatar 1486327116

添加查询用户交易系统配置接口 可以用户判断用户是不是代理

parent dda6fcb9
......@@ -193,10 +193,10 @@ export const changeTradingFee = async (symbol,user_id,maker_fee,taker_fee) => {
return res;
}
// 成为代理
export const setAgent = async (user_id) => {
// 成为代理 user_id==agent_id 代理商 user_id!=agent_id 代理用户
export const setAgent = async (user_id,agent_id) => {
let body = {
user_id
user_id,agent_id
}
let res = {
is_success: true,
......@@ -212,7 +212,7 @@ export const setAgent = async (user_id) => {
return res;
}
// 移除代理
// 移除代理商或者代理用户
export const removeAgent = async (user_id) => {
let body = {
user_id
......@@ -253,7 +253,7 @@ export const addAgentSetting = async (user_id,market,symbol,ratio) => {
}
// {"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 可以判断是不是代理商
export const getUserDetail = async (user_id) => {
const url = `${webadmin_endpoint}/user/detail?user_id=${user_id}`
......@@ -264,3 +264,16 @@ export const getUserDetail = async (user_id) => {
}
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment