import { request } from '@/api'
import type { searchParams, pointDiffConfigParams } from '@/api/types/account/market'

// 查询和获取做市商列表
export async function getMarketListApi(params: searchParams): Promise<any> {
  return request.get<any>('agent/getAgentList', { ...params })
}

//获取所属上级列表
export async function getParAgentListApi(params: pointDiffConfigParams): Promise<any> {
  return request.get<any>('/agent/getParAgentListByRoleId', { ...params }, { showMessage: false })
}

//获取代理点差列表
export async function getPointDiffConfigListApi(params: pointDiffConfigParams): Promise<any> {
  return request.get<any>('/agent/getSelfVarietyPointDiffConfig', { ...params }, { showMessage: false })
}

//获取风控模板选列表
export async function getRiskTemplateListApi(): Promise<any> {
  return request.get<any>('/agent/getRiskControlOptions', undefined, { showMessage: false })
}

//添加做市商
export async function addMarketApi(params: any): Promise<any> {
  return request.post<any>('/agent/createAgent', { ...params })
}
//编辑做市商
export async function editMarketApi(params: any): Promise<any> {
  return request.post<any>('/agent/editAgent', { ...params })
}
//编辑做市商账户基本信息
export async function updateCapital(params: any): Promise<any> {
  return request.post<any>('/user/updateCapital', { ...params })
}
//编辑做市商保证金
export async function editAgentBail(params: any): Promise<any> {
  return request.post<any>('/agent/editAgentBail', { ...params })
}

//获取承接特殊做市选项
export async function getBasetsOptionsApi(): Promise<any> {
  return request.get<any>('/agent/getBasetsOptions', undefined, { showMessage: false })
}
