import http from '@/services/http'
import tradeServer from '@/services/socket/trade'

/**
 * 查询商品列表
 */
export function queryGoodsList() {
    return http.commonRequest<Ermcp.GoodsRsp[]>({
        url: '/goods',
    })
}

/**
 * 查询钻石列表
 */
export function queryDiamondList(params: Ermcp.MyWRPositionReq) {
    return http.commonRequest<Ermcp.MyWRPositionRsp[]>({
        url: '/Guangzuan/QueryMyWRPosition',
        params,
    })
}

/**
 * 获取钻石详情
 */
export function queryDiamondDetails(params: Ermcp.DiamondDetailsReq) {
    return http.commonRequest<Ermcp.DiamondDetailsRsp>({
        url: '/Guangzuan/GetGoods',
        params,
    })
}

/**
 * 新增钻石商品
 */
export function addDiamond(params: Proto.AddZSGoodsReq) {
    return tradeServer.sendMessage<Proto.AddZSGoodsRsp>({
        params,
        reqName: 'AddZSGoodsReq',
        rspName: 'AddZSGoodsRsp',
        marketId: 67201
    })
}

/**
 * 钻石出库申请
 */
export function receiptZSOutApply(params: Proto.ReceiptZSOutApplyReq) {
    return tradeServer.sendMessage<Proto.ReceiptZSOutApplyRsp>({
        params,
        reqName: 'ReceiptZSOutApplyReq',
        rspName: 'ReceiptZSOutApplyRsp',
        marketId: 4
    })
}