import { httpRequest } from '@/services/http'
import { HttpRequest } from '@/services/http/interface'
import { tradeServerRequest } from '@/services/socket/trade'
import { TradeRequest } from '@/services/socket/trade/interface'

/**
 * 查询收货地址信息
 */
export function queryUserReceiveInfo(params: HttpRequest<{ req: Ermcp.UserReceiveInfoReq, rsp: Ermcp.UserReceiveInfoRsp[] }>) {
    return httpRequest('/Qhj/QueryUserReceiveInfo', 'get', params);
}

/**
 * 查询发票信息
 */
export function queryWrUserReceiptInfo(params: HttpRequest<{ req: Ermcp.WrUserReceiptInfoReq, rsp: Ermcp.WrUserReceiptInfoRsp[] }>) {
    return httpRequest('/WrTrade2/QueryWrUserReceiptInfo', 'get', params);
}

/**
 * 新增修改收货地址
 */
export function userReceiveInfo(params: TradeRequest<Proto.UserReceiveInfoReq, Proto.UserReceiveInfoRsp>) {
    return tradeServerRequest('UserReceiveInfoReq', 'UserReceiveInfoRsp', params);
}

/**
 * 删除收货地址
 */
export function delUserReceiveInfo(params: TradeRequest<Proto.DelUserReceiveInfoReq, Proto.DelUserReceiveInfoRsp>) {
    return tradeServerRequest('DelUserReceiveInfoReq', 'DelUserReceiveInfoRsp', params);
}

/**
 * 设置默认收货地址
 */
export function userReceiveIsDefault(params: TradeRequest<Proto.UserReceiveIsDefaultReq, Proto.UserReceiveIsDefaultRsp>) {
    return tradeServerRequest('UserReceiveIsDefaultReq', 'UserReceiveIsDefaultRsp', params);
}

/**
 * 新增修改用户发票信息
 */
export function userReceiptInfo(params: TradeRequest<Proto.UserReceiptInfoReq, Proto.UserReceiptInfoRsp>) {
    return tradeServerRequest('UserReceiptInfoReq', 'UserReceiptInfoRsp', params);
}

/**
 * 删除用户发票信息
 */
export function delUserReceiptInfo(params: TradeRequest<Proto.DelUserReceiptInfoReq, Proto.DelUserReceiptInfoRsp>) {
    return tradeServerRequest('DelUserReceiptInfoReq', 'DelUserReceiptInfoRsp', params);
}