import { httpRequest } from '@/services/http'
import { HttpParams } from '@/services/http/interface'

/**
 * 商品列表
 */
export function queryGoodsList(params: HttpParams<{ rsp: Model.GoodsRsp[] }>) {
    return httpRequest('/goods', 'get', params);
}

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

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

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

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

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

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

/**
 * 获取现货行情
 */
export function querySpotGoodsPrice(params: HttpParams<{ req: Model.SpotGoodsPriceReq, rsp: Model.SpotGoodsPriceRsp[] }>) {
    return httpRequest('/Ferroalloy/GetSpotGoodsPrice', 'get', params);
}

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