import { Market } from '@/constants/market'
import { httpRequest } from '@/services/http'
import { HttpParams } from '@/services/http/interface'
import { tradeServerRequest } from '@/services/socket/trade'
import { TradeParams } from '@/services/socket/trade/interface'

/**
 * 查询我的积分流水
 */
export function queryUserScoreLog(params: HttpParams<{ req: Model.UserScoreLogReq, rsp: Model.UserScoreLogRsp[] }>) {
    return httpRequest('/Ferroalloy/QueryUserScoreLog', 'get', params);
}

/**
 * 查询积分配置
 */
export function queryTHJScoreConfig(params: HttpParams<{ req: Model.THJScoreConfigReq, rsp: Model.THJScoreConfigRsp[] }>) {
    return httpRequest('/Ferroalloy/QueryTHJScoreConfig', 'get', params);
}

/**
 * 铁合金抽奖
 */
export function thjRedPacketLottery(params: TradeParams<Proto.THJRedPacketLotteryReq, Proto.THJRedPacketLotteryRsp>) {
    return tradeServerRequest('THJRedPacketLotteryReq', 'THJRedPacketLotteryRsp', params, Market.THJ_Listing);
}