import httpClient from '@/services/http'
import { CommonFetchOptions } from '@/services/http/types'
import { useUserStore } from '@/stores'

const userStore = useUserStore()

/**
 * 市场运行管理-->监控管理-->在线用户查询-->获取列表
 */
export function marketRunUserLogin(options: CommonFetchOptions<{ request: Model.MarketRunUserLoginReq; response: Model.MarketRunUserLoginRsp; }>) {
    return httpClient.commonRequest('/marketRun/queryUserLogin', 'get', options)
}

/**
 * 市场运行管理-->监控管理-->在线用户查询-->强制下线
 */
export function marketRunDownonline(options: CommonFetchOptions<{ request: Model.MarketRunDownonlineReq; }> = {}) {
    return httpClient.commonRequest('/marketRun/downonline', 'get', options)
}

/**
 * 市场运行管理-->监控管理-->斩仓监控-->获取列表
 */
export function marketRunCutposition(options: CommonFetchOptions<{ request: Model.MarketRunCutpositionReq; response: Model.MarketRunCutpositionRsp[]; }> = {}) {
    return httpClient.commonRequest('/marketRun/cutposition', 'get', options)
}

/**
 * 市场运行管理-->监控管理-->账户风险监控-->获取列表
 */
export function marketRunInvestor(options: CommonFetchOptions<{ request: Model.MarketRunInvestorReq; response: Model.MarketRunInvestorRsp[]; }> = {}) {
    return httpClient.commonRequest('/marketRun/investor', 'get', options)
}

/**
 * 市场运行管理-->监控管理-->账户风险监控-->初始化参数信息
 */
export function marketRunInitInvestor(options: CommonFetchOptions<{ response: Model.MarketRunInitInvestorRsp; }> = {}) {
    return httpClient.commonRequest('/marketRun/initInvestor', 'get', options)
}

/**
 * 市场运行管理-->监控管理-->做市会员风险监控-->获取列表
 */
export function marketRunMemberRisk(options: CommonFetchOptions<{ request: Model.MarketRunMemberRiskReq; response: Model.MarketRunMemberRiskRsp[]; }>) {
    options.data = {
        orgztypes: userStore.userInfo.orgztypes,
        ...options.data
    }
    return httpClient.commonRequest('/marketRun/memberRisk', 'get', options)
}

/**
 * 市场运行管理-->监控管理-->做市会员风险监控-->账户持仓汇总监控-->获取列表
 */
export function marketRunAccpage(options: CommonFetchOptions<{ request: Model.MarketRunAccpageReq; response: Model.MarketRunAccpageRsp[]; }>) {
    return httpClient.commonRequest('/marketRun/accpage', 'get', options)
}

/**
 * 市场运行管理-->监控管理-->做市会员风险监控-->账户持仓汇总监控-->持仓明细
 */
export function queryHolderDetailMonitor(options: CommonFetchOptions<{ request: Model.HolderDetailMonitorReq; response: Model.HolderDetailMonitorRsp[]; }>) {
    return httpClient.commonRequest('/marketRun/queryHolderDetailMonitor', 'get', options)
}