import { httpRequest } from '@/services/http'
import { loginStore } from '@/stores'

const { userId } = loginStore.$mapGetters()

/**
 * 查询企业风管期货商品信息
 */
export function queryErmcpGoods(params?: Model.GoodsReq) {
    return httpRequest<Model.GoodsRsp[]>('/Ermcp/GetErmcpGoods', 'get', params, 'GetErmcpGoods');
}

/**
 * 获取商品盘面信息
 */
export function queryQuoteDay(params: Model.QuoteDayReq) {
    return httpRequest<Model.QuoteDayRsp[]>('/Quote/QueryQuoteDay', 'get', params, 'QueryQuoteDay');
}

/**
 * 查询采购列表
 */
export function queryTHJWrstandard(params: Model.THJWrstandardReq) {
    return httpRequest<Model.THJWrstandardRsp[]>('/Ferroalloy/QueryTHJWrstandard', 'get', params);
}

/**
 * 查询采购详情
 */
export function queryTHJWrstandardDetail(params: Model.THJWrstandardDetailReq) {
    return httpRequest<Model.THJWrstandardDetailRsp>('/Ferroalloy/QueryTHJWrstandardDetail', 'get', params);
}

/**
 * 查询供求列表
 */
export function queryTHJListing(params: Model.THJListingReq) {
    return httpRequest<Model.THJListingRsp[]>('/Ferroalloy/QueryTHJListing', 'get', params);
}

/**
 * 查询大厅行情列表
 */
export function queryOrderQuote(params: Model.OrderQuoteReq) {
    return httpRequest<Model.OrderQuoteRsp[]>('/WrTrade2/QueryOrderQuote', 'get', params);
}

/**
 * 查询买卖大厅
 */
export function queryOrderQuoteDetail(params: Model.OrderQuoteDetailReq) {
    return httpRequest<Model.OrderQuoteDetailRsp[]>('/WrTrade2/QueryOrderQuoteDetail', 'get', params);
}

/**
 * 移除用户商品收藏信息
 */
export function removeUserFavoriteGoods(params: Model.UserFavoriteGoodsReq) {
    return httpRequest<Model.UserFavoriteGoodsRsp>('/User/RemoveUserFavoriteGoods', 'post', params);
}

/**
 * 添加用户商品收藏信息
 */
export function addUserFavoriteGoods(params: Model.UserFavoriteGoodsReq) {
    return httpRequest<Model.UserFavoriteGoodsRsp>('/User/AddUserFavoriteGoods', 'post', params);
}

/**
 * 获取我的推广-交易数据
 */
export function queryTHJTradeData(params: Model.THJTradeDataReq) {
    params.userid = userId.value
    return httpRequest<Model.THJTradeDataRsp[]>('/Ferroalloy/QueryTHJTradeData', 'get', params);
}

/**
 * 获取产品介绍列表
 */
export function queryTHJProduct(params: Model.THJProductReq) {
    params.userid = userId.value
    return httpRequest<Model.THJProductRsp[]>('/Ferroalloy/QueryTHJProduct', 'get', params);
}

/**
 * 查询市场运行信息
 */
export function queryMarketRun(params?: Model.MarketRunReq) {
    return httpRequest<Model.MarketRunRsp[]>('/Market/QueryMarketRun', 'get', params);
}

/**
 * 查询市场交易参数配置
 */
export function queryWrMarketTradeConfig(params: Model.WrMarketTradeConfigReq) {
    return httpRequest<Model.WrMarketTradeConfigRsp[]>('/WrTrade2/QueryWrMarketTradeConfig', 'get', params);
}